- fallback to non-sRGB visuals if the context creation failed (GLX-only)
[freeglut] / src / x11 / fg_state_x11_glx.c
index bd2b35e..2a50e77 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <GL/freeglut.h>
 #include "fg_internal.h"
+#include "x11/fg_window_x11_glx.h"
 
 /*
  * Queries the GL context about some attributes
@@ -34,7 +35,7 @@
 int fgPlatformGetConfig( int attribute )
 {
   int returnValue = 0;
-  int result;  /*  Not checked  */
+  int result __fg_unused;  /*  Not checked  */
 
   if( fgStructure.CurrentWindow )
       result = glXGetFBConfigAttrib( fgDisplay.pDisplay.Display,
@@ -82,6 +83,7 @@ int fghPlatformGlutGetGLX ( GLenum eWhat )
     GLX_QUERY( GLUT_WINDOW_ACCUM_BLUE_SIZE,     GLX_ACCUM_BLUE_SIZE     );
     GLX_QUERY( GLUT_WINDOW_ACCUM_ALPHA_SIZE,    GLX_ACCUM_ALPHA_SIZE    );
     GLX_QUERY( GLUT_WINDOW_STEREO,              GLX_STEREO              );
+    GLX_QUERY( GLUT_WINDOW_SRGB,                GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB);
 
 #   undef GLX_QUERY
 
@@ -93,7 +95,7 @@ int fghPlatformGlutGetGLX ( GLenum eWhat )
         return fghChooseConfig(&config);
     }
 
-    /* This is system-dependant */
+    /* This is system-dependent */
     case GLUT_WINDOW_FORMAT_ID:
         if( fgStructure.CurrentWindow == NULL )
             return 0;
@@ -170,7 +172,7 @@ int *fgPlatformGlutGetModeValues(GLenum eWhat, int *size)
       if (fbconfigArray != NULL)
         {
           int * temp_array;
-          int result;   /*  Returned by glXGetFBConfigAttrib. Not checked.  */
+          int result __fg_unused;   /*  Returned by glXGetFBConfigAttrib. Not checked.  */
           int previous_value;
           int i;