Polling mouse wheel scroll state
Is it possible to poll the scroll state of the mouse wheel?
I've just been fixing all my input and swapped everything to be polled instead of using the windows events. The only thing that is left now is the mouse scroll.
At the moment I do:
case WM_MOUSEWHEEL:
InputManager::Instance()->OnMouseScroll((int)wParam);
which works BUT it feels horribly delayed (as was all my input untill I started polling instead of catching events).
My game is multi threaded to an extent whith the game being updated in one thread and windows messages being handled in another and so that slight delay when my game is being updated that messages cannot be handled is really noticable on input.
I'm trying to get my game update method to be:
HandleInput
Update logic etc
Render
its just this one tiny scroll thing thats got me stuck.
Any help would be appreciated, thanks.
Consider using Raw Input, which tends to have lower latency compared to regular WM_MOUSE* messages. The difference is small but noticeable.
However, note that Raw Input:
1. requires Windows 2000 or higher, and
2. does not perform pointer ballistics (mouse acceleration).
#2 is actually great for FPS games, but not so nice on RTS or other games with lots of UI.
However, note that Raw Input:
1. requires Windows 2000 or higher, and
2. does not perform pointer ballistics (mouse acceleration).
#2 is actually great for FPS games, but not so nice on RTS or other games with lots of UI.
Also make sure you process all windows messages every frame, or you'll get lots of input lag.
Quote:Original post by Adam_42
Also make sure you process all windows messages every frame, or you'll get lots of input lag.
Hmm yeah, perhaps I should rethink the seperate thread for messages.
Quote:Original post by NanohaI would think so. In fact I'd rethink the polling approach too. Using Windows messages works great if you do it properly. Your delayed input had to mean you were doing something wrong such as not processing all messages each frame.Quote:Original post by Adam_42
Also make sure you process all windows messages every frame, or you'll get lots of input lag.
Hmm yeah, perhaps I should rethink the seperate thread for messages.
Quote:Original post by iMalcQuote:Original post by NanohaI would think so. In fact I'd rethink the polling approach too. Using Windows messages works great if you do it properly. Your delayed input had to mean you were doing something wrong such as not processing all messages each frame.Quote:Original post by Adam_42
Also make sure you process all windows messages every frame, or you'll get lots of input lag.
Hmm yeah, perhaps I should rethink the seperate thread for messages.
I tried an older version and removed my thread. It works perfect now. I do like the polling idea (wraps everything up neatly) but I guess I shall stick with events.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement