Fixing the "fghGetProcAddress" bug also noted by Evan Felix in e-mail dated 2/4/12...
[freeglut] / src / Common / freeglut_window.c
index 69aba28..fb17ea6 100644 (file)
@@ -306,7 +306,7 @@ GLXFBConfig* fgChooseFBConfig( int *numcfgs )
                     ATTRIB( None );\r
 \r
                     fbconfigArray = glXChooseFBConfig( fgDisplay.pDisplay.Display,\r
-                                                       fgDisplay.Screen,\r
+                                                       fgDisplay.pDisplay.Screen,\r
                                                        attributes,\r
                                                        &fbconfigArraySize );\r
                 }\r
@@ -406,7 +406,7 @@ static GLXContext fghCreateNewContext( SFG_Window* window )
 \r
   /* new context creation */\r
   int attributes[9];\r
-  CreateContextAttribsProc createContextAttribs = (CreateContextAttribsProc) fghGetProcAddress( "glXCreateContextAttribsARB" );\r
+  CreateContextAttribsProc createContextAttribs = (CreateContextAttribsProc) fgPlatformGetProcAddress( "glXCreateContextAttribsARB" );\r
  \r
   /* glXCreateContextAttribsARB not found, yet the user has requested the new context creation */\r
   if ( !createContextAttribs && !fghIsLegacyContextRequested() ) {\r
@@ -477,16 +477,16 @@ static int fghEwmhFullscrToggle(void)
     XEvent xev;\r
     long evmask = SubstructureRedirectMask | SubstructureNotifyMask;\r
 \r
-    if(!fgDisplay.State || !fgDisplay.StateFullScreen) {\r
+    if(!fgDisplay.pDisplay.State || !fgDisplay.pDisplay.StateFullScreen) {\r
         return -1;\r
     }\r
 \r
     xev.type = ClientMessage;\r
     xev.xclient.window = fgStructure.CurrentWindow->Window.Handle;\r
-    xev.xclient.message_type = fgDisplay.State;\r
+    xev.xclient.message_type = fgDisplay.pDisplay.State;\r
     xev.xclient.format = 32;\r
     xev.xclient.data.l[0] = _NET_WM_STATE_TOGGLE;\r
-    xev.xclient.data.l[1] = fgDisplay.StateFullScreen;\r
+    xev.xclient.data.l[1] = fgDisplay.pDisplay.StateFullScreen;\r
     xev.xclient.data.l[2] = 0; /* no second property to toggle */\r
     xev.xclient.data.l[3] = 1; /* source indication: application */\r
     xev.xclient.data.l[4] = 0; /* unused */\r
@@ -525,6 +525,13 @@ void fgPlatformSetWindow ( SFG_Window *window )
 }\r
 \r
 \r
+static Bool fghWindowIsVisible( Display *display, XEvent *event, XPointer arg)\r
+{\r
+    Window window = (Window)arg;\r
+    return (event->type == MapNotify) && (event->xmap.window == window);\r
+}\r
+\r
+\r
 /*\r
  * Opens a window. Requires a SFG_Window object created and attached\r
  * to the freeglut structure. OpenGL context is created here.\r
@@ -759,13 +766,6 @@ void fgPlatformCloseWindow( SFG_Window* window )
 }\r
 \r
 \r
-static Bool fghWindowIsVisible( Display *display, XEvent *event, XPointer arg)\r
-{\r
-    Window window = (Window)arg;\r
-    return (event->type == MapNotify) && (event->xmap.window == window);\r
-}\r
-\r
-\r
 \r
 \r
 /*\r