summaryrefslogtreecommitdiff
path: root/src/glx/x11/glcontextmodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/x11/glcontextmodes.c')
-rw-r--r--src/glx/x11/glcontextmodes.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/glx/x11/glcontextmodes.c b/src/glx/x11/glcontextmodes.c
index c165184903..58c548a8fc 100644
--- a/src/glx/x11/glcontextmodes.c
+++ b/src/glx/x11/glcontextmodes.c
@@ -333,7 +333,8 @@ _gl_get_context_mode_data(const __GLcontextModes *mode, int attribute,
*value_return = mode->bindToTextureRgba;
return 0;
case GLX_BIND_TO_MIPMAP_TEXTURE_EXT:
- *value_return = mode->bindToMipmapTexture;
+ *value_return = mode->bindToMipmapTexture == GL_TRUE ? GL_TRUE :
+ GL_FALSE;
return 0;
case GLX_BIND_TO_TEXTURE_TARGETS_EXT:
*value_return = mode->bindToTextureTargets;
@@ -453,19 +454,28 @@ _gl_context_modes_destroy( __GLcontextModes * modes )
*/
__GLcontextModes *
-_gl_context_modes_find_visual( __GLcontextModes * modes, int vid )
+_gl_context_modes_find_visual(__GLcontextModes *modes, int vid)
{
- while ( modes != NULL ) {
- if ( modes->visualID == vid ) {
- break;
- }
+ __GLcontextModes *m;
- modes = modes->next;
- }
+ for (m = modes; m != NULL; m = m->next)
+ if (m->visualID == vid)
+ return m;
- return modes;
+ return NULL;
}
+__GLcontextModes *
+_gl_context_modes_find_fbconfig(__GLcontextModes *modes, int fbid)
+{
+ __GLcontextModes *m;
+
+ for (m = modes; m != NULL; m = m->next)
+ if (m->fbconfigID == fbid)
+ return m;
+
+ return NULL;
+}
/**
* Determine if two context-modes are the same. This is intended to be used