[BUG] SDL_GetMouseState ≠ SDL_MouseButtonEvent

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.

Sounds like a bug to me, did you create an issue in
https://bugzilla.libsdl.org/ ?

Cheers,
DanielAm 08.08.2014 00:41, schrieb krux:

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.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

There’s a bug in the bugzilla for this issue already:
https://bugzilla.libsdl.org/show_bug.cgi?id=2442

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.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org