mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-12 05:20:17 +00:00
glcontext: Deprecate gdk_gl_context_set_use_es()
Make it call gdk_gl_context_set_allowed_apis(). Also port callers to use this function.
This commit is contained in:
parent
c6dd3c11fa
commit
8c1f7f7531
@ -1246,6 +1246,8 @@ gdk_gl_context_get_allowed_apis (GdkGLContext *self)
|
||||
* You should check the return value of [method@Gdk.GLContext.get_use_es]
|
||||
* after calling [method@Gdk.GLContext.realize] to decide whether to use
|
||||
* the OpenGL or OpenGL ES API, extensions, or shaders.
|
||||
*
|
||||
* Deprecated: 4.6: Use gdk_gl_context_set_allowed_apis() instead.
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_set_use_es (GdkGLContext *context,
|
||||
@ -1256,8 +1258,21 @@ gdk_gl_context_set_use_es (GdkGLContext *context,
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
g_return_if_fail (!priv->realized);
|
||||
|
||||
if (priv->use_es != use_es)
|
||||
priv->use_es = use_es;
|
||||
switch (use_es)
|
||||
{
|
||||
case -1:
|
||||
gdk_gl_context_set_allowed_apis (context, DEFAULT_ALLOWED_APIS);
|
||||
break;
|
||||
case 0:
|
||||
gdk_gl_context_set_allowed_apis (context, GDK_GL_API_GL);
|
||||
break;
|
||||
case 1:
|
||||
gdk_gl_context_set_allowed_apis (context, GDK_GL_API_GLES);
|
||||
break;
|
||||
default:
|
||||
/* Just ignore the call */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,7 +95,7 @@ void gdk_gl_context_set_allowed_apis (GdkGLContext *
|
||||
GdkGLAPI apis);
|
||||
GDK_AVAILABLE_IN_4_6
|
||||
GdkGLAPI gdk_gl_context_get_allowed_apis (GdkGLContext *self);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_6_FOR(gdk_gl_context_set_allowed_apis)
|
||||
void gdk_gl_context_set_use_es (GdkGLContext *context,
|
||||
int use_es);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
|
@ -319,7 +319,7 @@ gtk_gl_area_real_create_context (GtkGLArea *area)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gdk_gl_context_set_use_es (context, priv->use_es);
|
||||
gdk_gl_context_set_allowed_apis (context, priv->use_es ? GDK_GL_API_GLES : GDK_GL_API_GL);
|
||||
gdk_gl_context_set_required_version (context,
|
||||
priv->required_gl_version / 10,
|
||||
priv->required_gl_version % 10);
|
||||
|
Loading…
Reference in New Issue
Block a user