Mouse movement problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
JunkerKun
Posts: 97
Joined: Mon Jan 28, 2013 12:52 am

Mouse movement problem

Post by JunkerKun »

Heyo.
So I've implemented mouse looking by getting mouse position then calculation the difference between itand ceneter of the screen and then setting mouse position tothe center. However when I hold mouse buttons (left, right or middle) it's as if receiver starts getting events far less often than without holding mouse buttons. Camera (and mouse cursor) start ocasionally "jumping" - rotating further than it should. Like camera update event doesn't work for a frame or even several frames so and mouse cursor is not set to center.
Is there a possible explanation?
CuteAlien
Admin
Posts: 9652
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Mouse movement problem

Post by CuteAlien »

Maybe you accidentally catch some events when the mouse-button is down? For example a break missing in switch-case when handling mouse-events?
Or maybe you started some click on a gui-element and it grabs the mouse for now and handles events.
The OS shouldn't send less events.

Are you working with events or with ICursorControl::getPosition? If you use the latter you have to be careful on X11 as we have some flag to cache positions there (and if you think that's bad.. it can be disabled, but then you fight with X11 sending mouse-requests to X11 server which can take several ms and freeze your game).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
JunkerKun
Posts: 97
Joined: Mon Jan 28, 2013 12:52 am

Re: Mouse movement problem

Post by JunkerKun »

No, I use ICursorControl but on windows. It seems like my pc is bending me over, but I'm not too sure. I even tried to use sfml for noise input but the problem still occurs. I'll check your other suggestions but chances are it's just my pc. Win 10 is giving me a headache sometimes.
Thanks for suggestions.
CuteAlien
Admin
Posts: 9652
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Mouse movement problem

Post by CuteAlien »

Hm, it's usually not the OS as much as we coders like to blame it ;-)
Is your framerate smooth? Maybe add some simply animation which constantly runs (like some ball going left-right-left) so you can see if something is stuttering. Or add a timer in each frame and check for the worst-case.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
JunkerKun
Posts: 97
Joined: Mon Jan 28, 2013 12:52 am

Re: Mouse movement problem

Post by JunkerKun »

CuteAlien wrote:Hm, it's usually not the OS as much as we coders like to blame it ;-)
Is your framerate smooth? Maybe add some simply animation which constantly runs (like some ball going left-right-left) so you can see if something is stuttering. Or add a timer in each frame and check for the worst-case.
Yes, it's smooth. I think the problem is indeed my PC since I tried it on other machines including my friends'. It might be the problem with VSync since it only occurs when I turn it on. It's strange to say the least. I never had such problems before.
Post Reply