aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl/main.cpp
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2020-05-28 17:00:25 +0200
committerArisotura <thetotalworm@gmail.com>2020-05-28 17:00:25 +0200
commit2912a07b8babb602aaf315e62667044a07adf8e7 (patch)
treeacd390ea5b1523790443320a02c75c789b524830 /src/frontend/qt_sdl/main.cpp
parentd1d572210fdcef0932aaa2f0c6df71f6f2161c75 (diff)
fix bugs, clean up some of the shit
Diffstat (limited to 'src/frontend/qt_sdl/main.cpp')
-rw-r--r--src/frontend/qt_sdl/main.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp
index b6282fe..de71da9 100644
--- a/src/frontend/qt_sdl/main.cpp
+++ b/src/frontend/qt_sdl/main.cpp
@@ -282,7 +282,7 @@ void EmuThread::initOpenGL()
return;
}
- oglContext = new QOpenGLContext();//oglSurface);
+ oglContext = new QOpenGLContext();
oglContext->setFormat(oglSurface->format());
oglContext->setShareContext(windowctx);
if (!oglContext->create())
@@ -797,9 +797,16 @@ ScreenPanelGL::ScreenPanelGL(QWidget* parent) : QOpenGLWidget(parent)
ScreenPanelGL::~ScreenPanelGL()
{
- // CHECKME!!!!
- // ALSO TODO: CLEANUP
+ makeCurrent();
+
+ glDeleteTextures(1, &screenTexture);
+
+ glDeleteVertexArrays(1, &screenVertexArray);
+ glDeleteBuffers(1, &screenVertexBuffer);
+
delete screenShader;
+
+ doneCurrent();
}
void ScreenPanelGL::setupScreenLayout()
@@ -1793,6 +1800,7 @@ void MainWindow::onUpdateVideoSettings(bool glchange)
delete panel;
createScreenPanel();
connect(emuThread, SIGNAL(windowUpdate()), panel, SLOT(update()));
+ if (hasOGL) emuThread->initOpenGL();
}
videoSettingsDirty = true;