mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 16:52:57 +00:00
Merged cursor enter/leave callbacks.
This commit is contained in:
+5
-8
@@ -274,14 +274,12 @@ static void mouse_position_callback(GLFWwindow window, int x, int y)
|
||||
printf("%08x at %0.3f: Mouse position: %i %i\n", counter++, glfwGetTime(), x, y);
|
||||
}
|
||||
|
||||
static void cursor_enter_callback(GLFWwindow window)
|
||||
static void cursor_enter_callback(GLFWwindow window, int entered)
|
||||
{
|
||||
printf("%08x at %0.3f: Cursor entered window\n", counter++, glfwGetTime());
|
||||
}
|
||||
|
||||
static void cursor_leave_callback(GLFWwindow window)
|
||||
{
|
||||
printf("%08x at %0.3f: Cursor left window\n", counter++, glfwGetTime());
|
||||
printf("%08x at %0.3f: Cursor %s window\n",
|
||||
counter++,
|
||||
glfwGetTime(),
|
||||
entered ? "entered" : "left");
|
||||
}
|
||||
|
||||
static void scroll_callback(GLFWwindow window, int x, int y)
|
||||
@@ -362,7 +360,6 @@ int main(void)
|
||||
glfwSetMouseButtonCallback(mouse_button_callback);
|
||||
glfwSetMousePosCallback(mouse_position_callback);
|
||||
glfwSetCursorEnterCallback(cursor_enter_callback);
|
||||
glfwSetCursorLeaveCallback(cursor_leave_callback);
|
||||
glfwSetScrollCallback(scroll_callback);
|
||||
glfwSetKeyCallback(key_callback);
|
||||
glfwSetCharCallback(char_callback);
|
||||
|
||||
Reference in New Issue
Block a user