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/Application_Graphics.cpp (1 of 22 files). Show all

Unified · Split

interface/src/Application_Graphics.cpp+10−10
@@ -77,7 +77,7 @@ void Application::initializeGL() { · 76 unmodified lines
7777 _isGLInitialized = true;
7878 }
7979
80− _glWidget->windowHandle()->setFormat(getDefaultOpenGLSurfaceFormat());
80+ _primaryWidget->windowHandle()->setFormat(getDefaultOpenGLSurfaceFormat()); // VKTODO
8181
8282 // When loading QtWebEngineWidgets, it creates a global share context on startup.
8383 // We have to account for this possibility by checking here for an existing
@@ -118,9 +118,9 @@ void Application::initializeGL() { · 34 unmodified lines
118118 }
119119 #endif
120120
121− _glWidget->createContext(globalShareContext);
121+ _primaryWidget->createContext(globalShareContext);
122122
123− if (!_glWidget->makeCurrent()) {
123+ if (!_primaryWidget->makeCurrent()) {
124124 qCWarning(interfaceapp, "Unable to make window context current");
125125 }
126126
@@ -147,7 +147,7 @@ void Application::initializeGL() { · 20 unmodified lines
147147 #endif
148148
149149 if (!globalShareContext) {
150− globalShareContext = _glWidget->qglContext();
150+ globalShareContext = _primaryWidget->qglContext();
151151 qt_gl_set_global_share_context(globalShareContext);
152152 }
153153
@@ -162,19 +162,19 @@ void Application::initializeGL() { · 8 unmodified lines
162162 }
163163 OffscreenQmlSurface::setSharedContext(qmlShareContext->getContext());
164164 qmlShareContext->doneCurrent();
165− if (!_glWidget->makeCurrent()) {
165+ if (!_primaryWidget->makeCurrent()) {
166166 qCWarning(interfaceapp, "Unable to make window context current");
167167 }
168168 }
169169 #endif
170170
171171 // Build an offscreen GL context for the main thread.
172− _glWidget->makeCurrent();
172+ _primaryWidget->makeCurrent();
173173 glClearColor(0.2f, 0.2f, 0.2f, 1);
174174 glClear(GL_COLOR_BUFFER_BIT);
175− _glWidget->swapBuffers();
175+ _primaryWidget->swapBuffers(); //VKTODO
176176
177− _graphicsEngine->initializeGPU(_glWidget);
177+ _graphicsEngine->initializeGPU(_primaryWidget);
178178 }
179179
180180 void Application::initializeRenderEngine() {
@@ -318,7 +318,7 @@ void Application::initializeUi() { · 137 unmodified lines
318318 setupPreferences();
319319
320320 #if !defined(DISABLE_QML)
321− _glWidget->installEventFilter(offscreenUi.data());
321+ _primaryWidget->installEventFilter(offscreenUi.data());
322322 offscreenUi->setMouseTranslator([=, this](const QPointF& pt) {
323323 QPointF result = pt;
324324 auto displayPlugin = getActiveDisplayPlugin();
@@ -456,7 +456,7 @@ void Application::resizeGL() { · 131 unmodified lines
456456 }
457457
458458 glm::uvec2 Application::getCanvasSize() const {
459− return glm::uvec2(_glWidget->width(), _glWidget->height());
459+ return glm::uvec2(_primaryWidget->width(), _primaryWidget->height());
460460 }
461461
462462 float Application::getRenderResolutionScale() const {