title: OpenGL Camera - Move the camera without it snapping back when using SetCursorPos(x,y);?
body: <p>I have a problem when I try to update my camera.</p>
  
  <p>I want to change the pitch and yaw of the the camera (where its looking) via the mouse 
  But I want the mouse to stay positioned to the center of the window.</p>
  
  <pre><code>//where MouseP.x .y is the mouse position 
  //(which is centered to the current window)
  
  //get old position of the mouse
  OldP.x = MouseP.x;
  OldP.y = MouseP.y;
  
  //work out the distance traveled
  Delta.x = MouseP.x - OldP.x;
  Delta.y = MouseP.y - OldP.y;
  
  //update the camera(using  distance traveled)
  Rot.Yaw -=Delta.x/5;
  Rot.Pitch -= Delta.y/5;
  
  //move mouse to the center of the screen
  SetCursorPos(CENTER_SCREEN_X,CENTER_SCREEN_Y);
  </code></pre>
  
  <p>the problem is the camera snaps back to a certain point as the mouse is set to return to the origin. </p>
  
  <p>I want to update the camera by the distance traveled from the origin but not the distance back to the origin.</p>
  
  <p>If I take it out, it works wonderfully but the then mouse can go out of the window.</p>