SDL Joystick calibration

Hi all,

I’m porting an Allegro application to SDL and have a few questions about
joystick support in SDL:

  1. Does SDL use the windows joystick calibration data? I calibrated a
    joystick via Windows Game Controller plugin, and although it shows centered in
    the plugin test, the cursor is way offset using the SDL test program
    testjoystick.c

  2. Does anyone have any code examples of calibrating the joystick
    programmatically? Either an example of dynamic calibration (where the
    joystick becomes more accurate as it is used more) or explicit calibration
    (similar to the windows calibration procedure).

Thanks

Hello Mark,

Friday, September 22, 2006, 4:23:15 AM, you wrote:

Hi all,

I’m porting an Allegro application to SDL and have a few questions about
joystick support in SDL:

  1. Does SDL use the windows joystick calibration data? I calibrated a
    joystick via Windows Game Controller plugin, and although it shows centered in
    the plugin test, the cursor is way offset using the SDL test program
    testjoystick.c

Be aware that SDL defaults to the “wingdi” backend currently. This
would use the old multimedia API’s for joysticks, which AFAIK don’t
follow the calibration data.

If you make your program use the DirectX backend, it will use
DirectInput which should take the calibration into account.–
Best regards,
Peter mailto:@Peter_Mulholland

Peter Mulholland <darkmatter freeuk.com> writes:

Hello Mark,

Friday, September 22, 2006, 4:23:15 AM, you wrote:

Hi all,

I’m porting an Allegro application to SDL and have a few questions about
joystick support in SDL:

  1. Does SDL use the windows joystick calibration data? I calibrated a
    joystick via Windows Game Controller plugin, and although it shows centered
    in

the plugin test, the cursor is way offset using the SDL test program
testjoystick.c

Be aware that SDL defaults to the “wingdi” backend currently. This
would use the old multimedia API’s for joysticks, which AFAIK don’t
follow the calibration data.

If you make your program use the DirectX backend, it will use
DirectInput which should take the calibration into account.

Thank you for your response.

I re-ran configure in SDL-1.2.9 and I see it reports no directx headers or
libraries.

So, using SDL 1.2.9 on Windows 98, I just need to install DirectX and the
DirectX SDK, re-run configure; make; make-install on SDL, link in some
additional directx libraries, and that should fix this issue? Or do I need to
include some additional -D flags to my compile?

Just need some clarification on how to go about this. Thanks.