Add support for GDK_GL=texture-rectangles

This allows us to test our support for GL_ARB_texture_rectangle
This commit is contained in:
Alexander Larsson 2014-11-06 11:29:51 +01:00
parent 90a5fa80af
commit 650c9f3b7e
3 changed files with 5 additions and 1 deletions

View File

@ -140,6 +140,7 @@ static const GDebugKey gdk_gl_keys[] = {
{"software-draw", GDK_GL_FLAGS_SOFTWARE_DRAW_GL | GDK_GL_FLAGS_SOFTWARE_DRAW_SURFACE},
{"software-draw-gl", GDK_GL_FLAGS_SOFTWARE_DRAW_GL},
{"software-draw-surface", GDK_GL_FLAGS_SOFTWARE_DRAW_SURFACE},
{"texture-rectangle", GDK_GL_FLAGS_TEXTURE_RECTANGLE},
};
#ifdef G_ENABLE_DEBUG

View File

@ -359,7 +359,9 @@ gdk_gl_context_realize (GdkGLContext *context)
has_npot = epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two");
has_texture_rectangle = epoxy_has_gl_extension ("GL_ARB_texture_rectangle");
if (has_npot)
if (_gdk_gl_flags & GDK_GL_FLAGS_TEXTURE_RECTANGLE)
priv->use_texture_rectangle = TRUE;
else if (has_npot)
priv->use_texture_rectangle = FALSE;
else if (has_texture_rectangle)
priv->use_texture_rectangle = TRUE;

View File

@ -93,6 +93,7 @@ typedef enum {
GDK_GL_FLAGS_ALWAYS = 1 << 1,
GDK_GL_FLAGS_SOFTWARE_DRAW_GL = 1 << 2,
GDK_GL_FLAGS_SOFTWARE_DRAW_SURFACE = 1 << 3,
GDK_GL_FLAGS_TEXTURE_RECTANGLE = 1 << 4,
} GdkGLFlags;