libGL: Consolidate DRI initialization in dri_glx.c
[mesa.git] / src / glx / x11 / glcontextmodes.c
index c16518490315923d563210025f95fc5e7f39c541..58c548a8fc114fdfa05ea2d34131d142c95fc52d 100644 (file)
@@ -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