X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_window.c;h=bf9d58f6834bc2038d6f507195f8f86c732e0ee8;hb=8997e09b1ce75c5d05405ed0c51e32436cac45ed;hp=21b3006336e0de96447df0cdd9a22945f8d1b233;hpb=1a7b5b7702bcc093a613b02be7af4720f2618c79;p=freeglut diff --git a/src/freeglut_window.c b/src/freeglut_window.c index 21b3006..bf9d58f 100644 --- a/src/freeglut_window.c +++ b/src/freeglut_window.c @@ -306,6 +306,8 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly, unsigned void fgSetWindow ( SFG_Window *window ) { #if TARGET_HOST_UNIX_X11 + if ( window ) + { /* * Make the selected window's GLX context the current one */ @@ -314,7 +316,7 @@ void fgSetWindow ( SFG_Window *window ) window->Window.Handle, window->Window.Context ); - + } #elif TARGET_HOST_WIN32 /* * Release the previous' context's device context @@ -395,6 +397,10 @@ void fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, i */ fgState.DisplayMode |= GLUT_DOUBLE ; window->Window.VisualInfo = fgChooseVisual(); + /* OK, we got a double-buffered window, but we only wanted + * single-buffered. Clear the double-buffer flag now. + */ + fgState.DisplayMode &= ~GLUT_DOUBLE ; } /* @@ -1207,15 +1213,46 @@ void FGAPIENTRY glutFullScreen( void ) { freeglut_assert_ready; freeglut_assert_window; - /* - * Just have the window repositioned and resized - */ - glutPositionWindow( 0, 0 ); +#if TARGET_HOST_UNIX_X11 + { + int x, y; + Window w; + + XMoveResizeWindow( + fgDisplay.Display, + fgStructure.Window->Window.Handle, + 0, 0, + fgDisplay.ScreenWidth, + fgDisplay.ScreenHeight + ); + XFlush( fgDisplay.Display ); - glutReshapeWindow( + XTranslateCoordinates( + fgDisplay.Display, + fgStructure.Window->Window.Handle, + fgDisplay.RootWindow, + 0, 0, &x, &y, &w + ); + + if (x || y) + { + XMoveWindow( + fgDisplay.Display, + fgStructure.Window->Window.Handle, + -x, -y + ); + XFlush( fgDisplay.Display ); + } + } +#elif TARGET_HOST_WIN32 + MoveWindow( + fgStructure.Window->Window.Handle, + 0, 0, fgDisplay.ScreenWidth, - fgDisplay.ScreenHeight + fgDisplay.ScreenHeight, + TRUE ); +#endif } /* @@ -1232,12 +1269,3 @@ void FGAPIENTRY glutSetWindowData(void* data) } /*** END OF FILE ***/ - - - - - - - - -