From c4b73750b762858e6a59ff50bfac755d03b6ba9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 14 Sep 2017 16:34:58 +0200 Subject: [PATCH] Cleanup Related to #1012. --- src/window.c | 1 - tests/events.c | 42 +++++++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/window.c b/src/window.c index 047b3e05..da408733 100644 --- a/src/window.c +++ b/src/window.c @@ -959,7 +959,6 @@ GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* handle GLFWAPI double glfwGetEventTime(void) { _GLFW_REQUIRE_INIT_OR_RETURN(0.0); - return _glfwPlatformGetEventTime(); } diff --git a/tests/events.c b/tests/events.c index 7d3ce245..e29914a0 100644 --- a/tests/events.c +++ b/tests/events.c @@ -269,8 +269,8 @@ static void error_callback(int error, const char* description) static void window_pos_callback(GLFWwindow* window, int x, int y) { Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f (event time: %0.3f): Window position: %i %i\n", - counter++, slot->number, glfwGetTime(), glfwGetEventTime(), x, y); + printf("%08x to %i at %0.3f: Window position: %i %i\n", + counter++, slot->number, glfwGetTime(), x, y); } static void window_size_callback(GLFWwindow* window, int width, int height) @@ -336,33 +336,35 @@ static void window_maximize_callback(GLFWwindow* window, int maximized) static void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) { Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f (event time: %0.3f): Mouse button %i (%s) (with%s) was %s\n", - counter++, slot->number, glfwGetTime(), glfwGetEventTime(), button, + printf("%08x to %i at %0.3f: Mouse button %i (%s) (with%s) was %s at %0.3f\n", + counter++, slot->number, glfwGetTime(), button, get_button_name(button), get_mods_name(mods), - get_action_name(action)); + get_action_name(action), + glfwGetEventTime()); } static void cursor_position_callback(GLFWwindow* window, double x, double y) { Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f (event time: %0.3f): Cursor position: %f %f\n", - counter++, slot->number, glfwGetTime(), glfwGetEventTime(), x, y); + printf("%08x to %i at %0.3f: Cursor position: %f %f at %0.3f\n", + counter++, slot->number, glfwGetTime(), x, y, glfwGetEventTime()); } static void cursor_enter_callback(GLFWwindow* window, int entered) { Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Cursor %s window\n", + printf("%08x to %i at %0.3f: Cursor %s window at %0.3f\n", counter++, slot->number, glfwGetTime(), - entered ? "entered" : "left"); + entered ? "entered" : "left", + glfwGetEventTime()); } static void scroll_callback(GLFWwindow* window, double x, double y) { Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Scroll: %0.3f %0.3f\n", - counter++, slot->number, glfwGetTime(), x, y); + printf("%08x to %i at %0.3f: Scroll: %0.3f %0.3f at %0.3f\n", + counter++, slot->number, glfwGetTime(), x, y, glfwGetEventTime()); } static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) @@ -372,20 +374,22 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action, if (name) { - printf("%08x to %i at %0.3f (event time: %0.3f): Key 0x%04x Scancode 0x%04x (%s) (%s) (with%s) was %s\n", - counter++, slot->number, glfwGetTime(), glfwGetEventTime(), key, scancode, + printf("%08x to %i at %0.3f: Key 0x%04x Scancode 0x%04x (%s) (%s) (with%s) was %s at %0.3f\n", + counter++, slot->number, glfwGetTime(), key, scancode, get_key_name(key), name, get_mods_name(mods), - get_action_name(action)); + get_action_name(action), + glfwGetEventTime()); } else { - printf("%08x to %i at %0.3f (event time: %0.3f): Key 0x%04x Scancode 0x%04x (%s) (with%s) was %s\n", - counter++, slot->number, glfwGetTime(), glfwGetEventTime(), key, scancode, + printf("%08x to %i at %0.3f: Key 0x%04x Scancode 0x%04x (%s) (with%s) was %s at %0.3f\n", + counter++, slot->number, glfwGetTime(), key, scancode, get_key_name(key), get_mods_name(mods), - get_action_name(action)); + get_action_name(action), + glfwGetEventTime()); } if (action != GLFW_PRESS) @@ -406,8 +410,8 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action, static void char_callback(GLFWwindow* window, unsigned int codepoint) { Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f (event time: %0.3f): Character 0x%08x (%s) input\n", - counter++, slot->number, glfwGetTime(), glfwGetEventTime(), codepoint, + printf("%08x to %i at %0.3f: Character 0x%08x (%s) input\n", + counter++, slot->number, glfwGetTime(), codepoint, get_character_string(codepoint)); }