The only difference between them comes up when you start trying to
unignore these events. For instance, if call
SDL_JoystickEventState(SDL_IGNORE) and then call
SDL_EventState(SDL_JOYAXISMOTION, SDL_ENABLE), you will not receive any
joystick events.On Sep 22, 2004, at 10:43 PM, Tyler Olsen wrote:
Thanks, thats exactly the answer I was looking for. Now I have another
quicky about joysticks. :)*************************************
SDL_InitSubSystem(SDL_INIT_JOYSTICK);
if (SDL_NumJoysticks() == 0) { // No joysticks found
SDL_JoystickEventState(SDL_IGNORE);
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
}
else // At least one joystick exists
SDL_JoystickEventState(SDL_ENABLE);
Is it a good thing or a bad thing to make the SDL_QuitSubSystem() call
if no joysticks exist on the system? Thanks
The only difference between them comes up when you start trying to
unignore these events. For instance, if call
SDL_JoystickEventState(SDL_IGNORE) and then call
SDL_EventState(SDL_JOYAXISMOTION, SDL_ENABLE), you will not receive any
joystick events.
SDL_InitSubSystem(SDL_INIT_JOYSTICK);
if (SDL_NumJoysticks() == 0) { // No joysticks found
SDL_JoystickEventState(SDL_IGNORE);
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
}
else // At least one joystick exists
SDL_JoystickEventState(SDL_ENABLE);
Is it a good thing or a bad thing to make the SDL_QuitSubSystem() call
if no joysticks exist on the system? Thanks
It should be fine, but should also be unnecessary. If you don’t have
any joysticks, you shouldn’t receive any joystick events. If you are,
then please report it as a bug.
See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment