Moved glfwinfo version check to before glfwInit.

This commit is contained in:
Camilla Berglund 2012-08-28 22:56:35 +02:00
Родитель 54fceaaf64
Коммит f50d38f148
1 изменённых файлов: 22 добавлений и 20 удалений

Просмотреть файл

@ -181,6 +181,28 @@ int main(int argc, char** argv)
argc -= 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);
if (!glfwInit())
@ -216,26 +238,6 @@ int main(int argc, char** argv)
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
printf("OpenGL context version string: \"%s\"\n", glGetString(GL_VERSION));