diff options
| author | Constantine Tarasenkov <constantine@protonmail.com> | 2016-01-29 09:09:18 +0300 |
|---|---|---|
| committer | Constantine Tarasenkov <constantine@protonmail.com> | 2016-01-29 09:09:18 +0300 |
| commit | 13925f7bd4ad6b71f03a24024057819eb1032e05 (patch) | |
| tree | d2d05580d45234734e6593c02f31ae98a82f2c45 /src/core.c | |
| parent | e6ad166ae34a35ee2a2f53359146ae58d1376dd6 (diff) | |
| download | raylib-13925f7bd4ad6b71f03a24024057819eb1032e05.tar.gz raylib-13925f7bd4ad6b71f03a24024057819eb1032e05.zip | |
Add functions to disable and enable cursor
Diffstat (limited to 'src/core.c')
| -rw-r--r-- | src/core.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1097,6 +1097,24 @@ void ShowCursor() cursorHidden = false; } +// Disable mouse cursor +void DisableCursor() +{ +#if defined(PLATFORM_DESKTOP) + glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); +#endif + cursorHidden = true; +} + +// Enable mouse cursor +void EnableCursor() +{ +#if defined(PLATFORM_DESKTOP) + glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); +#endif + cursorHidden = false; +} + // Check if mouse cursor is hidden bool IsCursorHidden() { |
