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
+3 -3
View File
@@ -93,9 +93,6 @@ int main(int argc, char** argv)
else
printf("Requesting that FSAA not be available\n");
glfwSetKeyCallback(key_callback);
glfwSetWindowSizeCallback(window_size_callback);
glfwWindowHint(GLFW_FSAA_SAMPLES, samples);
window = glfwCreateWindow(800, 400, GLFW_WINDOWED, "Aliasing Detector", NULL);
@@ -107,6 +104,9 @@ int main(int argc, char** argv)
exit(EXIT_FAILURE);
}
glfwSetKeyCallback(window, key_callback);
glfwSetWindowSizeCallback(window, window_size_callback);
glfwMakeContextCurrent(window);
glfwSwapInterval(1);