Re: Joystick problem
Daniel Gibson <[email protected]>
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <[email protected]> |
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: > 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 > > > _______________________________________________ > SDL mailing list > [email protected] > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org >