Add GLFW_HOVERED for polling cursor hover state

This window attribute corresponds to the cursor enter/leave callback.

Fixes #1166.
This commit is contained in:
Camilla Löwy
2018-01-04 13:50:58 +01:00
parent 370eac3c48
commit ee9dffcd66
14 changed files with 83 additions and 0 deletions

View File

@@ -419,6 +419,16 @@ void cursor_enter_callback(GLFWwindow* window, int entered)
}
@endcode
You can query whether the cursor is currently inside the client area of the
window with the [GLFW_HOVERED](@ref GLFW_HOVERED_attrib) window attribute.
@code
if (glfwGetWindowAttrib(window, GLFW_HOVERED))
{
highlight_interface();
}
@endcode
@subsection input_mouse_button Mouse button input

View File

@@ -1220,6 +1220,11 @@ See @ref window_iconify for details.
__GLFW_MAXIMIZED__ indicates whether the specified window is maximized. See
@ref window_maximize for details.
@anchor GLFW_HOVERED_attrib
__GLFW_HOVERED__ indicates whether the cursor is currently directly over the
client area of the window, with no other windows between. See @ref cursor_enter
for details.
@anchor GLFW_VISIBLE_attrib
__GLFW_VISIBLE__ indicates whether the specified window is visible. See @ref
window_hide for details.