mirror of
https://github.com/glfw/glfw.git
synced 2026-09-20 16:30:45 +00:00
Renamed CURSOR_CAPTURED to CURSOR_DISABLED.
This commit is contained in:
+5
-5
@@ -116,7 +116,7 @@ static void centerCursor(_GLFWwindow *window)
|
||||
_glfwInputWindowSize(window, width, height);
|
||||
_glfwInputWindowDamage(window);
|
||||
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
centerCursor(window);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ static void centerCursor(_GLFWwindow *window)
|
||||
_glfwPlatformGetWindowPos(window, &x, &y);
|
||||
_glfwInputWindowPos(window, x, y);
|
||||
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
centerCursor(window);
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ static void centerCursor(_GLFWwindow *window)
|
||||
{
|
||||
_glfwInputWindowFocus(window, GL_TRUE);
|
||||
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
centerCursor(window);
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ static int convertMacKeyCode(unsigned int macKeyCode)
|
||||
|
||||
- (void)mouseMoved:(NSEvent *)event
|
||||
{
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
_glfwInputCursorMotion(window, [event deltaX], [event deltaY]);
|
||||
else
|
||||
{
|
||||
@@ -1020,7 +1020,7 @@ void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
||||
[window->ns.object invalidateCursorRectsForView:window->ns.view];
|
||||
}
|
||||
|
||||
if (mode == GLFW_CURSOR_CAPTURED)
|
||||
if (mode == GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
CGAssociateMouseAndMouseCursorPosition(false);
|
||||
|
||||
|
||||
+6
-6
@@ -42,7 +42,7 @@ static void setCursorMode(_GLFWwindow* window, int newMode)
|
||||
|
||||
if (newMode != GLFW_CURSOR_NORMAL &&
|
||||
newMode != GLFW_CURSOR_HIDDEN &&
|
||||
newMode != GLFW_CURSOR_CAPTURED)
|
||||
newMode != GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
_glfwInputError(GLFW_INVALID_ENUM, NULL);
|
||||
return;
|
||||
@@ -54,9 +54,9 @@ static void setCursorMode(_GLFWwindow* window, int newMode)
|
||||
|
||||
if (window == _glfw.focusedWindow)
|
||||
{
|
||||
if (oldMode == GLFW_CURSOR_CAPTURED)
|
||||
if (oldMode == GLFW_CURSOR_DISABLED)
|
||||
_glfwPlatformSetCursorPos(window, _glfw.cursorPosX, _glfw.cursorPosY);
|
||||
else if (newMode == GLFW_CURSOR_CAPTURED)
|
||||
else if (newMode == GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
int width, height;
|
||||
|
||||
@@ -179,7 +179,7 @@ void _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods)
|
||||
|
||||
void _glfwInputCursorMotion(_GLFWwindow* window, double x, double y)
|
||||
{
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
if (x == 0.0 && y == 0.0)
|
||||
return;
|
||||
@@ -333,8 +333,8 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow* handle, double xpos, double ypos)
|
||||
window->cursorPosX = xpos;
|
||||
window->cursorPosY = ypos;
|
||||
|
||||
// Do not move physical cursor in locked cursor mode
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
// Do not move physical cursor if it is disabled
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
return;
|
||||
|
||||
// Update physical cursor position
|
||||
|
||||
+6
-6
@@ -412,7 +412,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
||||
{
|
||||
// The window was focused
|
||||
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
captureCursor(window);
|
||||
else if (window->cursorMode == GLFW_CURSOR_HIDDEN)
|
||||
hideCursor(window);
|
||||
@@ -579,7 +579,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
||||
{
|
||||
double x, y;
|
||||
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
if (_glfw.focusedWindow != window)
|
||||
return 0;
|
||||
@@ -638,7 +638,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
||||
|
||||
case WM_SIZE:
|
||||
{
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
updateClipRect(window);
|
||||
|
||||
_glfwInputWindowSize(window, LOWORD(lParam), HIWORD(lParam));
|
||||
@@ -647,7 +647,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
||||
|
||||
case WM_MOVE:
|
||||
{
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
updateClipRect(window);
|
||||
|
||||
_glfwInputWindowPos(window, LOWORD(lParam), HIWORD(lParam));
|
||||
@@ -1071,7 +1071,7 @@ void _glfwPlatformPollEvents(void)
|
||||
}
|
||||
|
||||
// Did the cursor move in an focused window that has captured the cursor
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED &&
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED &&
|
||||
!window->win32.cursorCentered)
|
||||
{
|
||||
int width, height;
|
||||
@@ -1109,7 +1109,7 @@ void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
||||
case GLFW_CURSOR_HIDDEN:
|
||||
hideCursor(window);
|
||||
break;
|
||||
case GLFW_CURSOR_CAPTURED:
|
||||
case GLFW_CURSOR_DISABLED:
|
||||
captureCursor(window);
|
||||
break;
|
||||
}
|
||||
|
||||
+6
-6
@@ -626,7 +626,7 @@ static void processEvent(XEvent *event)
|
||||
|
||||
int x, y;
|
||||
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
if (_glfw.focusedWindow != window)
|
||||
break;
|
||||
@@ -705,7 +705,7 @@ static void processEvent(XEvent *event)
|
||||
{
|
||||
_glfwInputWindowFocus(window, GL_TRUE);
|
||||
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
captureCursor(window);
|
||||
|
||||
break;
|
||||
@@ -715,7 +715,7 @@ static void processEvent(XEvent *event)
|
||||
{
|
||||
_glfwInputWindowFocus(window, GL_FALSE);
|
||||
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
showCursor(window);
|
||||
|
||||
break;
|
||||
@@ -788,7 +788,7 @@ static void processEvent(XEvent *event)
|
||||
|
||||
double x, y;
|
||||
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
if (_glfw.focusedWindow != window)
|
||||
break;
|
||||
@@ -1092,7 +1092,7 @@ void _glfwPlatformPollEvents(void)
|
||||
window = _glfw.focusedWindow;
|
||||
if (window)
|
||||
{
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
int width, height;
|
||||
_glfwPlatformGetWindowSize(window, &width, &height);
|
||||
@@ -1148,7 +1148,7 @@ void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
||||
case GLFW_CURSOR_HIDDEN:
|
||||
hideCursor(window);
|
||||
break;
|
||||
case GLFW_CURSOR_CAPTURED:
|
||||
case GLFW_CURSOR_DISABLED:
|
||||
captureCursor(window);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user