Re: SDL2 Windows Joysticks failing to load on start-up
D B <buckyballreaction <at> gmail.com>
2012-08-01 05:39:46 GMT
Please forgive me for replying to myself. I have new information.
One of our Windows developers found that initializing the joystick
system after the video system will make the error go away. Is this
what is supposed to happen with SDL2? or is just good or common
practice anyways? Having to load the subsystems in a specific order
wasn't something we had to worry about with SDL 1.2.
Also, I found this old mailing list patch for 1.2 that looks like it
may be the same problem:
On Mon, Jul 30, 2012 at 8:07 PM, D B <buckyballreaction <at> gmail.com> wrote:
> In Windows (tested both in XP and 7), if I have a USB controller
> plugged in before starting my SDL2-based game, the game fails to
> detect the joystick upon start-up. I've traced the error to
> SDL_dxjoystick.c line 405:
> result =
> InputDevice, SDL_HelperWindow,
> DISCL_EXCLUSIVE |
> The above call fails when starting the game; however, it works when
> called again in the options menu of the game. The method I am calling
> in my game is Joystick::initJoystick(), and fails at
> SDL_JoystickOpen() at:
> Would anyone know why this is failing on start-up of the game, but not
> when it is loaded?
> I'm afraid I am not familiar with Windows programming (much less DX).
> Also, I do not have this problem in Mac OS X or Linux.
> Thanks for any help!