mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 04:54:35 +00:00
Moved callback setting to before window creation.
This commit is contained in:
parent
e0ba9e4e1f
commit
3a755b99d0
@ -339,6 +339,17 @@ int main(void)
|
||||
|
||||
printf("Library initialized\n");
|
||||
|
||||
glfwSetWindowSizeCallback(window_size_callback);
|
||||
glfwSetWindowCloseCallback(window_close_callback);
|
||||
glfwSetWindowRefreshCallback(window_refresh_callback);
|
||||
glfwSetWindowFocusCallback(window_focus_callback);
|
||||
glfwSetWindowIconifyCallback(window_iconify_callback);
|
||||
glfwSetMouseButtonCallback(mouse_button_callback);
|
||||
glfwSetMousePosCallback(mouse_position_callback);
|
||||
glfwSetScrollCallback(scroll_callback);
|
||||
glfwSetKeyCallback(key_callback);
|
||||
glfwSetCharCallback(char_callback);
|
||||
|
||||
window = glfwOpenWindow(0, 0, GLFW_WINDOWED, "Event Linter", NULL);
|
||||
if (!window)
|
||||
{
|
||||
@ -352,17 +363,6 @@ int main(void)
|
||||
|
||||
glfwSwapInterval(1);
|
||||
|
||||
glfwSetWindowSizeCallback(window_size_callback);
|
||||
glfwSetWindowCloseCallback(window_close_callback);
|
||||
glfwSetWindowRefreshCallback(window_refresh_callback);
|
||||
glfwSetWindowFocusCallback(window_focus_callback);
|
||||
glfwSetWindowIconifyCallback(window_iconify_callback);
|
||||
glfwSetMouseButtonCallback(mouse_button_callback);
|
||||
glfwSetMousePosCallback(mouse_position_callback);
|
||||
glfwSetScrollCallback(scroll_callback);
|
||||
glfwSetKeyCallback(key_callback);
|
||||
glfwSetCharCallback(char_callback);
|
||||
|
||||
printf("Key repeat should be %s\n", keyrepeat ? "enabled" : "disabled");
|
||||
printf("System keys should be %s\n", systemkeys ? "enabled" : "disabled");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user