Any way to recieve joystick events without initializing video?

Hi! Is there any way to use SDL for joystick input without having to
initialize video? (video is initialized later by another thread)

– thanks,
blight

I’ve never done that, but I think you can do:

SDL_Init(SDL_INIT_JOYSTICK);

and later do the SDL_Init(SDL_INIT_VIDEO) … but I don’t think you can
get any joystick events if you don’t have a window.

I think. … lolOn Sun, 2002-05-05 at 08:48, Gregor Anich wrote:

Hi! Is there any way to use SDL for joystick input without having to
initialize video? (video is initialized later by another thread)

-- thanks,
    blight
_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Chris Thielen
@Christopher_Thielen

I’ve never done that, but I think you can do:

SDL_Init(SDL_INIT_JOYSTICK);

and later do the SDL_Init(SDL_INIT_VIDEO) … but I don’t think you can
get any joystick events if you don’t have a window.

Earlier when developing some game code, I had the user configure the joystick
settings by prompting them through the command line (i.e. no window appeared
yet). This seemed to work just fine for my Windows/Linux targets.

The code’s changed since then, though, so I’m afraid I can’t pass off any
examples. I know I didn’t receive any keyboard events, though, which made it
tricky for the user to “ESC” out of the configuration :-).

Tyler

and later do the SDL_Init(SDL_INIT_VIDEO) … but I don’t think you can
get any joystick events if you don’t have a window.

I think you can get joystick events, under Linux, but I don’t imagine this
is a truth for all platforms. You can definitely poll the stick for
updates under Linux without a window or even SDL_INIT_VIDEO.

–ryan.