Skip to content

Commit 2156236

Browse files
committed
Frontends: Use common GL context wrapper
1 parent 4f4c4f4 commit 2156236

11 files changed

+154
-256
lines changed

src/core/gpu_hw_opengl.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,6 @@ std::tuple<s32, s32> GPU_HW_OpenGL::ConvertToFramebufferCoordinates(s32 x, s32 y
155155

156156
void GPU_HW_OpenGL::SetCapabilities(HostDisplay* host_display)
157157
{
158-
Log_InfoPrintf("Context Type: %s", IsGLES() ? "OpenGL ES" : "OpenGL");
159-
160-
const char* gl_vendor = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
161-
const char* gl_renderer = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
162-
const char* gl_version = reinterpret_cast<const char*>(glGetString(GL_VERSION));
163-
Log_InfoPrintf("GL_VENDOR: %s", gl_vendor);
164-
Log_InfoPrintf("GL_RENDERER: %s", gl_renderer);
165-
Log_InfoPrintf("GL_VERSION: %s", gl_version);
166-
167158
GLint max_texture_size = VRAM_WIDTH;
168159
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size);
169160
Log_InfoPrintf("Max texture size: %dx%d", max_texture_size, max_texture_size);

src/duckstation-qt/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ add_executable(duckstation-qt
5858
settingsdialog.ui
5959
)
6060

61+
target_include_directories(duckstation-qt PRIVATE "${Qt5Gui_PRIVATE_INCLUDE_DIRS}")
6162
target_link_libraries(duckstation-qt PRIVATE frontend-common core common imgui glad minizip scmversion Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network)
6263

6364
if(WIN32)
@@ -89,9 +90,4 @@ if(WIN32)
8990
add_custom_command(TARGET duckstation-qt POST_BUILD
9091
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf.win" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf"
9192
)
92-
else()
93-
if(OpenGL_GLX_FOUND)
94-
target_compile_definitions(duckstation-qt PRIVATE "HAS_GLX")
95-
target_link_libraries(duckstation-qt PRIVATE OpenGL::GLX)
96-
endif()
9793
endif()

src/duckstation-qt/mainwindow.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,25 +102,22 @@ void MainWindow::createDisplay(QThread* worker_thread, bool use_debug_device, bo
102102
return;
103103
}
104104

105-
if (!m_host_display->createSurface() || !m_host_display->makeDeviceContextCurrent())
105+
if (!m_host_display->createSurface())
106106
{
107107
reportError(tr("Failed to create host display surface."));
108108
m_host_display->destroyDeviceContext();
109109
return;
110110
}
111111

112-
m_host_display->moveContextToThread(worker_thread);
112+
m_host_display->deactivateDeviceContext();
113113
}
114114

115115
void MainWindow::updateDisplay(QThread* worker_thread, bool fullscreen, bool render_to_main)
116116
{
117117
const bool is_fullscreen = m_display_widget->isFullScreen();
118118
const bool is_rendering_to_main = (!is_fullscreen && m_display_widget->parent());
119119
if (fullscreen == is_fullscreen && is_rendering_to_main == render_to_main)
120-
{
121-
m_host_display->moveContextToThread(worker_thread);
122120
return;
123-
}
124121

125122
m_host_display->destroySurface();
126123

@@ -160,8 +157,6 @@ void MainWindow::updateDisplay(QThread* worker_thread, bool fullscreen, bool ren
160157

161158
QSignalBlocker blocker(m_ui.actionFullscreen);
162159
m_ui.actionFullscreen->setChecked(fullscreen);
163-
164-
m_host_display->moveContextToThread(worker_thread);
165160
}
166161

167162
void MainWindow::destroyDisplay()

0 commit comments

Comments
 (0)