From 2badda80f21aaceb769a75861b52642e276e2e80 Mon Sep 17 00:00:00 2001 From: "John F. Fay" Date: Sun, 4 Sep 2011 19:58:20 +0000 Subject: [PATCH] Fixing the build after Diederick Niehorster's full screen fixes: they are only valid for WINVER >= 0x0500. git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@930 7f0cb862-5218-0410-a997-914c9d46530a --- src/freeglut_window.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/freeglut_window.c b/src/freeglut_window.c index 897b03c..d287a8b 100644 --- a/src/freeglut_window.c +++ b/src/freeglut_window.c @@ -2000,6 +2000,7 @@ void FGAPIENTRY glutFullScreen( void ) } { +#if(WINVER >= 0x0500) DWORD s; RECT rect; HMONITOR hMonitor; @@ -2031,6 +2032,23 @@ void FGAPIENTRY glutFullScreen( void ) mi.cbSize = sizeof(mi); GetMonitorInfo(hMonitor, &mi); rect = mi.rcMonitor; +#else /* if (WINVER >= 0x0500) */ + RECT rect; + + /* For fullscreen mode, force the top-left corner to 0,0 + * and adjust the window rectangle so that the client area + * covers the whole screen. + */ + + rect.left = 0; + rect.top = 0; + get_display_origin(&rect.left,&rect.top); + rect.right = fgDisplay.ScreenWidth+rect.left; + rect.bottom = fgDisplay.ScreenHeight+rect.top; + + AdjustWindowRect ( &rect, WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | + WS_CLIPCHILDREN, FALSE ); +#endif /* (WINVER >= 0x0500) */ /* * then resize window @@ -2048,7 +2066,7 @@ void FGAPIENTRY glutFullScreen( void ) SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSENDCHANGING | SWP_NOZORDER ); - + win->State.IsFullscreen = GL_TRUE; } #endif -- 1.7.10.4