From 11587f1dde8920db5fd7826cb459f5d548a70007 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 23 Apr 2014 16:47:09 +0200 Subject: [PATCH] Added position testing to windows test. --- tests/windows.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/windows.c b/tests/windows.c index 89c7328c..7fcb70e8 100644 --- a/tests/windows.c +++ b/tests/windows.c @@ -45,6 +45,16 @@ static void error_callback(int error, const char* description) fprintf(stderr, "Error: %s\n", description); } +static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) +{ + if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) + { + int xpos, ypos; + glfwGetWindowPos(window, &xpos, &ypos); + glfwSetWindowPos(window, xpos, ypos); + } +} + int main(void) { int i; @@ -69,6 +79,8 @@ int main(void) exit(EXIT_FAILURE); } + glfwSetKeyCallback(windows[i], key_callback); + glfwMakeContextCurrent(windows[i]); glClearColor((GLclampf) (i & 1), (GLclampf) (i >> 1),