1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-26 20:28:49 -05:00

Added position testing to windows test.

This commit is contained in:
Camilla Berglund 2014-04-23 16:47:09 +02:00
parent 3ce7bfef07
commit 11587f1dde

View File

@ -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),