mirror of
https://github.com/glfw/glfw.git
synced 2024-11-25 22:14:34 +00:00
Added position testing to windows test.
This commit is contained in:
parent
3ce7bfef07
commit
11587f1dde
@ -45,6 +45,16 @@ static void error_callback(int error, const char* description)
|
|||||||
fprintf(stderr, "Error: %s\n", 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 main(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -69,6 +79,8 @@ int main(void)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glfwSetKeyCallback(windows[i], key_callback);
|
||||||
|
|
||||||
glfwMakeContextCurrent(windows[i]);
|
glfwMakeContextCurrent(windows[i]);
|
||||||
glClearColor((GLclampf) (i & 1),
|
glClearColor((GLclampf) (i & 1),
|
||||||
(GLclampf) (i >> 1),
|
(GLclampf) (i >> 1),
|
||||||
|
Loading…
Reference in New Issue
Block a user