From ce87a1142e09ab202bf5e53477bce26fb635f8b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Fri, 4 Aug 2017 02:35:13 +0200 Subject: [PATCH] Move glfwDragWindow demo to windows test --- examples/simple.c | 7 ------- tests/windows.c | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/simple.c b/examples/simple.c index 692fa5b3..7752a365 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -68,12 +68,6 @@ static void error_callback(int error, const char* description) fprintf(stderr, "Error: %s\n", description); } -void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) -{ - if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_PRESS) - glfwDragWindow(window); -} - static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) { if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) @@ -102,7 +96,6 @@ int main(void) } glfwSetKeyCallback(window, key_callback); - glfwSetMouseButtonCallback(window, mouse_button_callback); glfwMakeContextCurrent(window); gladLoadGLLoader((GLADloadproc) glfwGetProcAddress); diff --git a/tests/windows.c b/tests/windows.c index 1c129739..0b94976b 100644 --- a/tests/windows.c +++ b/tests/windows.c @@ -88,6 +88,12 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action, } } +void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) +{ + if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_PRESS) + glfwDragWindow(window); +} + int main(int argc, char** argv) { int i, ch; @@ -131,6 +137,7 @@ int main(int argc, char** argv) } glfwSetKeyCallback(windows[i], key_callback); + glfwSetMouseButtonCallback(windows[i], mouse_button_callback); glfwMakeContextCurrent(windows[i]); gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);