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 | GraphicsEngine::~GraphicsEngine() { | 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 | _renderEventHandler = new RenderEventHandler( | 55 | _renderEventHandler = new RenderEventHandler( |
| 52 | [this]() { return this->shouldPaint(); }, | 56 | [this]() { return this->shouldPaint(); }, |
| @@ -56,13 +60,13 @@ void GraphicsEngine::initializeGPU(GLWidget* glwidget) { · 3 unmodified lines | |||
| 56 | // Requires the window context, because that's what's used in the actual rendering | 60 | // Requires the window context, because that's what's used in the actual rendering |
| 57 | // and the GPU backend will make things like the VAO which cannot be shared across | 61 | // and the GPU backend will make things like the VAO which cannot be shared across |
| 58 | // contexts | 62 | // contexts |
| 59 | glwidget->makeCurrent(); | 63 | primaryWidget->makeCurrent(); |
| 60 | #ifdef USE_GL | 64 | #ifdef USE_GL |
| 61 | gpu::Context::init<gpu::gl::GLBackend>(); | 65 | gpu::Context::init<gpu::gl::GLBackend>(); |
| 62 | #else | 66 | #else |
| 63 | gpu::Context::init<gpu::vk::VKBackend>(); | 67 | gpu::Context::init<gpu::vk::VKBackend>(); |
| 64 | #endif | 68 | #endif |
| 65 | glwidget->makeCurrent(); | 69 | primaryWidget->makeCurrent(); |
| 66 | _gpuContext = std::make_shared<gpu::Context>(); | 70 | _gpuContext = std::make_shared<gpu::Context>(); |
| 67 | 71 | ||
| 68 | #ifndef Q_OS_ANDROID | 72 | #ifndef Q_OS_ANDROID |