mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
glcontext: Add internal get_clipped_version function
It is useful for backends to get user set preferences while ensuring the correctness of the result, which will be always greater or equal than the minimum version provided
This commit is contained in:
parent
6bc3ecbe56
commit
8d175801d7
@ -1113,6 +1113,24 @@ gdk_gl_context_get_required_version (GdkGLContext *context,
|
||||
else
|
||||
min = default_minor;
|
||||
|
||||
void
|
||||
gdk_gl_context_get_clipped_version (GdkGLContext *context,
|
||||
int min_major,
|
||||
int min_minor,
|
||||
int *major,
|
||||
int *minor)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
int maj = min_major, min = min_minor;
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
|
||||
if (priv->major > maj || (priv->major == maj && priv->minor > min))
|
||||
{
|
||||
maj = priv->major;
|
||||
min = priv->minor;
|
||||
}
|
||||
|
||||
if (major != NULL)
|
||||
*major = maj;
|
||||
if (minor != NULL)
|
||||
|
@ -117,6 +117,11 @@ gboolean gdk_gl_context_check_version (GdkGLContext
|
||||
int required_gl_minor,
|
||||
int required_gles_major,
|
||||
int required_gles_minor);
|
||||
void gdk_gl_context_get_clipped_version (GdkGLContext *context,
|
||||
int min_major,
|
||||
int min_minor,
|
||||
int *major,
|
||||
int *minor);
|
||||
|
||||
gboolean gdk_gl_context_has_unpack_subimage (GdkGLContext *context);
|
||||
void gdk_gl_context_push_debug_group (GdkGLContext *context,
|
||||
|
Loading…
Reference in New Issue
Block a user