Jerky mouse movement in fullscreen

Started by
3 comments, last by superpig 20 years, 11 months ago
Hey, I''m writing something based on the DirectX AppWizard, using DirectInput Action Mapping (a first for me). The game I''m writing is a flight-sim type thing. I''ve got two axis set up, mapped to MOUSE_X and MOUSE_Y. The axis ranges are set to +/- 1000, and when checking for input the axis values get divided by 1000, (supposedly) producing a medium-precision value between 1 and -1. In windowed mode, everything works fine - my avatar pitches and rolls smoothly. But when I switch to fullscreen mode, it only seems to move in 5-degree increments or so, on both axis in both directions. I''m still getting a framerate of 60fps (locked to my monitor), so it''s not jerky due to that. Anyone know why it might be doing this in fullscreen mode and not windowed mode, or how I might go about fixing it? Thanks in advance... Superpig - saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Advertisement
*bump*

Please? It''s in your own best interests, you know - helping a really fun game come into the world. It''s like helping to deliver a baby. You like babies, don''t you?

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

hmm.. unfortunetly I don''t have anything that could help, I have the same problem (just using cursor for menus). For the time being I put a Sleep(5); in the gameloop and that has smoothed the mouse movement. Experiment with that to see if it''s a simular problem, might help you come up with a good solution.
Sleep(5), eh? Hmm... IIRC, Sleep() surrenders to other threads, so it may be the DirectInput threads aren''t being given enough time; or it may be the mouse isn''t sending data fast enough or something. Weird.

I''ll try your solution and see what happens. Thanks.

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

ooohhhh your so close...

Whack in Sleep(0), that gives windows time to catch up, and everything is hunkey dorey.

I''m amazed that commercial games leave this problem in, when there is such a simple fix.

Sloppy sloppy sloppy.

This topic is closed to new replies.

Advertisement