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
46GraphicsEngine::~GraphicsEngine() {46GraphicsEngine::~GraphicsEngine() {
47}47}
48 48
49void GraphicsEngine::initializeGPU(GLWidget* glwidget) {49#ifdef USE_GL
50void GraphicsEngine::initializeGPU(GLWidget* primaryWidget) {
51#else
52void 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 rendering60 // 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 across61 // and the GPU backend will make things like the VAO which cannot be shared across
58 // contexts62 // contexts
59 glwidget->makeCurrent();63 primaryWidget->makeCurrent();
60#ifdef USE_GL64#ifdef USE_GL
61 gpu::Context::init<gpu::gl::GLBackend>();65 gpu::Context::init<gpu::gl::GLBackend>();
62#else66#else
63 gpu::Context::init<gpu::vk::VKBackend>();67 gpu::Context::init<gpu::vk::VKBackend>();
64#endif68#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_ANDROID72#ifndef Q_OS_ANDROID