X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_init.c;h=8b9d34d12e03127878489a4af71f773a17f2f743;hb=d07405529a94b1fed8d2e89abb75fee9b6b9b793;hp=768f89e7bcec755e285f744b32e8486acbe37296;hpb=fd77927b8883b81cc4a7bcb79f216e524043407d;p=freeglut diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 768f89e..8b9d34d 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -25,6 +25,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#define FREEGLUT_BUILDING_LIB #include #include "freeglut_internal.h" @@ -83,12 +84,14 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */ GLUT_EXEC_STATE_INIT, /* ExecState */ NULL, /* ProgramName */ GL_FALSE, /* JoysticksInitialised */ + 0, /* NumActiveJoysticks */ GL_FALSE, /* InputDevsInitialised */ 1, /* AuxiliaryBufferNumber */ 4, /* SampleNumber */ 1, /* MajorVersion */ 0, /* MajorVersion */ - 0 /* ContextFlags */ + 0, /* ContextFlags */ + 0 /* ContextProfile */ }; @@ -424,6 +427,7 @@ void fgDeinitialize( void ) fgState.MajorVersion = 1; fgState.MinorVersion = 0; fgState.ContextFlags = 0; + fgState.ContextProfile = 0; fgState.Initialised = GL_FALSE; @@ -697,6 +701,7 @@ void FGAPIENTRY glutInit( int* pargc, char** argv ) #ifndef _WIN32_WCE { const char *fps = getenv( "GLUT_FPS" ); + if( fps ) { int interval; @@ -709,7 +714,7 @@ void FGAPIENTRY glutInit( int* pargc, char** argv ) } } - displayName = getenv( "DISPLAY"); + displayName = getenv( "DISPLAY" ); for( i = 1; i < argc; i++ ) { @@ -824,6 +829,16 @@ void FGAPIENTRY glutInit( int* pargc, char** argv ) } } +#if TARGET_HOST_MS_WINDOWS +void (__cdecl *__glutExitFunc)( int return_value ) = NULL; + +void FGAPIENTRY __glutInitWithExit( int *pargc, char **argv, void (__cdecl *exit_function)(int) ) +{ + __glutExitFunc = exit_function; + glutInit(pargc, argv); +} +#endif + /* * Undoes all the "glutInit" stuff */ @@ -898,6 +913,7 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode ) buffer[len] = '\0'; token = strtok ( buffer, " \t" ); + while ( token ) { /* Process this token */ @@ -1099,4 +1115,10 @@ void FGAPIENTRY glutInitContextFlags( int flags ) fgState.ContextFlags = flags; } +void FGAPIENTRY glutInitContextProfile( int profile ) +{ + /* We will make use of this value when creating a new OpenGL context... */ + fgState.ContextProfile = profile; +} + /*** END OF FILE ***/