X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_init.c;h=33992898e44bda292607d72e0335cd92b4e17946;hb=8e06738e2a2879e125fa166f6f7817727d898beb;hp=a1367b82d905bec95cf0ccf8796191d072a21813;hpb=646676b8dbf8ab504ac8a275fe9a63a403a3190b;p=freeglut diff --git a/src/freeglut_init.c b/src/freeglut_init.c index a1367b8..3399289 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -61,6 +61,7 @@ SFG_State fgState = { { -1, -1, FALSE }, /* Position */ FALSE, /* ForceDirectContext */ TRUE, /* TryDirectContext */ FALSE, /* ForceIconic */ + FALSE, /* UseCurrentContext */ FALSE, /* GLDebugSwitch */ FALSE, /* XSyncSwitch */ TRUE, /* IgnoreKeyRepeat */ @@ -74,6 +75,7 @@ SFG_State fgState = { { -1, -1, FALSE }, /* Position */ #endif { NULL, NULL }, /* Timers */ NULL, /* IdleCallback */ + FALSE, /* BuildingAMenu */ NULL, /* MenuStateCallback */ NULL, /* MenuStatusCallback */ { 640, 480, TRUE }, /* GameModeSize */ @@ -81,7 +83,7 @@ SFG_State fgState = { { -1, -1, FALSE }, /* Position */ 72, /* GameModeRefresh */ GLUT_ACTION_EXIT, /* ActionOnWindowClose */ GLUT_EXEC_STATE_INIT /* ExecState */ -}; +} ; /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */ @@ -268,6 +270,15 @@ void fgDeinitialize( void ) } /* + * If there was a menu created, destroy the rendering context + */ + if ( fgStructure.MenuContext ) + { + free ( fgStructure.MenuContext ) ; + fgStructure.MenuContext = NULL ; + } + + /* * Perform the freeglut structure deinitialization */ fgDestroyStructure(); @@ -306,6 +317,7 @@ void fgDeinitialize( void ) fgState.ForceDirectContext = FALSE; fgState.TryDirectContext = TRUE; fgState.ForceIconic = FALSE; + fgState.UseCurrentContext = FALSE; fgState.GLDebugSwitch = FALSE; fgState.XSyncSwitch = FALSE; fgState.ActionOnWindowClose = GLUT_ACTION_EXIT ; @@ -394,12 +406,13 @@ void FGAPIENTRY glutInit( int* pargc, char** argv ) /* check if GLUT_FPS env var is set */ { - const char *fps = getenv("GLUT_FPS"); - if (fps) { - sscanf(fps, "%d", &fgState.FPSInterval); - if (fgState.FPSInterval <= 0) - fgState.FPSInterval = 5000; /* 5000 milliseconds */ - } + const char *fps = getenv ( "GLUT_FPS" ); + if ( fps ) + { + sscanf ( fps, "%d", &fgState.FPSInterval ) ; + if ( fgState.FPSInterval <= 0 ) + fgState.FPSInterval = 5000 ; /* 5000 milliseconds */ + } } /*