summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdk/win32/gdkdisplay-win32.c6
-rw-r--r--gdk/win32/gdkglcontext-win32-egl.c18
2 files changed, 24 insertions, 0 deletions
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
index 5c53f247c2..44fabe3bf1 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -1205,6 +1205,9 @@ gdk_win32_display_init_gl (GdkDisplay *display,
FALSE,
error))
{
+ if (display->have_egl_win32_libangle)
+ g_message ("libANGLE EGL contexts currently support OpenGL/ES API only");
+
return g_object_new (GDK_TYPE_WIN32_GL_CONTEXT_EGL,
"display", display,
NULL);
@@ -1230,6 +1233,9 @@ gdk_win32_display_init_gl (GdkDisplay *display,
TRUE,
error))
{
+ if (display->have_egl_win32_libangle)
+ g_message ("libANGLE EGL contexts currently support OpenGL/ES API only");
+
return g_object_new (GDK_TYPE_WIN32_GL_CONTEXT_EGL,
"display", display,
NULL);
diff --git a/gdk/win32/gdkglcontext-win32-egl.c b/gdk/win32/gdkglcontext-win32-egl.c
index 0e8854de49..9978d0692f 100644
--- a/gdk/win32/gdkglcontext-win32-egl.c
+++ b/gdk/win32/gdkglcontext-win32-egl.c
@@ -124,6 +124,23 @@ gdk_win32_gl_context_egl_begin_frame (GdkDrawContext *draw_context,
GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_egl_parent_class)->begin_frame (draw_context, prefers_high_depth, update_area);
}
+static GdkGLAPI
+gdk_win32_gl_context_egl_realize (GdkGLContext *context,
+ GError **error)
+{
+ GdkGLContextClass *klass = GDK_GL_CONTEXT_CLASS (gdk_win32_gl_context_egl_parent_class);
+ GdkDisplay *display = gdk_gl_context_get_display (context);
+
+ /*
+ * force OpenGL/ES API if libANGLE is being used, since libANGLE does not
+ * implement enough Desktop OpenGL even with the EGL_KHR_create_context extension
+ */
+ if (display->have_egl_win32_libangle)
+ gdk_gl_context_set_use_es (context, 1);
+
+ return klass->realize (context, error);
+}
+
static void
gdk_win32_gl_context_egl_class_init (GdkWin32GLContextClass *klass)
{
@@ -131,6 +148,7 @@ gdk_win32_gl_context_egl_class_init (GdkWin32GLContextClass *klass)
GdkDrawContextClass *draw_context_class = GDK_DRAW_CONTEXT_CLASS(klass);
context_class->backend_type = GDK_GL_EGL;
+ context_class->realize = gdk_win32_gl_context_egl_realize;
draw_context_class->begin_frame = gdk_win32_gl_context_egl_begin_frame;
draw_context_class->end_frame = gdk_win32_gl_context_egl_end_frame;