X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmswin%2Ffg_state_mswin.c;h=27a94616b1f7c7bbbf4852af12065864e57f3867;hb=77ee35c8d522dddac4e2c88e8de166491d4d762c;hp=c293ebffb36b4bc542d55ce7859ebbf78c7cbda8;hpb=0ae4baa1e5b17572ebad1b9e9a9b32000fc8dd4b;p=freeglut diff --git a/src/mswin/fg_state_mswin.c b/src/mswin/fg_state_mswin.c index c293ebf..27a9461 100644 --- a/src/mswin/fg_state_mswin.c +++ b/src/mswin/fg_state_mswin.c @@ -141,10 +141,20 @@ int fgPlatformGlutGet ( GLenum eWhat ) return returnValue; case GLUT_WINDOW_BUFFER_SIZE: - returnValue = 1 ; /* TODO????? */ - return returnValue; + { + PIXELFORMATDESCRIPTOR pfd; + HDC hdc = fgStructure.CurrentWindow->Window.pContext.Device; + int iPixelFormat = GetPixelFormat( hdc ); + DescribePixelFormat(hdc, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd); + + returnValue = pfd.cColorBits; + if (pfd.iPixelType==PFD_TYPE_RGBA) + returnValue += pfd.cAlphaBits; + + return returnValue; + } case GLUT_WINDOW_STENCIL_SIZE: - returnValue = 0 ; /* TODO????? */ + glGetIntegerv ( GL_STENCIL_BITS, &returnValue ); return returnValue; case GLUT_WINDOW_X: @@ -177,6 +187,7 @@ 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);