Add functions to disable and enable cursor

This commit is contained in:
Constantine Tarasenkov 2016-01-29 09:09:18 +03:00
parent e6ad166ae3
commit 13925f7bd4
2 changed files with 20 additions and 0 deletions

View file

@ -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()
{