The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
[BUG] SDL_GetMouseState ≠ SDL_MouseButtonEvent
krux


Joined: 07 Aug 2014
Posts: 5
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.
krux


Joined: 07 Aug 2014
Posts: 5
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.
[BUG] SDL_GetMouseState ≠ SDL_MouseButtonEvent
Daniel Gibson
Guest

Am 08.08.2014 00:41, schrieb krux:
Quote:
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.



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

Cheers,
Daniel

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
[BUG] SDL_GetMouseState ≠ SDL_MouseButtonEvent
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
What would be your preferred solution for this?


On Sun, Aug 10, 2014 at 9:34 AM, krux wrote:
Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

[BUG] SDL_GetMouseState ≠ SDL_MouseButtonEvent
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
What would be your preferred solution for this?


On Sun, Aug 10, 2014 at 9:34 AM, krux wrote:
Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

[BUG] SDL_GetMouseState ≠ SDL_MouseButtonEvent
Leonardo


Joined: 11 Feb 2010
Posts: 46
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:
Quote:
What would be your preferred solution for this?


On Sun, Aug 10, 2014 at 9:34 AM, krux wrote:

Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org






_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org