Move SetMousePosition out of rcore
This commit is contained in:
parent
a18fe28e6f
commit
ea71464653
12
src/rcore.c
12
src/rcore.c
|
|
@ -2085,18 +2085,6 @@ Vector2 GetMouseDelta(void)
|
|||
return delta;
|
||||
}
|
||||
|
||||
// Set mouse position XY
|
||||
void SetMousePosition(int x, int y)
|
||||
{
|
||||
CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y };
|
||||
CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition;
|
||||
|
||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||
// NOTE: emscripten not implemented
|
||||
glfwSetCursorPos(CORE.Window.handle, CORE.Input.Mouse.currentPosition.x, CORE.Input.Mouse.currentPosition.y);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Set mouse offset
|
||||
// NOTE: Useful when rendering to different size targets
|
||||
void SetMouseOffset(int offsetX, int offsetY)
|
||||
|
|
|
|||
|
|
@ -1669,3 +1669,10 @@ Vector2 GetMousePosition(void)
|
|||
{
|
||||
return GetTouchPosition(0);
|
||||
}
|
||||
|
||||
// Set mouse position XY
|
||||
void SetMousePosition(int x, int y)
|
||||
{
|
||||
CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y };
|
||||
CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1558,3 +1558,13 @@ Vector2 GetMousePosition(void)
|
|||
|
||||
return position;
|
||||
}
|
||||
|
||||
// Set mouse position XY
|
||||
void SetMousePosition(int x, int y)
|
||||
{
|
||||
CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y };
|
||||
CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition;
|
||||
|
||||
// NOTE: emscripten not implemented
|
||||
glfwSetCursorPos(CORE.Window.handle, CORE.Input.Mouse.currentPosition.x, CORE.Input.Mouse.currentPosition.y);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -999,3 +999,10 @@ Vector2 GetMousePosition(void)
|
|||
|
||||
return position;
|
||||
}
|
||||
|
||||
// Set mouse position XY
|
||||
void SetMousePosition(int x, int y)
|
||||
{
|
||||
CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y };
|
||||
CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1599,3 +1599,13 @@ Vector2 GetMousePosition(void)
|
|||
|
||||
return position;
|
||||
}
|
||||
|
||||
// Set mouse position XY
|
||||
void SetMousePosition(int x, int y)
|
||||
{
|
||||
CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y };
|
||||
CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition;
|
||||
|
||||
// NOTE: emscripten not implemented
|
||||
glfwSetCursorPos(CORE.Window.handle, CORE.Input.Mouse.currentPosition.x, CORE.Input.Mouse.currentPosition.y);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user