mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 22:10:08 +00:00
gdkglcontext-win32.c: Create a global shared GL context
Like the other backends, we ought to create our WGL/EGL GL contexts like the following: "Create a global GL context that connects all GL contexts on a display and lets us share textures between them."
This commit is contained in:
parent
07166a55ee
commit
85706dc39d
@ -937,6 +937,7 @@ gdk_win32_gl_context_realize (GdkGLContext *context,
|
||||
GError **error)
|
||||
{
|
||||
GdkGLContext *share = gdk_gl_context_get_shared_context (context);
|
||||
GdkGLContext *shared_data_context;
|
||||
GdkWin32GLContext *context_win32 = GDK_WIN32_GL_CONTEXT (context);
|
||||
|
||||
gboolean debug_bit, compat_bit, legacy_bit;
|
||||
@ -955,6 +956,7 @@ gdk_win32_gl_context_realize (GdkGLContext *context,
|
||||
gdk_gl_context_get_required_version (context, &major, &minor);
|
||||
debug_bit = gdk_gl_context_get_debug_enabled (context);
|
||||
compat_bit = gdk_gl_context_get_forward_compatible (context);
|
||||
shared_data_context = gdk_surface_get_shared_data_gl_context (surface);
|
||||
|
||||
/*
|
||||
* A legacy context cannot be shared with core profile ones, so this means we
|
||||
@ -1004,7 +1006,7 @@ gdk_win32_gl_context_realize (GdkGLContext *context,
|
||||
legacy_bit ? "yes" : "no"));
|
||||
|
||||
hglrc = _create_gl_context (context_win32->gl_hdc,
|
||||
share,
|
||||
share ? share : shared_data_context,
|
||||
flags,
|
||||
major,
|
||||
minor,
|
||||
@ -1046,7 +1048,7 @@ gdk_win32_gl_context_realize (GdkGLContext *context,
|
||||
|
||||
ctx = _create_egl_context (win32_display->egl_disp,
|
||||
context_win32->egl_config,
|
||||
share,
|
||||
share ? share : shared_data_context,
|
||||
flags,
|
||||
major,
|
||||
minor,
|
||||
|
Loading…
Reference in New Issue
Block a user