X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_init.c;h=5161c03addbd2bb354aa08c80462a86a89b41ae5;hb=ac26c64653954569627ad5413240cbd8453cd814;hp=768f89e7bcec755e285f744b32e8486acbe37296;hpb=fd77927b8883b81cc4a7bcb79f216e524043407d;p=freeglut diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 768f89e..5161c03 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" @@ -88,7 +89,8 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */ 4, /* SampleNumber */ 1, /* MajorVersion */ 0, /* MajorVersion */ - 0 /* ContextFlags */ + 0, /* ContextFlags */ + 0 /* ContextProfile */ }; @@ -424,6 +426,7 @@ void fgDeinitialize( void ) fgState.MajorVersion = 1; fgState.MinorVersion = 0; fgState.ContextFlags = 0; + fgState.ContextProfile = 0; fgState.Initialised = GL_FALSE; @@ -697,6 +700,7 @@ void FGAPIENTRY glutInit( int* pargc, char** argv ) #ifndef _WIN32_WCE { const char *fps = getenv( "GLUT_FPS" ); + if( fps ) { int interval; @@ -709,7 +713,7 @@ void FGAPIENTRY glutInit( int* pargc, char** argv ) } } - displayName = getenv( "DISPLAY"); + displayName = getenv( "DISPLAY" ); for( i = 1; i < argc; i++ ) { @@ -824,6 +828,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 +912,7 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode ) buffer[len] = '\0'; token = strtok ( buffer, " \t" ); + while ( token ) { /* Process this token */ @@ -1099,4 +1114,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 ***/