Made window-related callbacks per-window.

This makes polymorphic behaviour easier to implement and avoids the problem of
events being triggered before the GLFW window object is fully usable.
This commit is contained in:
Camilla Berglund
2012-10-28 13:45:11 +01:00
parent d68acb78bf
commit 18d71c2b6d
23 changed files with 164 additions and 142 deletions

View File

@@ -601,8 +601,8 @@ int main(int argc, char** argv)
}
/* Register events callback */
glfwSetWindowCloseCallback(window_close_callback);
glfwSetKeyCallback(key_callback);
glfwSetWindowCloseCallback(window, window_close_callback);
glfwSetKeyCallback(window, key_callback);
glfwMakeContextCurrent(window);
if (GL_TRUE != init_opengl())