瀏覽代碼

Merge pull request #82 from procedural/disable-cursor

Disable cursor feature
pull/83/head
Ray 9 年之前
父節點
當前提交
4ec0ac89cd
共有 2 個檔案被更改,包括 20 行新增0 行删除
  1. +18
    -0
      src/core.c
  2. +2
    -0
      src/raylib.h

+ 18
- 0
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()
{

+ 2
- 0
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

Loading…
取消
儲存