void GetMouseInfo() { static GLuint mouseX, mouseY; /* Get current mouse position */ SDL_GetMouseState(&mouseX, &mouseY); /* Reset the mouse position */ SDL_WarpMouse((appWidth/2), (appHeight/2)); /* Calculate the movement of the mouse */ float moveX = (float)((appWidth/2) - mouseX) / 100.0; float moveY = (float)((appHeight/2) - mouseY) / 100.0; printf("moveX: %f, moveY: %f\n", moveX, moveY); /* Update the mouse position */ mousePosition[0] -= moveX; mousePosition[1] += moveY; printf("mouseX: %f, mouseY: %f\n", mousePosition[0], mousePosition[1]); }