Moved glfwinfo version check to before glfwInit.

This commit is contained in:
Camilla Berglund 2012-08-28 22:56:35 +02:00
parent 54fceaaf64
commit f50d38f148

View File

@ -181,6 +181,28 @@ int main(int argc, char** argv)
argc -= optind; argc -= optind;
argv += optind; argv += optind;
// Report GLFW version
glfwGetVersion(&major, &minor, &revision);
printf("GLFW header version: %u.%u.%u\n",
GLFW_VERSION_MAJOR,
GLFW_VERSION_MINOR,
GLFW_VERSION_REVISION);
printf("GLFW library version: %u.%u.%u\n", major, minor, revision);
if (major != GLFW_VERSION_MAJOR ||
minor != GLFW_VERSION_MINOR ||
revision != GLFW_VERSION_REVISION)
{
printf("*** WARNING: GLFW version mismatch! ***\n");
}
printf("GLFW library version string: \"%s\"\n", glfwGetVersionString());
// Initialize GLFW and create window
glfwSetErrorCallback(error_callback); glfwSetErrorCallback(error_callback);
if (!glfwInit()) if (!glfwInit())
@ -216,26 +238,6 @@ int main(int argc, char** argv)
glfwMakeContextCurrent(window); glfwMakeContextCurrent(window);
// Report GLFW version
glfwGetVersion(&major, &minor, &revision);
printf("GLFW header version: %u.%u.%u\n",
GLFW_VERSION_MAJOR,
GLFW_VERSION_MINOR,
GLFW_VERSION_REVISION);
printf("GLFW library version: %u.%u.%u\n", major, minor, revision);
if (major != GLFW_VERSION_MAJOR ||
minor != GLFW_VERSION_MINOR ||
revision != GLFW_VERSION_REVISION)
{
printf("*** WARNING: GLFW version mismatch! ***\n");
}
printf("GLFW library version string: \"%s\"\n", glfwGetVersionString());
// Report OpenGL version // Report OpenGL version
printf("OpenGL context version string: \"%s\"\n", glGetString(GL_VERSION)); printf("OpenGL context version string: \"%s\"\n", glGetString(GL_VERSION));