Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid SDL_GetMouseState(), which returns raw coordinates (fixes #318) #320

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/SDL12_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -7294,12 +7294,6 @@ UpdateRelativeMouseMode(void)
const SDL_bool enable = (VideoWindowGrabbed && VideoCursorHidden) ? SDL_TRUE : SDL_FALSE;
if (MouseInputIsRelative != enable) {
MouseInputIsRelative = enable;
if (MouseInputIsRelative) {
/* reset position, we'll have to track it ourselves in SDL_MOUSEMOTION events, since 1.2
* would give you window coordinates, even in relative mode. */
SDL20_GetMouseState(&MousePosition.x, &MousePosition.y);
AdjustOpenGLLogicalScalingPoint(&MousePosition.x, &MousePosition.y);
}
SDL20_SetRelativeMouseMode(MouseInputIsRelative);
}
}
Expand Down
Loading