History

Initial work on rendering in main window, currently broken

ksuprynowicz committed 1 year ago

Commit 1415e2b1 parent 1c1a47a22 files · +535 −63Browse files

Showing the changes to interface/src/graphics/GraphicsEngine.cpp (1 of 22 files). Show all

Unified · Split

interface/src/graphics/GraphicsEngine.cpp+7−3
@@ -46,7 +46,11 @@ GraphicsEngine::GraphicsEngine() { · 45 unmodified lines
4646 GraphicsEngine::~GraphicsEngine() {
4747 }
4848
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
5054
5155 _renderEventHandler = new RenderEventHandler(
5256 [this]() { return this->shouldPaint(); },
@@ -56,13 +60,13 @@ void GraphicsEngine::initializeGPU(GLWidget* glwidget) { · 3 unmodified lines
5660 // Requires the window context, because that's what's used in the actual rendering
5761 // and the GPU backend will make things like the VAO which cannot be shared across
5862 // contexts
59− glwidget->makeCurrent();
63+ primaryWidget->makeCurrent();
6064 #ifdef USE_GL
6165 gpu::Context::init<gpu::gl::GLBackend>();
6266 #else
6367 gpu::Context::init<gpu::vk::VKBackend>();
6468 #endif
65− glwidget->makeCurrent();
69+ primaryWidget->makeCurrent();
6670 _gpuContext = std::make_shared<gpu::Context>();
6771
6872 #ifndef Q_OS_ANDROID