[SDL] Get mouse position relative to window

Phufhi phufhi at gmail.com
Mon Sep 26 13:10:08 PDT 2016


I was wondering why SDL2 does not have a function to get the mouse position relative to a given window.
Other functions regarding the mouse like SDL_WarpMouseInWindow allow you to specify a window, while SDL_GetMouseState only works relative to the focus window (this seems inconsistent to me).
Even though I do know how to calculate the relative position using SDL_GetGlobalMouseState, I am curious about any specific reason behind the absence of the function in question.
Furthermore, alternative window/input libraries such as glfw and sfml do have this functionality. 
Is the SDL_GetGlobalMouseState solution as efficient as their implementations?
Thanks in advance.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20160926/02c3b6a5/attachment.htm>


More information about the SDL mailing list