[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:
parent
0ef3e09d7a
commit
d5a780d4d1
1 changed files with 154 additions and 541 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue