mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 00:30:57 +00:00
Removed calling of callbacks from setters.
This commit is contained in:
+8
-4
@@ -80,6 +80,7 @@ static void key_callback(GLFWwindow window, int key, int action)
|
||||
int main(void)
|
||||
{
|
||||
GLFWwindow window;
|
||||
int width, height;
|
||||
|
||||
if (!glfwInit())
|
||||
{
|
||||
@@ -87,6 +88,10 @@ int main(void)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
glfwSetCursorPosCallback(cursor_position_callback);
|
||||
glfwSetWindowSizeCallback(window_size_callback);
|
||||
glfwSetKeyCallback(key_callback);
|
||||
|
||||
window = glfwCreateWindow(window_width, window_height, GLFW_WINDOWED, "", NULL);
|
||||
if (!window)
|
||||
{
|
||||
@@ -96,11 +101,10 @@ int main(void)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
set_swap_interval(window, swap_interval);
|
||||
glfwGetWindowSize(window, &width, &height);
|
||||
window_size_callback(window, width, height);
|
||||
|
||||
glfwSetCursorPosCallback(cursor_position_callback);
|
||||
glfwSetWindowSizeCallback(window_size_callback);
|
||||
glfwSetKeyCallback(key_callback);
|
||||
set_swap_interval(window, swap_interval);
|
||||
|
||||
while (glfwGetCurrentContext())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user