X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_init.c;h=9cc6a722b9449f179d0d862d22030e3b0777922d;hb=1c741248e3ad67f24a57742cb5cc511f0ee87805;hp=6b6f3d5f9683fb930bfd81ac4b5457b664015efe;hpb=89c225066899f8956939f8175a0d548cd6f63a62;p=freeglut diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 6b6f3d5..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" @@ -183,7 +179,7 @@ static void fghInitialize( const char* displayName ) /* Register the window class */ atom = RegisterClass( &wc ); - assert( atom ); + FREEGLUT_INTERNAL_ERROR_EXIT ( atom, "Window Class Not Registered", "fghInitialize" ); } /* The screen dimensions can be obtained via GetSystemMetrics() calls */ @@ -219,8 +215,6 @@ void fgDeinitialize( void ) return; } - /* fgState.Initialised = GL_FALSE; */ - /* If there was a menu created, destroy the rendering context */ if( fgStructure.MenuContext ) { @@ -230,7 +224,7 @@ void fgDeinitialize( void ) fgDestroyStructure( ); - while( ( timer = fgState.Timers.First ) ) + while( ( timer = fgState.Timers.First) ) { fgListRemove( &fgState.Timers, &timer->Node ); free( timer ); @@ -311,6 +305,8 @@ void fgDeinitialize( void ) XCloseDisplay( fgDisplay.Display ); #endif + + fgState.Initialised = GL_FALSE; } /* @@ -618,7 +614,7 @@ void FGAPIENTRY glutInit( int* pargc, char** argv ) * size. */ - if( geometry ) + if (geometry ) { unsigned int parsedWidth, parsedHeight; int mask = XParseGeometry( geometry, @@ -691,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 ) @@ -725,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 ) @@ -878,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 ;