Joystick problems

hi. i’m compiling an SDL app on win32 with the mingw toolkit. i’m
running into a strange problem with the joystick, where it freezes on the
command to open the joystick, and the app must be force-killed.

this is the code that freezes:

if( SDL_Init(SDL_INIT_JOYSTICK) < 0 ) {
support[JOY]=0;
} else {
if( SDL_NumJoysticks() > 0 ) {
joy = SDL_JoystickOpen(0);
^^^^^^^^^^^^^^^^^^^^^^^^^

the SDL_JoystickOpen() command is where the freeze occurs. it seems to
occur only on machines that have no joystick installed through the windows
control panel, or on machines that have a joystick installed but is not
plugged in. it works fine on every machine i’ve tried with a joystick
installed.

has anyone else run into this problem?

many thanks,
and here is a shameless plug for the first project i’m making with SDL:
http://studiofojar.com/projects/mkgamma/ :slight_smile: (release in 1 month!)

steve–
“We’re on a mission from God.”
– The Blues Brothers

has anyone else run into this problem?

It’s a bug in SDL 1.1.7, grab the latest CVS snapshot for the fix:
http://www.libsdl.org/cvs.html

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software