diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index 10ef6375db..dbfe2341e0 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -1867,6 +1867,7 @@ gdk_gl_context_has_sync (GdkGLContext *self) return priv->has_sync; } +/* Return if GL_BGRA works with glTexImage2D */ gboolean gdk_gl_context_has_bgra (GdkGLContext *self) { @@ -1875,6 +1876,27 @@ gdk_gl_context_has_bgra (GdkGLContext *self) return priv->has_bgra; } +/* Return if glGenVertexArrays, glBindVertexArray and glDeleteVertexArrays + * can be used + */ +gboolean +gdk_gl_context_has_vertex_arrays (GdkGLContext *self) +{ + GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (self); + + switch (priv->api) + { + case GDK_GL_API_GL: + return TRUE; + + case GDK_GL_API_GLES: + return gdk_gl_version_get_major (&priv->gl_version) >= 3; + + default: + g_return_val_if_reached (FALSE); + } +} + /* This is currently private! */ /* When using GL/ES, don't flip the 'R' and 'B' bits on Windows/ANGLE for glReadPixels() */ gboolean diff --git a/gdk/gdkglcontextprivate.h b/gdk/gdkglcontextprivate.h index 7c68109814..5fcfd0aae2 100644 --- a/gdk/gdkglcontextprivate.h +++ b/gdk/gdkglcontextprivate.h @@ -159,6 +159,8 @@ gboolean gdk_gl_context_has_sync (GdkGLContext gboolean gdk_gl_context_has_bgra (GdkGLContext *self) G_GNUC_PURE; +gboolean gdk_gl_context_has_vertex_arrays (GdkGLContext *self) G_GNUC_PURE; + double gdk_gl_context_get_scale (GdkGLContext *self); G_END_DECLS