Add cursor position rountrip key to cursor test
Related to #1461.
diff --git a/tests/cursor.c b/tests/cursor.c
index 0e6faea..a72c14e 100644
--- a/tests/cursor.c
+++ b/tests/cursor.c
@@ -231,6 +231,26 @@
break;
+ case GLFW_KEY_P:
+ {
+ double x, y;
+ glfwGetCursorPos(window, &x, &y);
+
+ printf("Query before set: %f %f (%+f %+f)\n",
+ x, y, x - cursor_x, y - cursor_y);
+ cursor_x = x;
+ cursor_y = y;
+
+ glfwSetCursorPos(window, cursor_x, cursor_y);
+ glfwGetCursorPos(window, &x, &y);
+
+ printf("Query after set: %f %f (%+f %+f)\n",
+ x, y, x - cursor_x, y - cursor_y);
+ cursor_x = x;
+ cursor_y = y;
+ break;
+ }
+
case GLFW_KEY_0:
glfwSetCursor(window, NULL);
break;