Inconsistency between SDL_GetGlobalMouseState
position and SDL_GetWindowPosition
on Emscripten
#12667
Milestone
SDL_GetGlobalMouseState
position and SDL_GetWindowPosition
on Emscripten
#12667
Hi, I am working on a fork of SFML that uses SDL3 as the backend for windows, joystick, and more.
I reimplemented the
sf::Mouse::getPosition
API as follows:This works well on every platform I've tested except Emscripten, where it seems that the
getPosition(const WindowBase&)
overload returns an incorrect position. More precisely, it seems thatgetPosition()
returns coordinates relative to the canvas in the webpage, andSDL_GetWindowPosition()
does the same, therefore the final computed position is incorrect.I've managed to work around the issue like this:
But it does seem that this is an inconsistency in SDL3.
The text was updated successfully, but these errors were encountered: