Moving an X11-specific function call to destroy a context to the X11-specific file
authorJohn F. Fay <johnffay@nettally.com>
Sun, 5 Feb 2012 13:53:00 +0000 (13:53 +0000)
committerJohn F. Fay <johnffay@nettally.com>
Sun, 5 Feb 2012 13:53:00 +0000 (13:53 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1064 7f0cb862-5218-0410-a997-914c9d46530a

src/Common/freeglut_init.c
src/mswin/freeglut_init_mswin.c
src/x11/freeglut_init_x11.c

index 1af391e..d8e87e0 100644 (file)
@@ -99,6 +99,7 @@ SFG_State fgState = { { -1, -1, GL_FALSE },  /* Position */
 extern void fgPlatformInitialize( const char* displayName );\r
 extern void fgPlatformDeinitialiseInputDevices ( void );\r
 extern void fgPlatformCloseDisplay ( void );\r
 extern void fgPlatformInitialize( const char* displayName );\r
 extern void fgPlatformDeinitialiseInputDevices ( void );\r
 extern void fgPlatformCloseDisplay ( void );\r
+extern void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext );\r
 \r
 \r
 void fghParseCommandLineArguments ( int* pargc, char** argv, char **pDisplayName, char **pGeometry )\r
 \r
 \r
 void fghParseCommandLineArguments ( int* pargc, char** argv, char **pDisplayName, char **pGeometry )\r
@@ -234,10 +235,7 @@ void fgDeinitialize( void )
     /* If there was a menu created, destroy the rendering context */\r
     if( fgStructure.MenuContext )\r
     {\r
     /* If there was a menu created, destroy the rendering context */\r
     if( fgStructure.MenuContext )\r
     {\r
-#if TARGET_HOST_POSIX_X11\r
-        /* Note that the MVisualInfo is not owned by the MenuContext! */\r
-        glXDestroyContext( fgDisplay.pDisplay.Display, fgStructure.MenuContext->MContext );\r
-#endif\r
+               fgPlatformDestroyContext (fgDisplay.pDisplay, fgStructure.MenuContext->MContext );\r
         free( fgStructure.MenuContext );\r
         fgStructure.MenuContext = NULL;\r
     }\r
         free( fgStructure.MenuContext );\r
         fgStructure.MenuContext = NULL;\r
     }\r
index d5c94e5..c7457de 100644 (file)
@@ -158,7 +158,10 @@ void fgPlatformCloseDisplay ( void )
     timeEndPeriod ( 1 );\r
 }\r
 \r
     timeEndPeriod ( 1 );\r
 }\r
 \r
-\r
+void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext )\r
+{\r
+       /* Do nothing -- this is required for X11 */\r
+}\r
 \r
 /*\r
  * Everything down to the end of the next two functions is copied from the X sources.\r
 \r
 /*\r
  * Everything down to the end of the next two functions is copied from the X sources.\r
index 8574ce1..3010943 100644 (file)
@@ -265,3 +265,9 @@ void fgPlatformCloseDisplay ( void )
     XCloseDisplay( fgDisplay.pDisplay.Display );\r
 }\r
 \r
     XCloseDisplay( fgDisplay.pDisplay.Display );\r
 }\r
 \r
+\r
+void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext )\r
+{\r
+    /* Note that the MVisualInfo is not owned by the MenuContext! */\r
+    glXDestroyContext( pDisplay.Display, MContext );\r
+}
\ No newline at end of file