[split] rcore, web, desktop, android changes (batch 3) (#3338)

* First pass to remove unneeded platform macros for web

* Second pass to remove unneeded platform macros for web

* Move GetTouchX, GetTouchY, GetTouchPosition from rcore to web, desktop, android

* Move SetMouseCursor from rcore to android, desktop, web
This commit is contained in:
ubkp 2023-09-22 18:17:59 -03:00 • committed by GitHub
commit d5a780d4d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1677,13 +1677,42 @@ void SetMousePosition(int x, int y)
CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition;
}
// Get mouse wheel movement Y
float GetMouseWheelMove(void)
{
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)
int GetTouchX(void)
{
return (int)CORE.Input.Touch.position[0].x;
}
// Get touch position Y for touch point 0 (relative to screen size)
int GetTouchY(void)
{
return (int)CORE.Input.Touch.position[0].y;
}
// Get touch position XY for a touch point index (relative to screen size)
// TODO: Touch position should be scaled depending on display size and render size
Vector2 GetTouchPosition(int index)
{
Vector2 position = { -1.0f, -1.0f };
if (index < MAX_TOUCH_POINTS) position = CORE.Input.Touch.position[index];
else TRACELOG(LOG_WARNING, "INPUT: Required touch point out of range (Max touch points: %i)", MAX_TOUCH_POINTS);
return position;
}
// Swap back buffer with front buffer (screen drawing)
void SwapScreenBuffer(void)
@ -1691,7 +1720,6 @@ void SwapScreenBuffer(void)
eglSwapBuffers(CORE.Window.device, CORE.Window.surface);
}
// Register all input events
void PollInputEvents(void)
{
@ -1745,4 +1773,4 @@ void PollInputEvents(void)
//ANativeActivity_finish(CORE.Android.app->activity);
}
}
}
}