aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2016-01-29 06:57:42 -0800
committerRay <raysan5@gmail.com>2016-01-29 06:57:42 -0800
commit4ec0ac89cda482031c393425381a2627a9468f09 (patch)
treec9e0f1981ec06f25257fe380b4afef4ba14bb944 /src
parent196bda05976426c2a7760911a810fb83043a49ae (diff)
parent13925f7bd4ad6b71f03a24024057819eb1032e05 (diff)
downloadraylib-4ec0ac89cda482031c393425381a2627a9468f09.tar.gz
raylib-4ec0ac89cda482031c393425381a2627a9468f09.zip
Merge pull request #82 from procedural/disable-cursor
Disable cursor feature
Diffstat (limited to 'src')
-rw-r--r--src/core.c18
-rw-r--r--src/raylib.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index 8b36e1ea..cf6fcf33 100644
--- a/src/core.c
+++ b/src/core.c
@@ -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()
{
diff --git a/src/raylib.h b/src/raylib.h
index 48aeda54..6c1a8999 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -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