SDL_GetMouseState and SDL_MouseButtonEvent have a different coordinate system for the mouse position. When my logical size matches the window size, both work fine, but when my logical size is smaller then my window size, then the event gives me coordinates in logical size coordinates and SDL_GetMouseState gives me unscaled window coordinates.
sorry if I repost here to just bring this topic to the top again. But I think this is really a major bug that can be fixed easily. So pleas any response. And sorry for the unprintable not equals sign in the title, didn’t know that this board replaces it with something that is displayed wrongly everywhere.
SDL_GetMouseState and SDL_MouseButtonEvent have a different coordinate
system for the mouse position. When my logical size matches the window
size, both work fine, but when my logical size is smaller then my window
size, then the event gives me coordinates in logical size coordinates
and SDL_GetMouseState gives me unscaled window coordinates.
What would be your preferred solution for this?On Sun, Aug 10, 2014 at 9:34 AM, krux <arne.doering at gmx.net> wrote:
sorry if I repost here to just bring this topic to the top again. But I
think this is really a major bug that can be fixed easily. So pleas any
response. And sorry for the unprintable not equals sign in the title,
didn’t know that this board replaces it with something that is displayed
wrongly everywhere.
There’s a bug in the bugzilla for this issue already:
You could work around it by using event handlers, as the renderers fixes
the mouse events according to its logical size.
I don’t know how should we go because getting the true mouse coordinates
can be useful…? Maybe through another function, say,
SDL_GetAbsoluteMouseState(), to make it clear.
2014-08-20 2:12 GMT-03:00 Sam Lantinga :> What would be your preferred solution for this?
On Sun, Aug 10, 2014 at 9:34 AM, krux <arne.doering at gmx.net> wrote:
sorry if I repost here to just bring this topic to the top again. But I
think this is really a major bug that can be fixed easily. So pleas any
response. And sorry for the unprintable not equals sign in the title,
didn’t know that this board replaces it with something that is displayed
wrongly everywhere.