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 `glfwSetWindowAttrib` function for changing window attributes (#537)
- Added headless [OSMesa](http://mesa3d.org/osmesa.html) backend (#281,#850) - Added headless [OSMesa](http://mesa3d.org/osmesa.html) backend (#281,#850)
- Added definition of `GLAPIENTRY` to public header - 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_RETINA_FRAMEBUFFER` window hint
- Added macOS specific `GLFW_COCOA_FRAME_AUTOSAVE` window hint (#195) - Added macOS specific `GLFW_COCOA_FRAME_AUTOSAVE` window hint (#195)
- Added `GLFW_INCLUDE_ES32` for including the OpenGL ES 3.2 header - 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) - [Cocoa] Bugfix: Windows created after the first were not cascaded (#195)
- [EGL] Added support for `EGL_KHR_get_all_proc_addresses` (#871) - [EGL] Added support for `EGL_KHR_get_all_proc_addresses` (#871)
- [EGL] Bugfix: The test for `EGL_RGB_BUFFER` was invalid - [EGL] Bugfix: The test for `EGL_RGB_BUFFER` was invalid
- Added 'GLFW_CENTER_CURSOR' window hint for controlling cursor centering
## Contact ## Contact
@ -247,6 +248,7 @@ skills.
- Bryce Mehring - Bryce Mehring
- Jonathan Mercier - Jonathan Mercier
- Marcel Metz - Marcel Metz
- Liam Middlebrook
- Jonathan Miller - Jonathan Miller
- Kenneth Miller - Kenneth Miller
- Bruce Mitchener - Bruce Mitchener
@ -308,7 +310,6 @@ skills.
- Santi Zupancic - Santi Zupancic
- Jonas Ådahl - Jonas Ådahl
- Lasse Öörni - Lasse Öörni
- Liam Middlebrook
- All the unmentioned and anonymous contributors in the GLFW community, for bug - All the unmentioned and anonymous contributors in the GLFW community, for bug
reports, patches, feedback, testing and encouragement 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. 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 @subsection news_33_moltenvk Support for Vulkan on macOS via MoltenVK
GLFW now supports the `VK_MVK_macos_surface` window surface creation extension 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 __GLFW_MAXIMIZED__ specifies whether the windowed mode window will be maximized
when created. This hint is ignored for full screen windows. 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 @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 __GLFW_VISIBLE__ indicates whether the specified window is visible. See @ref
window_hide for details. 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 @anchor GLFW_RESIZABLE_attrib
__GLFW_RESIZABLE__ indicates whether the specified window is resizable _by the __GLFW_RESIZABLE__ indicates whether the specified window is resizable _by the
user_. This can be set before creation with the user_. This can be set before creation with the

View File

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

View File

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

View File

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