Showing the changes to interface/src/graphics/GraphicsEngine.cpp (1 of 22 files). Show all
Unified · Split
| @@ -46,7 +46,11 @@ GraphicsEngine::GraphicsEngine() { · 45 unmodified lines | ||
| 46 | 46 | GraphicsEngine::~GraphicsEngine() { |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | −void GraphicsEngine::initializeGPU(GLWidget* glwidget) { | |
| 49 | +#ifdef USE_GL | |
| 50 | +void GraphicsEngine::initializeGPU(GLWidget* primaryWidget) { | |
| 51 | +#else | |
| 52 | +void GraphicsEngine::initializeGPU(VKWidget* primaryWidget) { | |
| 53 | +#endif | |
| 50 | 54 | |
| 51 | 55 | _renderEventHandler = new RenderEventHandler( |
| 52 | 56 | [this]() { return this->shouldPaint(); }, |
| @@ -56,13 +60,13 @@ void GraphicsEngine::initializeGPU(GLWidget* glwidget) { · 3 unmodified lines | ||
| 56 | 60 | // Requires the window context, because that's what's used in the actual rendering |
| 57 | 61 | // and the GPU backend will make things like the VAO which cannot be shared across |
| 58 | 62 | // contexts |
| 59 | − glwidget->makeCurrent(); | |
| 63 | + primaryWidget->makeCurrent(); | |
| 60 | 64 | #ifdef USE_GL |
| 61 | 65 | gpu::Context::init<gpu::gl::GLBackend>(); |
| 62 | 66 | #else |
| 63 | 67 | gpu::Context::init<gpu::vk::VKBackend>(); |
| 64 | 68 | #endif |
| 65 | − glwidget->makeCurrent(); | |
| 69 | + primaryWidget->makeCurrent(); | |
| 66 | 70 | _gpuContext = std::make_shared<gpu::Context>(); |
| 67 | 71 | |
| 68 | 72 | #ifndef Q_OS_ANDROID |