Move SetMouseCursor from rcore to android, desktop, web

This commit is contained in:
ubkp 2023-09-22 16:35:47 -03:00
parent 430f6dd1e7
commit 694190ea12
4 changed files with 41 additions and 15 deletions

View File

@ -2106,20 +2106,20 @@ Vector2 GetMouseWheelMoveV(void)
return result; return result;
} }
// Set mouse cursor //// Set mouse cursor
// NOTE: This is a no-op on platforms other than PLATFORM_DESKTOP //// NOTE: This is a no-op on platforms other than PLATFORM_DESKTOP
void SetMouseCursor(int cursor) //void SetMouseCursor(int cursor)
{ //{
#if defined(PLATFORM_DESKTOP) //#if defined(PLATFORM_DESKTOP)
CORE.Input.Mouse.cursor = cursor; // CORE.Input.Mouse.cursor = cursor;
if (cursor == MOUSE_CURSOR_DEFAULT) glfwSetCursor(CORE.Window.handle, NULL); // if (cursor == MOUSE_CURSOR_DEFAULT) glfwSetCursor(CORE.Window.handle, NULL);
else // else
{ // {
// NOTE: We are relating internal GLFW enum values to our MouseCursor enum values // // NOTE: We are relating internal GLFW enum values to our MouseCursor enum values
glfwSetCursor(CORE.Window.handle, glfwCreateStandardCursor(0x00036000 + cursor)); // glfwSetCursor(CORE.Window.handle, glfwCreateStandardCursor(0x00036000 + cursor));
} // }
#endif //#endif
} //}
//// Get touch position X for touch point 0 (relative to screen size) //// Get touch position X for touch point 0 (relative to screen size)
//int GetTouchX(void) //int GetTouchX(void)

View File

@ -1683,6 +1683,13 @@ float GetMouseWheelMove(void)
return 0.0f; return 0.0f;
} }
// Set mouse cursor
// NOTE: This is a no-op on platforms other than PLATFORM_DESKTOP
void SetMouseCursor(int cursor)
{
TRACELOG(LOG_INFO, "SetMouseCursor not implemented in rcore_android.c");
}
// Get touch position X for touch point 0 (relative to screen size) // Get touch position X for touch point 0 (relative to screen size)
int GetTouchX(void) int GetTouchX(void)
{ {

View File

@ -1579,6 +1579,19 @@ float GetMouseWheelMove(void)
return result; return result;
} }
// Set mouse cursor
// NOTE: This is a no-op on platforms other than PLATFORM_DESKTOP
void SetMouseCursor(int cursor)
{
CORE.Input.Mouse.cursor = cursor;
if (cursor == MOUSE_CURSOR_DEFAULT) glfwSetCursor(CORE.Window.handle, NULL);
else
{
// NOTE: We are relating internal GLFW enum values to our MouseCursor enum values
glfwSetCursor(CORE.Window.handle, glfwCreateStandardCursor(0x00036000 + cursor));
}
}
// Get touch position X for touch point 0 (relative to screen size) // Get touch position X for touch point 0 (relative to screen size)
int GetTouchX(void) int GetTouchX(void)
{ {

View File

@ -1099,7 +1099,6 @@ void SetMousePosition(int x, int y)
glfwSetCursorPos(CORE.Window.handle, CORE.Input.Mouse.currentPosition.x, CORE.Input.Mouse.currentPosition.y); glfwSetCursorPos(CORE.Window.handle, CORE.Input.Mouse.currentPosition.x, CORE.Input.Mouse.currentPosition.y);
} }
// Get mouse wheel movement Y // Get mouse wheel movement Y
float GetMouseWheelMove(void) float GetMouseWheelMove(void)
{ {
@ -1111,6 +1110,13 @@ float GetMouseWheelMove(void)
return result; return result;
} }
// Set mouse cursor
// NOTE: This is a no-op on platforms other than PLATFORM_DESKTOP
void SetMouseCursor(int cursor)
{
TRACELOG(LOG_INFO, "SetMouseCursor not implemented in rcore_web.c");
}
// Get touch position X for touch point 0 (relative to screen size) // Get touch position X for touch point 0 (relative to screen size)
int GetTouchX(void) int GetTouchX(void)
{ {