From 5653791bd0f78986efeaf29726b2f6e410e57d0b Mon Sep 17 00:00:00 2001 From: brianp Date: Tue, 15 Feb 2005 14:49:39 +0000 Subject: [PATCH] AUX buffers for Windows (John Fay) git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@568 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/freeglut_init.c | 14 +------------- freeglut/freeglut/src/freeglut_window.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/freeglut/freeglut/src/freeglut_init.c b/freeglut/freeglut/src/freeglut_init.c index 799c86c..9cc6a72 100644 --- a/freeglut/freeglut/src/freeglut_init.c +++ b/freeglut/freeglut/src/freeglut_init.c @@ -690,18 +690,6 @@ static char* Tokens[] = "xtruecolour", "xdirectcolour", "borderless", "aux" }; -/* XXX why the heck do we use this table instead of strlen(Tokens[i])? */ -static int TokenLengths[] = -{ - 5, 4, 3, 4, 6, 10, 5, 6, - 5, 5, 3, 3, 4, 3, 9, 7, - 6, 6, 7, 4, 8, 8, 7, - 11, 10, 12, 12, - 10, 12, - 11, 10, 13, 13, - 11, 13, 10, 3 -}; - void FGAPIENTRY glutInitDisplayString( const char* displayMode ) { int glut_state_flag = 0 ; @@ -722,7 +710,7 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode ) int i ; for ( i = 0; i < NUM_TOKENS; i++ ) { - if ( strncmp ( token, Tokens[i], TokenLengths[i] ) == 0 ) break ; + if ( strcmp ( token, Tokens[i] ) == 0 ) break ; } switch ( i ) diff --git a/freeglut/freeglut/src/freeglut_window.c b/freeglut/freeglut/src/freeglut_window.c index a032ab4..e2e7f3b 100644 --- a/freeglut/freeglut/src/freeglut_window.c +++ b/freeglut/freeglut/src/freeglut_window.c @@ -214,7 +214,17 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly, pfd.cDepthBits = 24; pfd.cStencilBits = 8; #endif - pfd.cAuxBuffers = 0; + if( fgState.DisplayMode & GLUT_AUX4 ) + pfd.cAuxBuffers = 4; + else if( fgState.DisplayMode & GLUT_AUX3 ) + pfd.cAuxBuffers = 3; + else if( fgState.DisplayMode & GLUT_AUX2 ) + pfd.cAuxBuffers = 2; + else if( fgState.DisplayMode & GLUT_AUX1 ) + pfd.cAuxBuffers = 1; + else + pfd.cAuxBuffers = 0; + pfd.iLayerType = layer_type; pfd.bReserved = 0; pfd.dwLayerMask = 0;