summaryrefslogtreecommitdiff
path: root/Source/Core/Common/GL/GLInterface/GLX.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2018-10-03 23:03:19 +1000
committerStenzek <stenzek@gmail.com>2018-10-20 21:11:34 +1000
commit9c57a98723997736adea94383668fbdf8a993fd8 (patch)
tree5800ef34172a1edea20ba4571ea5bc95b1eb29e0 /Source/Core/Common/GL/GLInterface/GLX.cpp
parent1d827a52234974f308e71e86cdd6f61293e0523f (diff)
GLContext: Use host connection
This also removes the need for a sleeping event thread.
Diffstat (limited to 'Source/Core/Common/GL/GLInterface/GLX.cpp')
-rw-r--r--Source/Core/Common/GL/GLInterface/GLX.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/Source/Core/Common/GL/GLInterface/GLX.cpp b/Source/Core/Common/GL/GLInterface/GLX.cpp
index 173127fc5b..c2569bd153 100644
--- a/Source/Core/Common/GL/GLInterface/GLX.cpp
+++ b/Source/Core/Common/GL/GLInterface/GLX.cpp
@@ -56,9 +56,9 @@ void GLContextGLX::Swap()
// Create rendering window.
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
-bool GLContextGLX::Initialize(void* window_handle, bool stereo, bool core)
+bool GLContextGLX::Initialize(void* display_handle, void* window_handle, bool stereo, bool core)
{
- m_display = XOpenDisplay(nullptr);
+ m_display = static_cast<Display*>(display_handle);
int screen = DefaultScreen(m_display);
// checking glx version
@@ -298,16 +298,12 @@ void GLContextGLX::Shutdown()
{
DestroyWindowSurface();
if (m_context)
- {
glXDestroyContext(m_display, m_context);
+}
- // Don't close the display connection if we are a shared context.
- // Saves doing reference counting on this object, and the main context will always
- // be shut down last anyway.
- if (m_render_window)
- {
- XCloseDisplay(m_display);
- m_context = nullptr;
- }
- }
+void GLContextGLX::Update()
+{
+ m_render_window->UpdateDimensions();
+ m_backbuffer_width = m_render_window->GetWidth();
+ m_backbuffer_height = m_render_window->GetHeight();
}