Aux color buffer support. Pass one of GLUT_AUX[1234] to glutInitDisplayMode.
Only implemented/tested on GLX, not Windows. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@567 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
e9be78b6fc
commit
fd3bf94540
@ -66,6 +66,15 @@
|
|||||||
#define GLUT_RENDERING_CONTEXT 0x01FD
|
#define GLUT_RENDERING_CONTEXT 0x01FD
|
||||||
#define GLUT_DIRECT_RENDERING 0x01FE
|
#define GLUT_DIRECT_RENDERING 0x01FE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* New tokens for glutInitDisplayMode.
|
||||||
|
* Value 0x0400 is defined in OpenGLUT.
|
||||||
|
*/
|
||||||
|
#define GLUT_AUX1 0x1000
|
||||||
|
#define GLUT_AUX2 0x2000
|
||||||
|
#define GLUT_AUX3 0x4000
|
||||||
|
#define GLUT_AUX4 0x8000
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Process loop function, see freeglut_main.c
|
* Process loop function, see freeglut_main.c
|
||||||
*/
|
*/
|
||||||
|
@ -687,9 +687,10 @@ static char* Tokens[] =
|
|||||||
"xstaticgray", "xgrayscale", "xstaticcolor", "xpseudocolor",
|
"xstaticgray", "xgrayscale", "xstaticcolor", "xpseudocolor",
|
||||||
"xtruecolor", "xdirectcolor",
|
"xtruecolor", "xdirectcolor",
|
||||||
"xstaticgrey", "xgreyscale", "xstaticcolour", "xpseudocolour",
|
"xstaticgrey", "xgreyscale", "xstaticcolour", "xpseudocolour",
|
||||||
"xtruecolour", "xdirectcolour", "borderless"
|
"xtruecolour", "xdirectcolour", "borderless", "aux"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* XXX why the heck do we use this table instead of strlen(Tokens[i])? */
|
||||||
static int TokenLengths[] =
|
static int TokenLengths[] =
|
||||||
{
|
{
|
||||||
5, 4, 3, 4, 6, 10, 5, 6,
|
5, 4, 3, 4, 6, 10, 5, 6,
|
||||||
@ -698,7 +699,7 @@ static int TokenLengths[] =
|
|||||||
11, 10, 12, 12,
|
11, 10, 12, 12,
|
||||||
10, 12,
|
10, 12,
|
||||||
11, 10, 13, 13,
|
11, 10, 13, 13,
|
||||||
11, 13, 10
|
11, 13, 10, 3
|
||||||
};
|
};
|
||||||
|
|
||||||
void FGAPIENTRY glutInitDisplayString( const char* displayMode )
|
void FGAPIENTRY glutInitDisplayString( const char* displayMode )
|
||||||
@ -874,7 +875,11 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode )
|
|||||||
#endif
|
#endif
|
||||||
break ;
|
break ;
|
||||||
|
|
||||||
case 36 : /* Unrecognized */
|
case 36 : /* "aux": some number of aux buffers */
|
||||||
|
glut_state_flag |= GLUT_AUX1;
|
||||||
|
break ;
|
||||||
|
|
||||||
|
case 37 : /* Unrecognized */
|
||||||
fgWarning ( "WARNING - Display string token not recognized: %s",
|
fgWarning ( "WARNING - Display string token not recognized: %s",
|
||||||
token );
|
token );
|
||||||
break ;
|
break ;
|
||||||
|
@ -127,6 +127,16 @@ XVisualInfo* fgChooseVisual( void )
|
|||||||
ATTRIB_VAL( GLX_ACCUM_ALPHA_SIZE, 1 );
|
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 );
|
||||||
|
|
||||||
|
|
||||||
/* Push a null at the end of the list */
|
/* Push a null at the end of the list */
|
||||||
ATTRIB( None );
|
ATTRIB( None );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user