GDK/Win32: Fix up OpenGL a bit
Like the recent updates in GTK4, the HWND that we use to obtain the HDC that we need for OpenGL/GLES operations should really be tied to GdkWindow, not GdkDisplay, as that is where the Win32 HWND where we originate from is located, so stop storing the GL HWND in GdkWin32Display, but just grab them from the GdkWindow that is bound to the GdkGLContext. We are more conservative about freeing up GL resources in GTK3, so we will continue to call ReleaseDC() as we did before.
This commit is contained in:
@ -66,7 +66,7 @@ _gdk_win32_gl_context_dispose (GObject *gobject)
|
||||
wglDeleteContext (context_win32->hglrc);
|
||||
context_win32->hglrc = NULL;
|
||||
|
||||
ReleaseDC (display_win32->gl_hwnd, context_win32->gl_hdc);
|
||||
ReleaseDC (GDK_WINDOW_HWND (window), context_win32->gl_hdc);
|
||||
}
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
@ -84,7 +84,7 @@ _gdk_win32_gl_context_dispose (GObject *gobject)
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
|
||||
ReleaseDC (display_win32->gl_hwnd, context_win32->gl_hdc);
|
||||
ReleaseDC (GDK_WINDOW_HWND (window), context_win32->gl_hdc);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1192,8 +1192,7 @@ _gdk_win32_window_create_gl_context (GdkWindow *window,
|
||||
EGLConfig config;
|
||||
#endif
|
||||
|
||||
display_win32->gl_hwnd = GDK_WINDOW_HWND (window);
|
||||
hdc = GetDC (display_win32->gl_hwnd);
|
||||
hdc = GetDC (GDK_WINDOW_HWND (window));
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
/* display_win32->hdc_egl_temp should *not* be destroyed here! It is destroyed at dispose()! */
|
||||
|
||||
Reference in New Issue
Block a user