From 8907019e346e0d83dc91685c3b4d7eed1efab39d Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 14 Sep 2010 00:20:42 +0200 Subject: [PATCH] Oh, right, this is C. --- src/glext.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/glext.c b/src/glext.c index 2407813f..f8f7fe03 100644 --- a/src/glext.c +++ b/src/glext.c @@ -215,20 +215,21 @@ GLFWAPI void* glfwGetProcAddress(const char* procname) GLFWAPI void glfwGetGLVersion(int* major, int* minor, int* rev) { + _GLFWwindow* window; + if (!_glfwInitialized) { _glfwSetError(GLFW_NOT_INITIALIZED); return; } - if (!_glfwLibrary.currentWindow) + window = _glfwLibrary.currentWindow; + if (!window) { _glfwSetError(GLFW_NO_CURRENT_WINDOW); return; } - _GLFWwindow* window = _glfwLibrary.currentWindow; - if (major != NULL) *major = window->glMajor;