[SDL] Joystick Segfault
Ray Kelm
rhk at newimage.com
Sun Jun 17 16:56:10 PDT 2001
On Sunday 17 June 2001 19:10, you wrote:
> > Shouldn't SDL_JoystickUpdate() gracefully handle the case of no
> > joysticks?
>
> It does, it sounds like you have an old version of SDL.
> Try grabbing the latest CVS and try that:
> http://www.libsdl.org/cvs.html
>
> See ya!
> -Sam Lantinga, Lead Programmer, Loki Software, Inc.
Actually, I am using the CVS code, but I haven't done an update in about a
week :)
I found *my* problem. I was not initializing the joystick subsystem of SDL. I
still think it should be able to handle that without segfaulting, but since
it's technically "undefined behavior" I can't complain :)
It should, however, probably be noted in the SDL_JoystickOpen() and
SDL_NumJoysticks() calls that they will not function correctly unless the
joystick subsection was initialized in the call to SDL_Init(). I wasn't aware
that the joystick parts needed explicit initialization, since it wasn't
referenced.
I was able to get everything working nicely, although I found that Mandrake
8.0 didn't correctly set up the joystick driver - it needed a little manual
intervention.
-Ray
More information about the SDL
mailing list