Moving the platform-specific FBConfig and device context variables into platform...
[freeglut] / src / Common / freeglut_state.c
index 20221bb..6630b6d 100644 (file)
@@ -45,6 +45,12 @@ extern int fgPlatformGlutGet ( GLenum eWhat );
 extern int fgPlatformGlutDeviceGet ( GLenum eWhat );\r
 extern int fgPlatformGlutLayerGet ( GLenum eWhat );\r
 \r
+/* A helper function to check if a display mode is possible to use */\r
+#if TARGET_HOST_POSIX_X11\r
+GLXFBConfig* fgChooseFBConfig( int* numcfgs );\r
+#endif\r
+\r
+\r
 /* -- LOCAL DEFINITIONS ---------------------------------------------------- */\r
 \r
 /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */\r
@@ -60,14 +66,14 @@ static int fghGetConfig( int attribute )
 \r
   if( fgStructure.CurrentWindow )\r
       result = glXGetFBConfigAttrib( fgDisplay.Display,\r
-                                     *(fgStructure.CurrentWindow->Window.FBConfig),\r
+                                     *(fgStructure.CurrentWindow->Window.pContext.FBConfig),\r
                                      attribute,\r
                                      &returnValue );\r
 \r
   return returnValue;\r
 }\r
 \r
-static int fgPlatformGlutGet ( GLenum eWhat )\r
+int fgPlatformGlutGet ( GLenum eWhat )\r
 {\r
     int nsamples = 0;\r
 \r
@@ -119,7 +125,7 @@ static int fgPlatformGlutGet ( GLenum eWhat )
         else\r
         {\r
           const GLXFBConfig * fbconfig =\r
-                fgStructure.CurrentWindow->Window.FBConfig;\r
+                fgStructure.CurrentWindow->Window.pContext.FBConfig;\r
 \r
           XVisualInfo * visualInfo =\r
                 glXGetVisualFromFBConfig( fgDisplay.Display, *fbconfig );\r
@@ -227,7 +233,7 @@ static int fgPlatformGlutGet ( GLenum eWhat )
 }\r
 \r
 \r
-static int fgPlatformGlutDeviceGet ( GLenum eWhat )\r
+int fgPlatformGlutDeviceGet ( GLenum eWhat )\r
 {\r
     switch( eWhat )\r
     {\r