X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_init.c;h=13310f707ce37e0320b21301f0a73e1ddfd64b65;hb=09070646b28804f0a700bd10b6caf8d606712d2c;hp=89e4c43b2b76d881e803c0ac5dd0715b2a8233df;hpb=5288d8e11323c88acdec3af66ddf18c640c363a1;p=freeglut diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 89e4c43..13310f7 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -60,7 +60,7 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */ GL_FALSE, /* UseCurrentContext */ GL_FALSE, /* GLDebugSwitch */ GL_FALSE, /* XSyncSwitch */ - GL_TRUE, /* KeyRepeat */ + GLUT_KEY_REPEAT_ON, /* KeyRepeat */ 0xffffffff, /* Modifiers */ 0, /* FPSInterval */ 0, /* SwapCount */ @@ -82,7 +82,8 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */ GLUT_ACTION_EXIT, /* ActionOnWindowClose */ GLUT_EXEC_STATE_INIT, /* ExecState */ NULL, /* ProgramName */ - GL_FALSE /* JoysticksInitialised */ + GL_FALSE, /* JoysticksInitialised */ + GL_FALSE /* InputDevsInitialised */ }; @@ -202,6 +203,9 @@ static void fghInitialize( const char* displayName ) #endif fgState.Initialised = GL_TRUE; + + /* InputDevice uses GlutTimerFunc(), so fgState.Initialised must be TRUE */ + fgInitialiseInputDevices(); } /* @@ -242,8 +246,12 @@ void fgDeinitialize( void ) #if !TARGET_HOST_WINCE if ( fgState.JoysticksInitialised ) fgJoystickClose( ); + + if ( fgState.InputDevsInitialised ) + fgInputDeviceClose( ); #endif /* !TARGET_HOST_WINCE */ fgState.JoysticksInitialised = GL_FALSE; + fgState.InputDevsInitialised = GL_FALSE; fgState.Initialised = GL_FALSE; @@ -265,7 +273,7 @@ void fgDeinitialize( void ) fgState.ActionOnWindowClose = GLUT_ACTION_EXIT; fgState.ExecState = GLUT_EXEC_STATE_INIT; - fgState.KeyRepeat = GL_TRUE; + fgState.KeyRepeat = GLUT_KEY_REPEAT_ON; fgState.Modifiers = 0xffffffff; fgState.GameModeSize.X = 640; @@ -685,7 +693,6 @@ void FGAPIENTRY glutInitDisplayMode( unsigned int displayMode ) /* -- INIT DISPLAY STRING PARSING ------------------------------------------ */ -#define NUM_TOKENS 36 static char* Tokens[] = { "alpha", "acca", "acc", "blue", "buffer", "conformant", "depth", "double", @@ -696,6 +703,7 @@ static char* Tokens[] = "xstaticgrey", "xgreyscale", "xstaticcolour", "xpseudocolour", "xtruecolour", "xdirectcolour", "borderless", "aux" }; +#define NUM_TOKENS (sizeof(Tokens) / sizeof(*Tokens)) void FGAPIENTRY glutInitDisplayString( const char* displayMode ) {