X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_window.c;h=159b3018a0d972d12cb97877f5f3a738b49b8863;hb=f774a7299ff2cc23a1608267cdfc70bfb41930fd;hp=c12075ea6aae2c5f0627c27bce58947438eb38c4;hpb=c54a483697f5b6418432bc7610ce27115a9ca02b;p=freeglut diff --git a/src/freeglut_window.c b/src/freeglut_window.c index c12075e..159b301 100644 --- a/src/freeglut_window.c +++ b/src/freeglut_window.c @@ -128,19 +128,20 @@ GLXFBConfig* fgChooseFBConfig( void ) ATTRIB_VAL( GLX_ACCUM_ALPHA_SIZE, 1 ); } - if( fgState.DisplayMode & GLUT_AUX1 ) - ATTRIB_VAL( GLX_AUX_BUFFERS, 1 ); - if( fgState.DisplayMode & GLUT_AUX2 ) - ATTRIB_VAL( GLX_AUX_BUFFERS, 2 ); - if( fgState.DisplayMode & GLUT_AUX3 ) - ATTRIB_VAL( GLX_AUX_BUFFERS, 3 ); - if( fgState.DisplayMode & GLUT_AUX4 ) - ATTRIB_VAL( GLX_AUX_BUFFERS, 4 ); - if ( fgState.DisplayMode & GLUT_MULTISAMPLE ) - { - ATTRIB_VAL( GLX_SAMPLE_BUFFERS, 1 ); - } - + if ((fgState.DisplayMode & GLUT_AUX) + || (fgState.DisplayMode & GLUT_AUX1) + || (fgState.DisplayMode & GLUT_AUX2) + || (fgState.DisplayMode & GLUT_AUX3) + || (fgState.DisplayMode & GLUT_AUX4)) + { + ATTRIB_VAL(GLX_AUX_BUFFERS, fgState.AuxiliaryBufferNumber) + } + + if (fgState.DisplayMode & GLUT_MULTISAMPLE) + { + ATTRIB_VAL(GLX_SAMPLE_BUFFERS, 1) + ATTRIB_VAL(GLX_SAMPLES, fgState.SampleNumber) + } /* Push a null at the end of the list */ ATTRIB( None ); @@ -896,7 +897,7 @@ void fgCloseWindow( SFG_Window* window ) glXDestroyContext( fgDisplay.Display, window->Window.Context ); XFree( window->Window.FBConfig ); XDestroyWindow( fgDisplay.Display, window->Window.Handle ); - XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */ + /* XFlush( fgDisplay.Display ); */ /* XXX Shouldn't need this */ #elif TARGET_HOST_MS_WINDOWS @@ -1314,35 +1315,24 @@ void FGAPIENTRY glutFullScreen( void ) { #if TARGET_HOST_POSIX_X11 - int x, y; - Window w; - - XMoveResizeWindow( - fgDisplay.Display, - fgStructure.CurrentWindow->Window.Handle, - 0, 0, - fgDisplay.ScreenWidth, - fgDisplay.ScreenHeight - ); - XFlush( fgDisplay.Display ); /* This is needed */ + Status status; /* Returned by XGetWindowAttributes(), not checked. */ + XWindowAttributes attributes; - XTranslateCoordinates( - fgDisplay.Display, - fgStructure.CurrentWindow->Window.Handle, - fgDisplay.RootWindow, - 0, 0, &x, &y, &w - ); + status = XGetWindowAttributes(fgDisplay.Display, + fgStructure.CurrentWindow->Window.Handle, + &attributes); + /* + * The "x" and "y" members of "attributes" are the window's coordinates + * relative to its parent, i.e. to the decoration window. + */ + XMoveResizeWindow(fgDisplay.Display, + fgStructure.CurrentWindow->Window.Handle, + -attributes.x, + -attributes.y, + fgDisplay.ScreenWidth, + fgDisplay.ScreenHeight); - if (x || y) - { - XMoveWindow( - fgDisplay.Display, - fgStructure.CurrentWindow->Window.Handle, - -x, -y - ); - XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */ - } #elif TARGET_HOST_MS_WINDOWS && !defined(_WIN32_WCE) /* FIXME: what about WinCE */ RECT rect;