Move GetTouchX, GetTouchY, GetTouchPosition from rcore to web, desktop, android
This commit is contained in:
parent
ab1afa36e1
commit
430f6dd1e7
1 changed files with 111 additions and 45 deletions
|
|
@ -1111,6 +1111,29 @@ float GetMouseWheelMove(void)
|
|||
return result;
|
||||
}
|
||||
|
||||
// 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)
|
||||
|
|
@ -1118,7 +1141,6 @@ void SwapScreenBuffer(void)
|
|||
glfwSwapBuffers(CORE.Window.handle);
|
||||
}
|
||||
|
||||
|
||||
// Register all input events
|
||||
void PollInputEvents(void)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue