);
/*
+ * Describe pixel format
+ */
+ printf("The current window has %i red bits, %i green bits, %i blue bits and %i alpha bits for a total buffer size of %i bits\n",glutGet(GLUT_WINDOW_RED_SIZE),glutGet(GLUT_WINDOW_GREEN_SIZE),glutGet(GLUT_WINDOW_BLUE_SIZE),glutGet(GLUT_WINDOW_ALPHA_SIZE),glutGet(GLUT_WINDOW_BUFFER_SIZE));
+ printf("It furthermore has %i depth bits and %i stencil bits\n",glutGet(GLUT_WINDOW_DEPTH_SIZE),glutGet(GLUT_WINDOW_STENCIL_SIZE));
+
+ /*
* Enter the main FreeGLUT processing loop
*/
glutMainLoop();
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: