Related to #842.
This commit is contained in:
Camilla Löwy 2017-02-06 15:03:50 +01:00
parent 72ac5badb0
commit 5a74b5008d
8 changed files with 24 additions and 15 deletions

View File

@ -129,6 +129,8 @@ information on what to include when reporting a bug.
- Added `glfwSetWindowAttrib` function for changing window attributes (#537)
- Added headless [OSMesa](http://mesa3d.org/osmesa.html) backend (#281,#850)
- Added definition of `GLAPIENTRY` to public header
- Added `GLFW_CENTER_CURSOR` window hint for controlling cursor centering
(#749,#842)
- Added macOS specific `GLFW_COCOA_RETINA_FRAMEBUFFER` window hint
- Added macOS specific `GLFW_COCOA_FRAME_AUTOSAVE` window hint (#195)
- Added `GLFW_INCLUDE_ES32` for including the OpenGL ES 3.2 header
@ -159,7 +161,6 @@ information on what to include when reporting a bug.
- [Cocoa] Bugfix: Windows created after the first were not cascaded (#195)
- [EGL] Added support for `EGL_KHR_get_all_proc_addresses` (#871)
- [EGL] Bugfix: The test for `EGL_RGB_BUFFER` was invalid
- Added 'GLFW_CENTER_CURSOR' window hint for controlling cursor centering
## Contact
@ -247,6 +248,7 @@ skills.
- Bryce Mehring
- Jonathan Mercier
- Marcel Metz
- Liam Middlebrook
- Jonathan Miller
- Kenneth Miller
- Bruce Mitchener
@ -308,7 +310,6 @@ skills.
- Santi Zupancic
- Jonas Ådahl
- Lasse Öörni
- Liam Middlebrook
- All the unmentioned and anonymous contributors in the GLFW community, for bug
reports, patches, feedback, testing and encouragement

View File

@ -25,6 +25,13 @@ GLFW now supports changing the [GLFW_DECORATED](@ref GLFW_DECORATED_attrib),
windows with @ref glfwSetWindowAttrib.
@subsection news_33_centercursor Cursor centering window hint
GLFW now supports controlling whether the cursor is centered over newly created
full screen windows with the [GLFW_CENTER_CURSOR](@ref GLFW_CENTER_CURSOR_hint)
window hint.
@subsection news_33_moltenvk Support for Vulkan on macOS via MoltenVK
GLFW now supports the `VK_MVK_macos_surface` window surface creation extension

View File

@ -212,6 +212,11 @@ full screen windows. This hint is ignored for full screen windows.
__GLFW_MAXIMIZED__ specifies whether the windowed mode window will be maximized
when created. This hint is ignored for full screen windows.
@anchor GLFW_CENTER_CURSOR_hint
__GLFW_CENTER_CURSOR__ specifies whether the cursor should be centered over
newly created full screen windows. This hint is ignored for windowed mode
windows.
@subsubsection window_hints_fb Framebuffer related hints
@ -1042,10 +1047,6 @@ __GLFW_MAXIMIZED__ indicates whether the specified window is maximized. See
__GLFW_VISIBLE__ indicates whether the specified window is visible. See @ref
window_hide for details.
`GLFW_CENTER_CURSOR` indicates whether the cursor should be moved to the center
of the full screen window during creation. This is ignored for windowed mode
windows.
@anchor GLFW_RESIZABLE_attrib
__GLFW_RESIZABLE__ indicates whether the specified window is resizable _by the
user_. This can be set before creation with the

View File

@ -686,6 +686,10 @@ extern "C" {
* [window attribute](@ref GLFW_MAXIMIZED_attrib).
*/
#define GLFW_MAXIMIZED 0x00020008
/*! @brief Cursor centering window hint
*
* Cursor centering [window hint](@ref GLFW_CENTER_CURSOR_hint).
*/
#define GLFW_CENTER_CURSOR 0x00020009
/*! @brief Framebuffer bit depth hint.

View File

@ -1096,7 +1096,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
if (!acquireMonitor(window))
return GLFW_FALSE;
if (wndconfig->centerCursor)
if (wndconfig->centerCursor)
centerCursor(window);
}

View File

@ -1038,9 +1038,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
return GLFW_FALSE;
if (wndconfig->centerCursor)
{
centerCursor(window);
}
}
return GLFW_TRUE;

View File

@ -345,9 +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_CENTER_CURSOR:
_glfw.hints.window.centerCursor = value ? GLFW_TRUE : GLFW_FALSE;
break;
case GLFW_CLIENT_API:
_glfw.hints.context.client = value;
break;

View File

@ -1597,10 +1597,8 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
if (!acquireMonitor(window))
return GLFW_FALSE;
if(wndconfig->centerCursor)
{
if (wndconfig->centerCursor)
centerCursor(window);
}
}
XFlush(_glfw.x11.display);