1

I'm coding a 3d game, and I want to change the yaw for my camera using:

case WM_MOUSEMOVE:
        xPos = (LOWORD(lParam)+(1680/2)); 
        yPos = (HIWORD(lParam)+(1050/2)); 
        graphics.Yaw(xPos);
        SetCursorPos(1680/2 , 1050/2);
        break; 

however, in the WndProc method, it causes an infinite loop and constant yaw rotation.

Is there a better way I can set the mouse to the center of the window after catching input, without once again calling the method?

EDIT: I've set the current windows to be the full resolution of my monitor (1680x1050) and I'm not actually using OpenGl, I'm using default windows with Visual studio using the Directx9 libraries.

Soup
  • 1,699
  • 15
  • 30
Ang0
  • 11
  • 3
  • You might need to include more information, such as the windowing/GL toolkit you're using. – Soup Nov 12 '13 at 01:08
  • Ok, so I read up on the SetCursorPos a little more, and turns out it calls this event when it's used, so what other options are there besides SetConsoleCursorPosition, if any? – Ang0 Nov 12 '13 at 01:47
  • Welp, after a little bit more research I have found [this](http://cboard.cprogramming.com/c-programming/42482-setting-cursor-position-c.html), so thanks anyways guys. – Ang0 Nov 12 '13 at 01:52
  • @Ang0, that link talks about setting the *console* cursor position, not the mouse cursor onscreen. – David Nov 12 '13 at 15:05

0 Answers0