Merge pull request #82 from procedural/disable-cursor

Disable cursor feature
This commit is contained in:
Ray 2016-01-29 06:57:42 -08:00
commit 4ec0ac89cd
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()
{

View File

@ -586,6 +586,8 @@ int GetMouseWheelMove(void); // Returns mouse wheel m
void ShowCursor(void); // Shows cursor
void HideCursor(void); // Hides cursor
void EnableCursor(void); // Enables cursor
void DisableCursor(void); // Disables cursor
bool IsCursorHidden(void); // Returns true if cursor is not visible
#endif