diff --git a/src/duckstation-qt/CMakeLists.txt b/src/duckstation-qt/CMakeLists.txt
index 3f9f16d9f..75063a7d2 100644
--- a/src/duckstation-qt/CMakeLists.txt
+++ b/src/duckstation-qt/CMakeLists.txt
@@ -20,6 +20,8 @@ add_executable(duckstation-qt
opengldisplaywindow.h
portsettingswidget.cpp
portsettingswidget.h
+ qtdisplaywindow.cpp
+ qtdisplaywindow.h
qthostinterface.cpp
qthostinterface.h
qtsettingsinterface.cpp
diff --git a/src/duckstation-qt/duckstation-qt.vcxproj b/src/duckstation-qt/duckstation-qt.vcxproj
index 38e54dc7d..a76a235b6 100644
--- a/src/duckstation-qt/duckstation-qt.vcxproj
+++ b/src/duckstation-qt/duckstation-qt.vcxproj
@@ -36,6 +36,7 @@
+
@@ -49,6 +50,7 @@
+
@@ -103,6 +105,7 @@
+
@@ -255,7 +258,7 @@
_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
true
ProgramDatabase
- $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x86\include;%(AdditionalIncludeDirectories)
+ $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)dep\imgui\include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x86\include;%(AdditionalIncludeDirectories)
true
false
stdcpp17
@@ -276,7 +279,7 @@
_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
true
ProgramDatabase
- $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x64\include;%(AdditionalIncludeDirectories)
+ $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)dep\imgui\include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x64\include;%(AdditionalIncludeDirectories)
true
false
stdcpp17
@@ -297,7 +300,7 @@
_ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
true
ProgramDatabase
- $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x86\include;%(AdditionalIncludeDirectories)
+ $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)dep\imgui\include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x86\include;%(AdditionalIncludeDirectories)
Default
true
false
@@ -320,7 +323,7 @@
_ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
true
ProgramDatabase
- $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x64\include;%(AdditionalIncludeDirectories)
+ $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)dep\imgui\include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x64\include;%(AdditionalIncludeDirectories)
Default
true
false
@@ -342,7 +345,7 @@
MaxSpeed
true
_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
- $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x86\include;%(AdditionalIncludeDirectories)
+ $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)dep\imgui\include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x86\include;%(AdditionalIncludeDirectories)
true
false
stdcpp17
@@ -364,7 +367,7 @@
MaxSpeed
true
_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
- $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x86\include;%(AdditionalIncludeDirectories)
+ $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)dep\imgui\include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x86\include;%(AdditionalIncludeDirectories)
true
true
stdcpp17
@@ -388,7 +391,7 @@
MaxSpeed
true
_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
- $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x64\include;%(AdditionalIncludeDirectories)
+ $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)dep\imgui\include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x64\include;%(AdditionalIncludeDirectories)
true
false
stdcpp17
@@ -410,7 +413,7 @@
MaxSpeed
true
_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
- $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x64\include;%(AdditionalIncludeDirectories)
+ $(SolutionDir)dep\msvc\include;$(SolutionDir)dep\YBaseLib\Include;$(SolutionDir)dep\glad\Include;$(SolutionDir)dep\imgui\include;$(SolutionDir)src;$(SolutionDir)dep\msvc\qt5-x64\include;%(AdditionalIncludeDirectories)
true
true
stdcpp17
diff --git a/src/duckstation-qt/duckstation-qt.vcxproj.filters b/src/duckstation-qt/duckstation-qt.vcxproj.filters
index eea141aec..23c854f39 100644
--- a/src/duckstation-qt/duckstation-qt.vcxproj.filters
+++ b/src/duckstation-qt/duckstation-qt.vcxproj.filters
@@ -21,11 +21,13 @@
+
+
diff --git a/src/duckstation-qt/opengldisplaywindow.cpp b/src/duckstation-qt/opengldisplaywindow.cpp
index c29b37fc2..c6f3c3bbc 100644
--- a/src/duckstation-qt/opengldisplaywindow.cpp
+++ b/src/duckstation-qt/opengldisplaywindow.cpp
@@ -1,9 +1,11 @@
#include "opengldisplaywindow.h"
#include "YBaseLib/Assert.h"
#include "YBaseLib/Log.h"
+#include "imgui.h"
#include "qthostinterface.h"
#include
#include
+#include
#include
Log_SetChannel(OpenGLDisplayWindow);
@@ -95,13 +97,18 @@ private:
};
OpenGLDisplayWindow::OpenGLDisplayWindow(QtHostInterface* host_interface, QWindow* parent)
- : QWindow(parent), m_host_interface(host_interface)
+ : QtDisplayWindow(host_interface, parent)
{
setSurfaceType(QWindow::OpenGLSurface);
}
OpenGLDisplayWindow::~OpenGLDisplayWindow() = default;
+HostDisplay* OpenGLDisplayWindow::getHostDisplayInterface()
+{
+ return this;
+}
+
HostDisplay::RenderAPI OpenGLDisplayWindow::GetRenderAPI() const
{
return HostDisplay::RenderAPI::OpenGL;
@@ -114,7 +121,7 @@ void* OpenGLDisplayWindow::GetRenderDevice() const
void* OpenGLDisplayWindow::GetRenderContext() const
{
- return m_gl_context;
+ return m_gl_context.get();
}
void* OpenGLDisplayWindow::GetRenderWindow() const
@@ -178,7 +185,7 @@ void OpenGLDisplayWindow::SetVSync(bool enabled)
GLint current_fbo = 0;
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
- SetSwapInterval(this, m_gl_context, enabled ? 1 : 0);
+ SetSwapInterval(this, m_gl_context.get(), enabled ? 1 : 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, current_fbo);
}
@@ -190,15 +197,6 @@ std::tuple OpenGLDisplayWindow::GetWindowSize() const
void OpenGLDisplayWindow::WindowResized() {}
-void OpenGLDisplayWindow::keyPressEvent(QKeyEvent* event)
-{
- m_host_interface->handleKeyEvent(event->key(), true);
-}
-
-void OpenGLDisplayWindow::keyReleaseEvent(QKeyEvent* event)
-{
- m_host_interface->handleKeyEvent(event->key(), false);
-}
const char* OpenGLDisplayWindow::GetGLSLVersionString() const
{
@@ -238,9 +236,9 @@ static void APIENTRY GLDebugCallback(GLenum source, GLenum type, GLuint id, GLen
}
}
-bool OpenGLDisplayWindow::createGLContext(QThread* worker_thread)
+bool OpenGLDisplayWindow::createDeviceContext(QThread* worker_thread)
{
- m_gl_context = new QOpenGLContext();
+ m_gl_context = std::make_unique();
// Prefer a desktop OpenGL context where possible. If we can't get this, try OpenGL ES.
static constexpr std::array, 11> desktop_versions_to_try = {
@@ -293,16 +291,21 @@ bool OpenGLDisplayWindow::createGLContext(QThread* worker_thread)
if (!m_gl_context->isValid())
{
Log_ErrorPrintf("Failed to create any GL context");
- delete m_gl_context;
- m_gl_context = nullptr;
+ m_gl_context.reset();
return false;
}
if (!m_gl_context->makeCurrent(this))
{
Log_ErrorPrintf("Failed to make GL context current on UI thread");
- delete m_gl_context;
- m_gl_context = nullptr;
+ m_gl_context.reset();
+ return false;
+ }
+
+ if (!QtDisplayWindow::createDeviceContext(worker_thread))
+ {
+ m_gl_context->doneCurrent();
+ m_gl_context.reset();
return false;
}
@@ -311,12 +314,12 @@ bool OpenGLDisplayWindow::createGLContext(QThread* worker_thread)
return true;
}
-bool OpenGLDisplayWindow::initializeGLContext()
+bool OpenGLDisplayWindow::initializeDeviceContext()
{
if (!m_gl_context->makeCurrent(this))
return false;
- s_thread_gl_context = m_gl_context;
+ s_thread_gl_context = m_gl_context.get();
// Load GLAD.
const auto load_result =
@@ -324,6 +327,8 @@ bool OpenGLDisplayWindow::initializeGLContext()
if (!load_result)
{
Log_ErrorPrintf("Failed to load GL functions");
+ s_thread_gl_context = nullptr;
+ m_gl_context->doneCurrent();
return false;
}
@@ -336,7 +341,7 @@ bool OpenGLDisplayWindow::initializeGLContext()
}
#endif
- if (!CreateImGuiContext() || !CreateGLResources())
+ if (!QtDisplayWindow::initializeDeviceContext())
{
s_thread_gl_context = nullptr;
m_gl_context->doneCurrent();
@@ -346,31 +351,37 @@ bool OpenGLDisplayWindow::initializeGLContext()
return true;
}
-void OpenGLDisplayWindow::destroyGLContext()
+void OpenGLDisplayWindow::destroyDeviceContext()
{
- Assert(m_gl_context && s_thread_gl_context == m_gl_context);
+ Assert(m_gl_context && s_thread_gl_context == m_gl_context.get());
+
+ QtDisplayWindow::destroyDeviceContext();
+
s_thread_gl_context = nullptr;
-
- if (m_display_vao != 0)
- glDeleteVertexArrays(1, &m_display_vao);
- if (m_display_linear_sampler != 0)
- glDeleteSamplers(1, &m_display_linear_sampler);
- if (m_display_nearest_sampler != 0)
- glDeleteSamplers(1, &m_display_nearest_sampler);
-
- m_display_program.Destroy();
-
m_gl_context->doneCurrent();
- delete m_gl_context;
- m_gl_context = nullptr;
+ m_gl_context.reset();
}
-bool OpenGLDisplayWindow::CreateImGuiContext()
+bool OpenGLDisplayWindow::createImGuiContext()
{
+ if (!QtDisplayWindow::createImGuiContext())
+ return false;
+
+ if (!ImGui_ImplOpenGL3_Init(GetGLSLVersionString()))
+ return false;
+
+ ImGui_ImplOpenGL3_NewFrame();
return true;
}
-bool OpenGLDisplayWindow::CreateGLResources()
+void OpenGLDisplayWindow::destroyImGuiContext()
+{
+ ImGui_ImplOpenGL3_Shutdown();
+
+ QtDisplayWindow::destroyImGuiContext();
+}
+
+bool OpenGLDisplayWindow::createDeviceResources()
{
static constexpr char fullscreen_quad_vertex_shader[] = R"(
uniform vec4 u_src_rect;
@@ -430,6 +441,20 @@ void main()
return true;
}
+void OpenGLDisplayWindow::destroyDeviceResources()
+{
+ QtDisplayWindow::destroyDeviceResources();
+
+ if (m_display_vao != 0)
+ glDeleteVertexArrays(1, &m_display_vao);
+ if (m_display_linear_sampler != 0)
+ glDeleteSamplers(1, &m_display_linear_sampler);
+ if (m_display_nearest_sampler != 0)
+ glDeleteSamplers(1, &m_display_nearest_sampler);
+
+ m_display_program.Destroy();
+}
+
void OpenGLDisplayWindow::Render()
{
glDisable(GL_SCISSOR_TEST);
@@ -437,20 +462,21 @@ void OpenGLDisplayWindow::Render()
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
- RenderDisplay();
+ renderDisplay();
- // ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
+ ImDrawData* draw_data = ImGui::GetDrawData();
+ if (draw_data)
+ ImGui_ImplOpenGL3_RenderDrawData(draw_data);
m_gl_context->makeCurrent(this);
m_gl_context->swapBuffers(this);
- // ImGui_ImplSDL2_NewFrame(m_window);
- // ImGui_ImplOpenGL3_NewFrame();
+ ImGui_ImplOpenGL3_NewFrame();
GL::Program::ResetLastProgram();
}
-void OpenGLDisplayWindow::RenderDisplay()
+void OpenGLDisplayWindow::renderDisplay()
{
if (!m_display_texture_id)
return;
@@ -477,3 +503,4 @@ void OpenGLDisplayWindow::RenderDisplay()
glDrawArrays(GL_TRIANGLES, 0, 3);
glBindSampler(0, 0);
}
+
diff --git a/src/duckstation-qt/opengldisplaywindow.h b/src/duckstation-qt/opengldisplaywindow.h
index 516ac7543..100dc04a4 100644
--- a/src/duckstation-qt/opengldisplaywindow.h
+++ b/src/duckstation-qt/opengldisplaywindow.h
@@ -1,17 +1,16 @@
#pragma once
#include
-#include
-#include
#include "common/gl/program.h"
#include "common/gl/texture.h"
#include "core/host_display.h"
-#include
+#include "qtdisplaywindow.h"
+#include
#include
class QtHostInterface;
-class OpenGLDisplayWindow final : public QWindow, public HostDisplay
+class OpenGLDisplayWindow final : public QtDisplayWindow, public HostDisplay
{
Q_OBJECT
@@ -19,9 +18,11 @@ public:
OpenGLDisplayWindow(QtHostInterface* host_interface, QWindow* parent);
~OpenGLDisplayWindow();
- bool createGLContext(QThread* worker_thread);
- bool initializeGLContext();
- void destroyGLContext();
+ HostDisplay* getHostDisplayInterface() override;
+
+ bool createDeviceContext(QThread* worker_thread) override;
+ bool initializeDeviceContext() override;
+ void destroyDeviceContext() override;
RenderAPI GetRenderAPI() const override;
void* GetRenderDevice() const override;
@@ -45,23 +46,20 @@ public:
std::tuple GetWindowSize() const override;
void WindowResized() override;
-protected:
- void keyPressEvent(QKeyEvent* event);
- void keyReleaseEvent(QKeyEvent* event);
+ void Render() override;
private:
const char* GetGLSLVersionString() const;
std::string GetGLSLVersionHeader() const;
- bool CreateImGuiContext();
- bool CreateGLResources();
+ bool createImGuiContext() override;
+ void destroyImGuiContext() override;
+ bool createDeviceResources() override;
+ void destroyDeviceResources() override;
- void Render();
- void RenderDisplay();
+ void renderDisplay();
- QtHostInterface* m_host_interface;
-
- QOpenGLContext* m_gl_context = nullptr;
+ std::unique_ptr m_gl_context = nullptr;
GL::Program m_display_program;
GLuint m_display_vao = 0;
diff --git a/src/duckstation-qt/qtdisplaywindow.cpp b/src/duckstation-qt/qtdisplaywindow.cpp
new file mode 100644
index 000000000..204c0dbd9
--- /dev/null
+++ b/src/duckstation-qt/qtdisplaywindow.cpp
@@ -0,0 +1,65 @@
+#include "qtdisplaywindow.h"
+#include "imgui.h"
+#include "qthostinterface.h"
+#include
+
+QtDisplayWindow::QtDisplayWindow(QtHostInterface* host_interface, QWindow* parent)
+ : QWindow(parent), m_host_interface(host_interface)
+{
+}
+
+QtDisplayWindow::~QtDisplayWindow() = default;
+
+HostDisplay* QtDisplayWindow::getHostDisplayInterface()
+{
+ return nullptr;
+}
+
+bool QtDisplayWindow::createDeviceContext(QThread* worker_thread)
+{
+ return true;
+}
+
+bool QtDisplayWindow::initializeDeviceContext()
+{
+ if (!createImGuiContext() || !createDeviceResources())
+ return false;
+
+ return true;
+}
+
+void QtDisplayWindow::destroyDeviceContext()
+{
+ destroyImGuiContext();
+ destroyDeviceResources();
+}
+
+bool QtDisplayWindow::createImGuiContext()
+{
+ ImGui::CreateContext();
+ return true;
+}
+
+void QtDisplayWindow::destroyImGuiContext()
+{
+ ImGui::DestroyContext();
+}
+
+bool QtDisplayWindow::createDeviceResources()
+{
+ return true;
+}
+
+void QtDisplayWindow::destroyDeviceResources() {}
+
+void QtDisplayWindow::Render() {}
+
+void QtDisplayWindow::keyPressEvent(QKeyEvent* event)
+{
+ m_host_interface->handleKeyEvent(event->key(), true);
+}
+
+void QtDisplayWindow::keyReleaseEvent(QKeyEvent* event)
+{
+ m_host_interface->handleKeyEvent(event->key(), false);
+}
diff --git a/src/duckstation-qt/qtdisplaywindow.h b/src/duckstation-qt/qtdisplaywindow.h
new file mode 100644
index 000000000..1070061a0
--- /dev/null
+++ b/src/duckstation-qt/qtdisplaywindow.h
@@ -0,0 +1,36 @@
+#pragma once
+#include
+
+class QKeyEvent;
+
+class HostDisplay;
+
+class QtHostInterface;
+
+class QtDisplayWindow : public QWindow
+{
+ Q_OBJECT
+
+public:
+ QtDisplayWindow(QtHostInterface* host_interface, QWindow* parent);
+ virtual ~QtDisplayWindow();
+
+ virtual HostDisplay* getHostDisplayInterface();
+
+ virtual bool createDeviceContext(QThread* worker_thread);
+ virtual bool initializeDeviceContext();
+ virtual void destroyDeviceContext();
+
+ virtual void Render();
+
+protected:
+ virtual bool createImGuiContext();
+ virtual void destroyImGuiContext();
+ virtual bool createDeviceResources();
+ virtual void destroyDeviceResources();
+
+ void keyPressEvent(QKeyEvent* event) override;
+ void keyReleaseEvent(QKeyEvent* event) override;
+
+ QtHostInterface* m_host_interface;
+};
diff --git a/src/duckstation-qt/qthostinterface.cpp b/src/duckstation-qt/qthostinterface.cpp
index 98074e296..7421bff09 100644
--- a/src/duckstation-qt/qthostinterface.cpp
+++ b/src/duckstation-qt/qthostinterface.cpp
@@ -24,7 +24,7 @@ QtHostInterface::QtHostInterface(QObject* parent)
QtHostInterface::~QtHostInterface()
{
- Assert(!m_opengl_display_window);
+ Assert(!m_display_window);
stopThread();
}
@@ -129,24 +129,24 @@ void QtHostInterface::refreshGameList(bool invalidate_cache /*= false*/)
QWidget* QtHostInterface::createDisplayWidget(QWidget* parent)
{
- m_opengl_display_window = new OpenGLDisplayWindow(this, nullptr);
+ m_display_window = new OpenGLDisplayWindow(this, nullptr);
m_display.release();
- m_display = std::unique_ptr(static_cast(m_opengl_display_window));
- return QWidget::createWindowContainer(m_opengl_display_window, parent);
+ m_display = std::unique_ptr(m_display_window->getHostDisplayInterface());
+ return QWidget::createWindowContainer(m_display_window, parent);
}
void QtHostInterface::destroyDisplayWidget()
{
m_display.release();
- delete m_opengl_display_window;
- m_opengl_display_window = nullptr;
+ delete m_display_window;
+ m_display_window = nullptr;
}
void QtHostInterface::bootSystem(QString initial_filename, QString initial_save_state_filename)
{
emit emulationStarting();
- if (!m_opengl_display_window->createGLContext(m_worker_thread))
+ if (!m_display_window->createDeviceContext(m_worker_thread))
{
emit emulationStopped();
return;
@@ -252,7 +252,7 @@ void QtHostInterface::powerOffSystem()
}
m_system.reset();
- m_opengl_display_window->destroyGLContext();
+ m_display_window->destroyDeviceContext();
emit emulationStopped();
}
@@ -290,7 +290,7 @@ void QtHostInterface::changeDisc(QString new_disc_filename) {}
void QtHostInterface::doBootSystem(QString initial_filename, QString initial_save_state_filename)
{
- if (!m_opengl_display_window->initializeGLContext())
+ if (!m_display_window->initializeDeviceContext())
{
emit emulationStopped();
return;
@@ -305,7 +305,7 @@ void QtHostInterface::doBootSystem(QString initial_filename, QString initial_sav
!BootSystem(initial_filename_str.empty() ? nullptr : initial_filename_str.c_str(),
initial_save_state_filename_str.empty() ? nullptr : initial_save_state_filename_str.c_str()))
{
- m_opengl_display_window->destroyGLContext();
+ m_display_window->destroyDeviceContext();
emit emulationStopped();
return;
}
diff --git a/src/duckstation-qt/qthostinterface.h b/src/duckstation-qt/qthostinterface.h
index 024b96c3a..02ee616c9 100644
--- a/src/duckstation-qt/qthostinterface.h
+++ b/src/duckstation-qt/qthostinterface.h
@@ -92,7 +92,7 @@ private:
std::unique_ptr m_game_list;
- OpenGLDisplayWindow* m_opengl_display_window = nullptr;
+ QtDisplayWindow* m_display_window = nullptr;
QThread* m_original_thread = nullptr;
Thread* m_worker_thread = nullptr;