Joystick / Win32 (USB?) BUG

SDL is segfaulting on me if I enable joystick events and then call
SDL_PollEvent. A smallest test-case application is included at the end
of this message.

    Platform:       win32 (win98) + cygwin latest
    SDL version:    1.1.7
    Hardware:       P3-800, GeForce2, USB ms sidewinder stick
    Software:       Win98, dx8, nvidia drivers 6.50

I haven’t tried the CVS as I can’t get it to build with cygwin (can’t
get the configure script generated). Unfortunately I don’t have a
non-USB stick (or actually I have a stick, but no game port) to tell
if this is particularly related to the USB stick.

Calling the winmm joystick routines (or at least, joyGetPosEx)
directly works fine.

Is this a known bug? Am I doing something stupid?

  • Mike

#include <stdio.h>
#include <SDL/sdl.h>

int
main(int argc, char *argv[])
{
int numsticks, done;
SDL_Joystick *stick;
SDL_Event ev;

    SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK);
    SDL_SetVideoMode(640, 480, 0, SDL_OPENGL);

    numsticks = SDL_NumJoysticks();
    printf("Number of sticks: %d\n", numsticks);

    if (numsticks > 0) {
            SDL_JoystickEventState(SDL_ENABLE);
            stick = SDL_JoystickOpen(0);
    }

    done = 0;
    while (!done) {
            SDL_PollEvent(&ev);
            if (ev.type = SDL_QUIT)
                    done = 1;
    }

    SDL_Quit();
    return 0;

}

SDL is segfaulting on me if I enable joystick events and then call
SDL_PollEvent. A smallest test-case application is included at the end
of this message.

    Platform:       win32 (win98) + cygwin latest
    SDL version:    1.1.7
    Hardware:       P3-800, GeForce2, USB ms sidewinder stick
    Software:       Win98, dx8, nvidia drivers 6.50

This is fixed in CVS. SDL 1.1.8 will be released in a day or two
with this fix.

I haven’t tried the CVS as I can’t get it to build with cygwin (can’t
get the configure script generated).

Grab the tarball from http://www.libsdl.org/cvs.html

Thanks for the report!

-Sam Lantinga, Lead Programmer, Loki Entertainment Software