X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_init.c;h=9cc6a722b9449f179d0d862d22030e3b0777922d;hb=102d7dff8f914d2e32c099f1bc0db809ef780b5e;hp=01f2af201eb525882d15962e0c748808ef99f8ab;hpb=d296a46a2dccdd99048541e1f8ca0ef010ac8545;p=freeglut diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 01f2af2..9cc6a72 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -25,10 +25,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include "freeglut_internal.h" @@ -228,13 +224,13 @@ void fgDeinitialize( void ) fgDestroyStructure( ); - while( timer = fgState.Timers.First ) + while( ( timer = fgState.Timers.First) ) { fgListRemove( &fgState.Timers, &timer->Node ); free( timer ); } - while( timer = fgState.FreeTimers.First ) + while( ( timer = fgState.FreeTimers.First) ) { fgListRemove( &fgState.FreeTimers, &timer->Node ); free( timer ); @@ -620,9 +616,13 @@ void FGAPIENTRY glutInit( int* pargc, char** argv ) if (geometry ) { + unsigned int parsedWidth, parsedHeight; int mask = XParseGeometry( geometry, &fgState.Position.X, &fgState.Position.Y, - &fgState.Size.X, &fgState.Size.Y ); + &parsedWidth, &parsedHeight ); + /* TODO: Check for overflow? */ + fgState.Size.X = parsedWidth; + fgState.Size.Y = parsedHeight; if( (mask & (WidthValue|HeightValue)) == (WidthValue|HeightValue) ) fgState.Size.Use = GL_TRUE; @@ -687,18 +687,7 @@ static char* Tokens[] = "xstaticgray", "xgrayscale", "xstaticcolor", "xpseudocolor", "xtruecolor", "xdirectcolor", "xstaticgrey", "xgreyscale", "xstaticcolour", "xpseudocolour", - "xtruecolour", "xdirectcolour", "borderless" -}; - -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 + "xtruecolour", "xdirectcolour", "borderless", "aux" }; void FGAPIENTRY glutInitDisplayString( const char* displayMode ) @@ -721,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 ) @@ -874,7 +863,11 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode ) #endif 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", token ); break ;