diff --git a/src/SDL.c b/src/SDL.c index 687c140d9..9eef00cd3 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -115,6 +115,16 @@ SDL_InitSubSystem(Uint32 flags) /* Clear the error message */ SDL_ClearError(); + if ((flags & SDL_INIT_GAMECONTROLLER)) { + /* game controller implies joystick */ + flags |= SDL_INIT_JOYSTICK; + } + + if ((flags & (SDL_INIT_VIDEO|SDL_INIT_JOYSTICK))) { + /* video or joystick implies events */ + flags |= SDL_INIT_EVENTS; + } + #if SDL_VIDEO_DRIVER_WINDOWS if ((flags & (SDL_INIT_HAPTIC|SDL_INIT_JOYSTICK))) { if (SDL_HelperWindowCreate() < 0) { @@ -127,16 +137,6 @@ SDL_InitSubSystem(Uint32 flags) SDL_TicksInit(); #endif - if ((flags & SDL_INIT_GAMECONTROLLER)) { - /* game controller implies joystick */ - flags |= SDL_INIT_JOYSTICK; - } - - if ((flags & (SDL_INIT_VIDEO|SDL_INIT_JOYSTICK))) { - /* video or joystick implies events */ - flags |= SDL_INIT_EVENTS; - } - /* Initialize the event subsystem */ if ((flags & SDL_INIT_EVENTS)) { #if !SDL_EVENTS_DISABLED