2009-03-16 Sven Panne <sven.panne@aedion.de>
+ * src/freeglut_init.c,src/freeglut_window.c: Set the default number of
+ samples per pixel to 4 and actually use the value set with
+ glutSetOption(GLUT_MULTISAMPLE,...) in Windows code. Previously the
+ Windows code used a hardwired value of 4 and the GLX code had a
+ default of 0, neither made much sense. Similarly, set the default
+ number of auxiliary buffers to 1 and use that value when GLUT_AUX is
+ used. Note: There latter token has the same value as GLUT_AUX1, and
+ for historical reasons we seem to have 2 APIs to set the number of
+ auxiliary buffers: Explicitly using GLUT_AUX1 ... GLUT_AUX4, and using
+ a combination of GLUT_AUX with glutSetOption. The default of 1 ensures
+ consistent behaviour in both cases.
* src/freeglut_state.c: Added GLUT_AUX and GLUT_MULTISAMPLE as possible
parameters for glutGet, making things more symmetric with
glutSetOption.
NULL, /* ProgramName */
GL_FALSE, /* JoysticksInitialised */
GL_FALSE, /* InputDevsInitialised */
- 0, /* AuxiliaryBufferNumber */
- 0, /* SampleNumber */
+ 1, /* AuxiliaryBufferNumber */
+ 4, /* SampleNumber */
1, /* MajorVersion */
0, /* MajorVersion */
0 /* ContextFlags */
ATTRIB_VAL( GLX_ACCUM_ALPHA_SIZE, 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_AUX4 )
+ {
+ ATTRIB_VAL(GLX_AUX_BUFFERS, 4);
+ }
+ else if( fgState.DisplayMode & GLUT_AUX3 )
+ {
+ ATTRIB_VAL(GLX_AUX_BUFFERS, 3);
+ }
+ else if( fgState.DisplayMode & GLUT_AUX2 )
+ {
+ ATTRIB_VAL(GLX_AUX_BUFFERS, 2);
+ }
+ else if( fgState.DisplayMode & GLUT_AUX1 ) /* NOTE: Same as GLUT_AUX! */
+ {
+ ATTRIB_VAL(GLX_AUX_BUFFERS, fgState.AuxiliaryBufferNumber);
+ }
if (fgState.DisplayMode & GLUT_MULTISAMPLE)
{
pfd.cAuxBuffers = 3;
else if( fgState.DisplayMode & GLUT_AUX2 )
pfd.cAuxBuffers = 2;
- else if( fgState.DisplayMode & GLUT_AUX1 )
- pfd.cAuxBuffers = 1;
+ else if( fgState.DisplayMode & GLUT_AUX1 ) /* NOTE: Same as GLUT_AUX! */
+ pfd.cAuxBuffers = fgState.AuxiliaryBufferNumber;
else
pfd.cAuxBuffers = 0;
pAttributes[iCounter++]=WGL_DOUBLE_BUFFER_ARB; pAttributes[iCounter++]=(fgState.DisplayMode & GLUT_DOUBLE)!=0;
pAttributes[iCounter++]=WGL_SAMPLE_BUFFERS_ARB; pAttributes[iCounter++]=GL_TRUE;
- pAttributes[iCounter++]=WGL_SAMPLES_ARB; pAttributes[iCounter++]=4;
+ pAttributes[iCounter++]=WGL_SAMPLES_ARB; pAttributes[iCounter++]=fgState.SampleNumber;
pAttributes[iCounter++]=0; pAttributes[iCounter++]=0; /* terminator */
bValid = wglChoosePixelFormatARBProc(window->Window.Device,pAttributes,fAttributes,1,&iPixelFormat,&numFormats);