Joystick problem |
Joystick problem |
Daniel Gibson
Guest
|
Hi Uwe,
Not sure if SDL even gets a value for the axis from the OS before they're moved. Might also be different per platform; which OS are you using? Cheers, Daniel On 21.11.2016 23:58, Huepper wrote:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
Huepper
|
Hi Daniel,
Oh, sorry, I forgot to mention: Win10 x64, VS2015 C ++ / MFC, SDL2.05, Target Win32 App It also seems to happen only in debug sessions. I notice it at sometimes jerky throttle levers (in the Simulator) at the first moment and during the line-wise debugings (SDL_JoystickGetAxis () returns 0 as long as I do not move the joy axis). In the release version, there is nothing negative to note. If the code snippet I've published is OK, then I can live with it. Thank you very much for your interest Cheers, -Uwe |
|||||||||||
|
Joystick problem |
Daniel Gibson
Guest
|
Hi Uwe,
the code snippet looks ok; however you /could/ do it differently to work around the problem, by using a proper event-loop, with SDL_PollEvent(). Then you could save a "not initialized" flag per axis and only use the axis once you received a SDL_JOYAXISMOTION event for it. Those events will always have real values, and not an "I don't have a value yet so you get 0". (No idea why debug vs release builds behave differently here) Cheers, Daniel On 28.11.2016 23:39, Huepper wrote:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
Huepper
|
Hi Daniel,
I can not use the SDL_EventSystem because I have no SDL_Window. That with the poll is OK for me. I may be doing something different during the debugging session and the problem is not within SDL. With my request I only wanted to make sure that I did nothing wrong, since the published examples always refer to the EventSystem. Thanks again for your support Cheers -Uwe |
|||||||||||
|