sdl/mouse: add SDL_GetGlobalMouseState()
@@ -43,6 +43,16 @@ static int SDL_WarpMouseGlobal(int x, int y)
{
return -1;
}
+
+#if defined(WARN_OUTDATED)
+#pragma message("SDL_GetGlobalMouseState is not supported before SDL 2.0.4")
+#endif
+
+static Uint32 SDL_GetGlobalMouseState(int *x, int *y)
+{
+ return 0;
+}
+
#endif
*/
import "C"
@@ -100,6 +110,14 @@ func GetMouseFocus() *Window {
return (*Window)(unsafe.Pointer(C.SDL_GetMouseFocus()))
}
+// GetGlobalMouseState returns the current state of the mouse.
+// (https://wiki.libsdl.org/SDL_GetGlobalMouseState)
+func GetGlobalMouseState() (x, y int32, state uint32) {
+ var _x, _y C.int
+ _state := uint32(C.SDL_GetGlobalMouseState(&_x, &_y))
+ return int32(_x), int32(_y), _state
+}
+
// GetMouseState returns the current state of the mouse.
// (https://wiki.libsdl.org/SDL_GetMouseState)
func GetMouseState() (x, y int32, state uint32) {
