added GetMousePositionDesktop global mouse getter (good for clickthrough transparent windows)

This commit is contained in:
kin fuyuki 2025-12-21 05:25:08 -03:00
parent 6815f9cb51
commit 344dc3ae17
No known key found for this signature in database
GPG Key ID: 0E4E8E519FB71401

View File

@ -3689,16 +3689,15 @@ Vector2 GetMousePosition(void)
Vector2 GetMousePositionDesktop(void) Vector2 GetMousePositionDesktop(void)
{ {
Vector2 position = { 0 }; Vector2 position = { 0 };
#ifndef PLATFORM_ANDROID #if defined(PLATFORM_DESKTOP_GLFW)
int wxpos, wypos; int wxpos, wypos;
glfwGetWindowPos(GetWindowHandle(), &wxpos, &wypos); glfwGetWindowPos(platform.handle, &wxpos, &wypos);
double xpos, ypos; double xpos, ypos;
glfwGetCursorPos(GetWindowHandle(), &xpos, &ypos); glfwGetCursorPos(platform.handle, &xpos, &ypos);
position.x = wxpos + (floor(xpos)); position.x = wxpos + (floor(xpos));
position.y = wypos + (floor(ypos)); position.y = wypos + (floor(ypos));
#else #else
return GetMousePosition(); return GetMousePosition();
#endif #endif