mirror of
https://github.com/glfw/glfw.git
synced 2026-11-18 04:44:54 +00:00
Add GLFW_CENTER_CURSOR
Adds a hint for controlling whether the cursor is centered over newly created full screen windows. Fixes #749. Closes #842.
This commit is contained in:
committed by
Camilla Löwy
parent
3af0c47c97
commit
72ac5badb0
+2
-1
@@ -1096,7 +1096,8 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
if (!acquireMonitor(window))
|
||||
return GLFW_FALSE;
|
||||
|
||||
centerCursor(window);
|
||||
if (wndconfig->centerCursor)
|
||||
centerCursor(window);
|
||||
}
|
||||
|
||||
return GLFW_TRUE;
|
||||
|
||||
@@ -277,6 +277,7 @@ struct _GLFWwndconfig
|
||||
GLFWbool autoIconify;
|
||||
GLFWbool floating;
|
||||
GLFWbool maximized;
|
||||
GLFWbool centerCursor;
|
||||
struct {
|
||||
GLFWbool retina;
|
||||
GLFWbool frame;
|
||||
|
||||
+4
-1
@@ -1037,7 +1037,10 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
if (!acquireMonitor(window))
|
||||
return GLFW_FALSE;
|
||||
|
||||
centerCursor(window);
|
||||
if (wndconfig->centerCursor)
|
||||
{
|
||||
centerCursor(window);
|
||||
}
|
||||
}
|
||||
|
||||
return GLFW_TRUE;
|
||||
|
||||
@@ -345,6 +345,9 @@ GLFWAPI void glfwWindowHint(int hint, int value)
|
||||
case GLFW_COCOA_FRAME_AUTOSAVE:
|
||||
_glfw.hints.window.ns.frame = value ? GLFW_TRUE : GLFW_FALSE;
|
||||
break;
|
||||
case GLFW_CENTER_CURSOR:
|
||||
_glfw.hints.window.centerCursor = value ? GLFW_TRUE : GLFW_FALSE;
|
||||
break;
|
||||
case GLFW_CLIENT_API:
|
||||
_glfw.hints.context.client = value;
|
||||
break;
|
||||
|
||||
+4
-1
@@ -1597,7 +1597,10 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
if (!acquireMonitor(window))
|
||||
return GLFW_FALSE;
|
||||
|
||||
centerCursor(window);
|
||||
if(wndconfig->centerCursor)
|
||||
{
|
||||
centerCursor(window);
|
||||
}
|
||||
}
|
||||
|
||||
XFlush(_glfw.x11.display);
|
||||
|
||||
Reference in New Issue
Block a user