Removing an unused variable
[freeglut] / src / freeglut_internal.h
index 154a877..f63c1f5 100644 (file)
@@ -323,8 +323,6 @@ struct tagSFG_Context
 
 #if TARGET_HOST_UNIX_X11
     XVisualInfo*    VisualInfo;      /* The window's visual information     */
-    Pixmap          Pixmap;          /* Used for offscreen rendering        */
-    /* GLXPixmap      GLXPixMap; */  /* Used for offscreen rendering        */
 #elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
     HDC             Device;          /* The window's device context         */
 #endif
@@ -403,7 +401,7 @@ do                                                             \
  * type.
  */
 #define FETCH_WCB(window,cbname) \
-    ((FGCB ## cbname)((window).CallBacks[CB_ ## cbname]))
+    ((window).CallBacks[CB_ ## cbname])
 
 /*
  * INVOKE_WCB() is used as:
@@ -424,15 +422,28 @@ do                                                             \
  * current window.
  *
  */
+#if TARGET_HOST_WIN32
 #define INVOKE_WCB(window,cbname,arg_list)    \
 do                                            \
 {                                             \
     if( FETCH_WCB( window, cbname ) )         \
     {                                         \
+        FGCB ## cbname func = (FGCB ## cbname)(FETCH_WCB( window, cbname )); \
         fgSetWindow( &window );               \
-        FETCH_WCB( window, cbname ) arg_list; \
+        func arg_list;                        \
     }                                         \
 } while( 0 )
+#else
+#define INVOKE_WCB(window,cbname,arg_list)    \
+do                                            \
+{                                             \
+    if( FETCH_WCB( window, cbname ) )         \
+    {                                         \
+        fgSetWindow( &window );               \
+        ((FGCB ## cbname)FETCH_WCB( window, cbname )) arg_list; \
+    }                                         \
+} while( 0 )
+#endif
 
 /*
  * The window callbacks the user can supply us with. Should be kept portable.
@@ -569,8 +580,8 @@ struct tagSFG_Structure
     SFG_List        Menus;        /* The global menus list              */
     SFG_List        WindowsToDestroy;
 
-    SFG_Window*     Window;       /* The currently active win.          */
-    SFG_Menu*       Menu;         /* Same, but menu...                  */
+    SFG_Window*     CurrentWindow; /* The currently set window          */
+    SFG_Menu*       CurrentMenu;   /* Same, but menu...                 */
 
     SFG_MenuContext* MenuContext; /* OpenGL rendering context for menus */
 
@@ -693,7 +704,7 @@ extern SFG_State fgState;
  * window set, respectively:
  */
 #define  FREEGLUT_EXIT_IF_NO_WINDOW( string )                   \
-  if ( ! fgStructure.Window )                                   \
+  if ( ! fgStructure.CurrentWindow )                            \
   {                                                             \
     fgError ( " ERROR:  Function <%s> called"                   \
               " with no current window defined.", (string) ) ;  \