Moving an X11-specific function call to destroy a context to the X11-specific file

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1064 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
fayjf 2012-02-05 13:53:00 +00:00
parent 1bcc27f30c
commit 44b2dd8c3b
3 changed files with 12 additions and 5 deletions

View File

@ -99,6 +99,7 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */
extern void fgPlatformInitialize( const char* displayName );
extern void fgPlatformDeinitialiseInputDevices ( void );
extern void fgPlatformCloseDisplay ( void );
extern void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext );
void fghParseCommandLineArguments ( int* pargc, char** argv, char **pDisplayName, char **pGeometry )
@ -234,10 +235,7 @@ void fgDeinitialize( void )
/* If there was a menu created, destroy the rendering context */
if( fgStructure.MenuContext )
{
#if TARGET_HOST_POSIX_X11
/* Note that the MVisualInfo is not owned by the MenuContext! */
glXDestroyContext( fgDisplay.pDisplay.Display, fgStructure.MenuContext->MContext );
#endif
fgPlatformDestroyContext (fgDisplay.pDisplay, fgStructure.MenuContext->MContext );
free( fgStructure.MenuContext );
fgStructure.MenuContext = NULL;
}

View File

@ -158,7 +158,10 @@ void fgPlatformCloseDisplay ( void )
timeEndPeriod ( 1 );
}
void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext )
{
/* Do nothing -- this is required for X11 */
}
/*
* Everything down to the end of the next two functions is copied from the X sources.

View File

@ -265,3 +265,9 @@ void fgPlatformCloseDisplay ( void )
XCloseDisplay( fgDisplay.pDisplay.Display );
}
void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext )
{
/* Note that the MVisualInfo is not owned by the MenuContext! */
glXDestroyContext( pDisplay.Display, MContext );
}