Fixed invalid order of operations.
diff --git a/tests/iconify.c b/tests/iconify.c
index 964e927..2627293 100644
--- a/tests/iconify.c
+++ b/tests/iconify.c
@@ -100,6 +100,11 @@
GLFWmonitor monitor = NULL;
GLFWwindow window;
+ glfwSetErrorCallback(error_callback);
+
+ if (!glfwInit())
+ exit(EXIT_FAILURE);
+
while ((ch = getopt(argc, argv, "fh")) != -1)
{
switch (ch)
@@ -118,11 +123,6 @@
}
}
- glfwSetErrorCallback(error_callback);
-
- if (!glfwInit())
- exit(EXIT_FAILURE);
-
if (monitor)
{
GLFWvidmode mode;