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. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@802 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
26495e19b9
commit
7d3a0c3623
@ -1,5 +1,16 @@
|
|||||||
2009-03-16 Sven Panne <sven.panne@aedion.de>
|
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
|
* src/freeglut_state.c: Added GLUT_AUX and GLUT_MULTISAMPLE as possible
|
||||||
parameters for glutGet, making things more symmetric with
|
parameters for glutGet, making things more symmetric with
|
||||||
glutSetOption.
|
glutSetOption.
|
||||||
|
@ -84,8 +84,8 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */
|
|||||||
NULL, /* ProgramName */
|
NULL, /* ProgramName */
|
||||||
GL_FALSE, /* JoysticksInitialised */
|
GL_FALSE, /* JoysticksInitialised */
|
||||||
GL_FALSE, /* InputDevsInitialised */
|
GL_FALSE, /* InputDevsInitialised */
|
||||||
0, /* AuxiliaryBufferNumber */
|
1, /* AuxiliaryBufferNumber */
|
||||||
0, /* SampleNumber */
|
4, /* SampleNumber */
|
||||||
1, /* MajorVersion */
|
1, /* MajorVersion */
|
||||||
0, /* MajorVersion */
|
0, /* MajorVersion */
|
||||||
0 /* ContextFlags */
|
0 /* ContextFlags */
|
||||||
|
@ -132,13 +132,21 @@ GLXFBConfig* fgChooseFBConfig( void )
|
|||||||
ATTRIB_VAL( GLX_ACCUM_ALPHA_SIZE, 1 );
|
ATTRIB_VAL( GLX_ACCUM_ALPHA_SIZE, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((fgState.DisplayMode & GLUT_AUX)
|
if( fgState.DisplayMode & GLUT_AUX4 )
|
||||||
|| (fgState.DisplayMode & GLUT_AUX1)
|
|
||||||
|| (fgState.DisplayMode & GLUT_AUX2)
|
|
||||||
|| (fgState.DisplayMode & GLUT_AUX3)
|
|
||||||
|| (fgState.DisplayMode & GLUT_AUX4))
|
|
||||||
{
|
{
|
||||||
ATTRIB_VAL(GLX_AUX_BUFFERS, fgState.AuxiliaryBufferNumber)
|
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)
|
if (fgState.DisplayMode & GLUT_MULTISAMPLE)
|
||||||
@ -427,8 +435,8 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,
|
|||||||
pfd.cAuxBuffers = 3;
|
pfd.cAuxBuffers = 3;
|
||||||
else if( fgState.DisplayMode & GLUT_AUX2 )
|
else if( fgState.DisplayMode & GLUT_AUX2 )
|
||||||
pfd.cAuxBuffers = 2;
|
pfd.cAuxBuffers = 2;
|
||||||
else if( fgState.DisplayMode & GLUT_AUX1 )
|
else if( fgState.DisplayMode & GLUT_AUX1 ) /* NOTE: Same as GLUT_AUX! */
|
||||||
pfd.cAuxBuffers = 1;
|
pfd.cAuxBuffers = fgState.AuxiliaryBufferNumber;
|
||||||
else
|
else
|
||||||
pfd.cAuxBuffers = 0;
|
pfd.cAuxBuffers = 0;
|
||||||
|
|
||||||
@ -497,7 +505,7 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,
|
|||||||
|
|
||||||
pAttributes[iCounter++]=WGL_DOUBLE_BUFFER_ARB; pAttributes[iCounter++]=(fgState.DisplayMode & GLUT_DOUBLE)!=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_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 */
|
pAttributes[iCounter++]=0; pAttributes[iCounter++]=0; /* terminator */
|
||||||
|
|
||||||
bValid = wglChoosePixelFormatARBProc(window->Window.Device,pAttributes,fAttributes,1,&iPixelFormat,&numFormats);
|
bValid = wglChoosePixelFormatARBProc(window->Window.Device,pAttributes,fAttributes,1,&iPixelFormat,&numFormats);
|
||||||
|
Reference in New Issue
Block a user