mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mingw-cross-env-list] PATCH: Re: SDL_HapticOpenFromJoystick doesn't ini


From: Franz Schrober
Subject: [Mingw-cross-env-list] PATCH: Re: SDL_HapticOpenFromJoystick doesn't initialize correctly on Win32
Date: Wed, 26 Jun 2013 21:40:19 +0100 (BST)

Here is my patch for the problem



----- Ursprüngliche Message -----
Von: Franz Schrober <address@hidden>
An: "address@hidden" <address@hidden>
CC: 
Gesendet: 22:15 Mittwoch, 26.Juni 2013
Betreff: Re: SDL_HapticOpenFromJoystick doesn't initialize correctly on Win32

I've just looking through the code and found following things:

SDL_HapticOpenFromJoystick is missing:
 * haptic->index = device_index; (don't ask me how to do it)
 * SDL_HapticSetGain
 * SDL_HapticSetAutoCenter

Windows SDL_SYS_HapticOpenFromJoystick doesn't go through 
SDL_SYS_HapticOpenFromXInput. This is the reason why it cannot correctly 
initialize the haptic->supported and similar things done in this function (this 
is the only place for XInput were the supported stuff is touched)




----- Ursprüngliche Message -----
Von: Franz Schrober <address@hidden>
An: "address@hidden" <address@hidden>
CC: 
Gesendet: 21:46 Mittwoch, 26.Juni 2013
Betreff: Re: SDL_HapticOpenFromJoystick doesn't initialize correctly on Win32

HI,

I've attached an easy example program. Check out the XXX lines and try it under 
windows



----- Ursprüngliche Message -----
Von: Franz Schrober <address@hidden>
An: "address@hidden" <address@hidden>
CC: 
Gesendet: 19:56 Mittwoch, 26.Juni 2013
Betreff: SDL_HapticOpenFromJoystick doesn't initialize correctly on Win32

Hi,

I've detected a weird behaviour of the new haptic interface of SDL (post SDL 
2.0rc1 version). I've tried to open the haptic interface for a joystick using 
SDL_HapticOpenFromJoystick and queried the capabilities using SDL_HapticQuery. 
I was really wondered when it returned 0. It is a Sixaxxis 3 controller running 
under Windows with MotionInJoy as driver in XInput mode (looks like a Xbox360 
wireless controller to the OS) and I am really sure that the rumble effect 
works extreme well.

Then I've tested testrumble and noticed that also works extreme well in this 
program. So what is the difference? Yes, it is the call to SDL_HapticOpen. I've 
just added an SDL_HapticOpen(0) before my SDL_HapticOpenFromJoystick because I 
have only one haptic controller and this is also the only device (thus this 
call should make no difference). But funny enough, now the Query using the 
haptic device I got from SDL_HapticOpenFromJoystick works.

I would guess that some initialization done in SDL_HapticOpen isn't done when 
calling SDL_HapticOpenFromJoystick.

Here in short from my first version:

h = SDL_HapticOpenFromJoystick(x)
SDL_Query(h) -> 0 (br0ken)

Here in short form my second version
SDL_HapticOpen(0)
h = SDL_HapticOpenFromJoystick(x)
SDL_Query(h) -> 2

And this also works but I also cannot do this im my program:
h = SDL_HapticOpen(0)
SDL_Query(h) -> 2

Attachment: sdl2-1-xinput_init.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]