From 0ae4baa1e5b17572ebad1b9e9a9b32000fc8dd4b Mon Sep 17 00:00:00 2001 From: Diederick Niehorster Date: Fri, 23 Nov 2012 09:42:54 +0000 Subject: [PATCH] that was too quick, fgStructure.CurrentWindow can be NULL when glutGetting window width or height git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1485 7f0cb862-5218-0410-a997-914c9d46530a --- src/mswin/fg_state_mswin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mswin/fg_state_mswin.c b/src/mswin/fg_state_mswin.c index 5dc859c..c293ebf 100644 --- a/src/mswin/fg_state_mswin.c +++ b/src/mswin/fg_state_mswin.c @@ -177,7 +177,6 @@ int fgPlatformGlutGet ( GLenum eWhat ) RECT winRect; POINT topLeft = {0,0}; - freeglut_return_val_if_fail( fgStructure.CurrentWindow != NULL, 0 ); #if defined(_WIN32_WCE) GetWindowRect( fgStructure.CurrentWindow->Window.Handle, &winRect); @@ -203,8 +202,10 @@ int fgPlatformGlutGet ( GLenum eWhat ) break; case GLUT_WINDOW_WIDTH: + freeglut_return_val_if_fail( fgStructure.CurrentWindow != NULL, 0 ); return fgStructure.CurrentWindow->State.Width; case GLUT_WINDOW_HEIGHT: + freeglut_return_val_if_fail( fgStructure.CurrentWindow != NULL, 0 ); return fgStructure.CurrentWindow->State.Height; case GLUT_WINDOW_BORDER_WIDTH : -- 1.7.10.4