void Platform::setMouseCaptured(bool captured) { if (captured != __mouseCaptured) { if (captured) { // Hide the cursor and warp it to the center of the screen __mouseCapturePoint.x = getDisplayWidth() / 2; __mouseCapturePoint.y = getDisplayHeight() / 2; ShowCursor(FALSE); WarpMouse(__mouseCapturePoint.x, __mouseCapturePoint.y); } else { // Restore cursor WarpMouse(__mouseCapturePoint.x, __mouseCapturePoint.y); ShowCursor(TRUE); } __mouseCaptured = captured; } }
void CMouse::Center() { WarpMouse(g_uiWWindow/2, g_uiHWindow/2); }