Stut-Stut-Sssssstuttering mouse in OpenGL
How come the screen jitters when I move the mouse in OpenGL?
PLEASE HELP! hehe
Tell me if you need code or something...
~-=-=-=-=-=-=~
~Justin Eslinger~
~.."BlackScar"..~
~-=-=-=-=-=-=~
Sorry, don''t know what I was thinking. (That post was EARLI'' IN THE MORN) hheehheheh
Ok, here''s some code to feast yer'' eyes on.
POINT p;
GetCursorPos(&p);
SetCursorPos(320, 240);
user.yrot -= (float)(320 - p.x)/100 * Mouse_Speed;
user.xrot -= (float)(240 - p.y)/100 * Mouse_Speed;
if (user.xrot > 65)
user.xrot = 65;
if (user.xrot < -65)
user.xrot = -65;
^- That shows you how I get my X & Y rotation. Now here''s how I do a strafe button for example.
user.pos.x += (float)sin((user.yrot-90)*piover180)*Player_Speed;
user.pos.z -= (float)cos((user.yrot-90)*piover180)*Player_Speed;
Now, if I move regularly or circle strafe, it stutters. Why??
Thanks!
~-=-=-=-=-=-=~
~Justin Eslinger~
~.."BlackScar"..~
~-=-=-=-=-=-=~
Ok, here''s some code to feast yer'' eyes on.
POINT p;
GetCursorPos(&p);
SetCursorPos(320, 240);
user.yrot -= (float)(320 - p.x)/100 * Mouse_Speed;
user.xrot -= (float)(240 - p.y)/100 * Mouse_Speed;
if (user.xrot > 65)
user.xrot = 65;
if (user.xrot < -65)
user.xrot = -65;
^- That shows you how I get my X & Y rotation. Now here''s how I do a strafe button for example.
user.pos.x += (float)sin((user.yrot-90)*piover180)*Player_Speed;
user.pos.z -= (float)cos((user.yrot-90)*piover180)*Player_Speed;
Now, if I move regularly or circle strafe, it stutters. Why??
Thanks!
~-=-=-=-=-=-=~
~Justin Eslinger~
~.."BlackScar"..~
~-=-=-=-=-=-=~
If you''re using windows messages for the movement, switch it over to DirectInput. That should fix it.
-BacksideSnap-
-BacksideSnap-
not nessecary (dinput i mean)
though blackscar is that code in your wm_mousemove function. if so SetCursorPos(320, 240); generates another wm_mousemove message
so whatcha gotta do is just ignore the second message
though blackscar is that code in your wm_mousemove function. if so SetCursorPos(320, 240); generates another wm_mousemove message
so whatcha gotta do is just ignore the second message
Try nehe''s tutorials they have mouse implementations on some of the latest ones. -DarkHacker
Ok, don''t listen to me. I''ve never been through this problem before and haven''t made it work right. Direct Input? What''s it for? Just use windows messages. Sure dude.
-BacksideSnap-
-BacksideSnap-
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement