X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_init.c;h=89e4c43b2b76d881e803c0ac5dd0715b2a8233df;hb=5288d8e11323c88acdec3af66ddf18c640c363a1;hp=799c86c5b6ec23ebe6bcf76d1737183fa3b8c441;hpb=dd1b89a1b346bc2eb501229b6524527c0534a646;p=freeglut diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 799c86c..89e4c43 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -196,6 +196,9 @@ static void fghInitialize( const char* displayName ) ReleaseDC( desktop, context ); } + /* Set the timer granularity to 1 ms */ + timeBeginPeriod ( 1 ); + #endif fgState.Initialised = GL_TRUE; @@ -289,7 +292,6 @@ void fgDeinitialize( void ) fgState.ProgramName = NULL; } - #if TARGET_HOST_UNIX_X11 /* @@ -304,6 +306,11 @@ void fgDeinitialize( void ) */ XCloseDisplay( fgDisplay.Display ); +#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE + + /* Reset the timer granularity */ + timeEndPeriod ( 1 ); + #endif fgState.Initialised = GL_FALSE; @@ -690,18 +697,6 @@ static char* Tokens[] = "xtruecolour", "xdirectcolour", "borderless", "aux" }; -/* XXX why the heck do we use this table instead of strlen(Tokens[i])? */ -static int TokenLengths[] = -{ - 5, 4, 3, 4, 6, 10, 5, 6, - 5, 5, 3, 3, 4, 3, 9, 7, - 6, 6, 7, 4, 8, 8, 7, - 11, 10, 12, 12, - 10, 12, - 11, 10, 13, 13, - 11, 13, 10, 3 -}; - void FGAPIENTRY glutInitDisplayString( const char* displayMode ) { int glut_state_flag = 0 ; @@ -722,7 +717,7 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode ) int i ; for ( i = 0; i < NUM_TOKENS; i++ ) { - if ( strncmp ( token, Tokens[i], TokenLengths[i] ) == 0 ) break ; + if ( strcmp ( token, Tokens[i] ) == 0 ) break ; } switch ( i )