   SDL mouse warp and relative state
  hey guys,im having some problems with my mouse behavior. im building a little airhockey game and im trying to control the player bat with the mouse. this is working fine, however as soon as the mouse leaves the window then the position is at 0, 0 and it doesnt help me very much.im not too keen on locking the mouse to my game window, so i've decided to go with a hide mouse cursor & warp to the center of the screen method, however my codes now playing up and im having trouble trying to debug it.my code is:void update(float delta){  // .....  SDL_GetRelativeMouseState(&mouseX, &mouseY);  sprites->setVel((Vector(mouseX, mouseY) / delta) * 1000);    // moves my sprite at the same velocity as the mouse  SDL_WarpMouse(400, 300);   // reposition mouse at the center of the screen  // .....}now the problem is that when i warp the mouse, the sprite moves in the same direction. so eg, the mouse is in the center, i move it quickly to the far right, the sprite will move to the far right, the mouse warps back to center, the sprite moves quickly back to center.i know it should be an easy solution, but i've never really done anything like this...anyone have any ideas?cheers
  for any who are interested, the method for doing this without locking the mouse to the screen and hiding the cursor is to get the actual mouse position and subtract the warping position from it to get the displacement, change the velocity, warp the mouse back to the warping position.SDL_GetMouseState(&mouseX, &mouseY);sprites->setVel((Vector(mouseX - (WINDOW_WIDTH / 2), mouseY - (WINDOW_HEIGHT / 2)) / delta) * 1000);// Get displacement from warp positionSDL_WarpMouse(WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2);/thread