GLUT_VERSION updates from John Fay
[freeglut] / freeglut-1.3 / freeglut_init.c
index 7a07b52..a1367b8 100644 (file)
@@ -32,7 +32,7 @@
 #define G_LOG_DOMAIN "freeglut-init"
 
 #include "../include/GL/freeglut.h"
-#include "../include/GL/freeglut_internal.h"
+#include "freeglut_internal.h"
 
 /*
  * TODO BEFORE THE STABLE RELEASE:
@@ -55,7 +55,33 @@ SFG_Display fgDisplay;
 /*
  * The settings for the current freeglut session
  */
-SFG_State fgState;
+SFG_State fgState = { { -1, -1, FALSE },  /* Position */
+                      { 300, 300, TRUE }, /* Size */
+                      GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH,  /* DisplayMode */
+                      FALSE, /* ForceDirectContext */
+                      TRUE,  /* TryDirectContext */
+                      FALSE, /* ForceIconic */
+                      FALSE, /* GLDebugSwitch */
+                      FALSE, /* XSyncSwitch */
+                      TRUE,  /* IgnoreKeyRepeat */
+                      0,     /* FPSInterval */
+                      0,     /* SwapCount */
+                      0,     /* SwapTime */
+#ifdef TARGET_HOST_WIN32
+                      { 0, FALSE }, /* Time */
+#else
+                      { { 0, 0 }, FALSE },
+#endif
+                      { NULL, NULL }, /* Timers */
+                      NULL, /* IdleCallback */
+                      NULL, /* MenuStateCallback */
+                      NULL, /* MenuStatusCallback */
+                      { 640, 480, TRUE }, /* GameModeSize */
+                      16,  /* GameModeDepth */
+                      72,  /* GameModeRefresh */
+                      GLUT_ACTION_EXIT, /* ActionOnWindowClose */
+                      GLUT_EXEC_STATE_INIT /* ExecState */
+};
 
 
 /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
@@ -63,7 +89,7 @@ SFG_State fgState;
 /*
  * A call to this function should initialize all the display stuff...
  */
-void fgInitialize( const gchar* displayName )
+void fgInitialize( const char* displayName )
 {
 #if TARGET_HOST_UNIX_X11
     /*
@@ -76,7 +102,7 @@ void fgInitialize( const gchar* displayName )
         /*
          * Failed to open a display. That's no good.
          */
-        g_error( "failed to open display '%s'", XDisplayName( displayName ) );
+        fgError( "failed to open display '%s'", XDisplayName( displayName ) );
     }
 
     /*
@@ -87,7 +113,7 @@ void fgInitialize( const gchar* displayName )
         /*
          * GLX extensions have not been found...
          */
-        g_error( "OpenGL GLX extension not supported by display '%s'", XDisplayName( displayName ) );
+        fgError( "OpenGL GLX extension not supported by display '%s'", XDisplayName( displayName ) );
     }
 
     /*
@@ -163,22 +189,23 @@ void fgInitialize( const gchar* displayName )
      */
     if( atom == 0 )
     {
-        gboolean retval;
-
         /*
          * Make sure the unitialized fields are reset to zero
          */
         ZeroMemory( &wc, sizeof(WNDCLASS) );
 
         /*
-         * Each of the windows should have it's own device context...
+         * Each of the windows should have its own device context...
          */
         wc.style          = CS_OWNDC;
         wc.lpfnWndProc    = fgWindowProc;
         wc.cbClsExtra     = 0;
         wc.cbWndExtra     = 0;
         wc.hInstance      = fgDisplay.Instance;
-        wc.hIcon          = LoadIcon( NULL, IDI_WINLOGO );
+        wc.hIcon          = LoadIcon( fgDisplay.Instance, "GLUT_ICON" );
+        if (!wc.hIcon)
+          wc.hIcon        = LoadIcon( NULL, IDI_WINLOGO );
+
         wc.hCursor        = LoadCursor( NULL, IDC_ARROW );
         wc.hbrBackground  = NULL;
         wc.lpszMenuName   = NULL;
@@ -187,8 +214,8 @@ void fgInitialize( const gchar* displayName )
         /*
          * Register the window class
          */
-        retval = RegisterClass( &wc );
-        g_assert( retval != FALSE );
+        atom = RegisterClass( &wc );
+        assert( atom != 0 );
     }
 
     /*
@@ -229,14 +256,14 @@ void fgInitialize( const gchar* displayName )
  */
 void fgDeinitialize( void )
 {
-    gint i;
+    SFG_Timer *timer;
 
     /*
      * Check if initialization has been performed before
      */
-    if( fgState.Timer == NULL )
+    if( !fgState.Time.Set )
     {
-        g_warning( "fgDeinitialize(): fgState.Timer is null => no valid initialization has been performed" );
+        fgWarning( "fgDeinitialize(): fgState.Timer is null => no valid initialization has been performed" );
         return;
     }
 
@@ -248,23 +275,69 @@ void fgDeinitialize( void )
     /*
      * Delete all the timers and their storage list
      */
-    for( i=0; i<(gint) g_list_length( fgState.Timers ); i++ )
-        g_free( g_list_nth( fgState.Timers, i )->data );
+    while ( (timer = fgState.Timers.First) != NULL )
+    {
+      fgListRemove ( &fgState.Timers, &timer->Node ) ;
+      free ( timer ) ;
+    }
 
-    g_list_free( fgState.Timers );
-    fgState.Timers = NULL;
+    /*
+     * Deinitialize the joystick device
+     */
+    fgJoystickClose();
 
     /*
-     * Destroy the timer itself
+     * Reset the state structure
      */
-    g_timer_stop( fgState.Timer );
-    g_timer_destroy( fgState.Timer );
-    fgState.Timer = NULL;
+
+    fgState.Position.X = -1 ;
+    fgState.Position.Y = -1 ;
+    fgState.Position.Use = FALSE ;
+
+    fgState.Size.X = 300 ;
+    fgState.Size.Y = 300 ;
+    fgState.Size.Use = TRUE ;
 
     /*
-     * Deinitialize the joystick device
+     * The default display mode to be used
      */
-    fgJoystickClose();
+    fgState.DisplayMode = GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH;
+
+    fgState.ForceDirectContext  = FALSE;
+    fgState.TryDirectContext    = TRUE;
+    fgState.ForceIconic         = FALSE;
+    fgState.GLDebugSwitch       = FALSE;
+    fgState.XSyncSwitch         = FALSE;
+    fgState.ActionOnWindowClose = GLUT_ACTION_EXIT ;
+    fgState.ExecState           = GLUT_EXEC_STATE_INIT ;
+
+    /*
+     * Assume we want to ignore the automatic key repeat
+     */
+    fgState.IgnoreKeyRepeat = TRUE;
+
+    /*
+     * Set the default game mode settings
+     */
+    fgState.GameModeSize.X  = 640;
+    fgState.GameModeSize.Y  = 480;
+    fgState.GameModeDepth   =  16;
+    fgState.GameModeRefresh =  72;
+
+    fgState.Time.Set = FALSE ;
+
+    fgState.Timers.First = fgState.Timers.Last = NULL ;
+    fgState.IdleCallback = NULL ;
+    fgState.MenuStateCallback = (FGCBmenuState)NULL ;
+    fgState.MenuStatusCallback = (FGCBmenuStatus)NULL ;
+
+    /*
+     * FPS display
+     */
+    fgState.SwapCount   = 0;
+    fgState.SwapTime    = 0;
+    fgState.FPSInterval = 0;
+
 
 #if TARGET_HOST_UNIX_X11
 
@@ -290,19 +363,18 @@ void fgDeinitialize( void )
  */
 void FGAPIENTRY glutInit( int* pargc, char** argv )
 {
-    gchar* geometrySettings = NULL;
-    gchar* displayName = NULL;
-    gint i, j, argc = *pargc;
+    char* displayName = NULL;
+    int i, j, argc = *pargc;
 
     /*
      * Do not allow multiple initialization of the library
      */
-    if( fgState.Timer != NULL )
+    if( fgState.Time.Set )
     {
         /*
          * We can't have multiple initialization performed
          */
-        g_error( "illegal glutInit() reinitialization attemp" );
+        fgError( "illegal glutInit() reinitialization attemp" );
     }
 
     /*
@@ -311,59 +383,35 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
     fgCreateStructure();
 
     /*
-     * Fill in the default values that have not been passed in yet.
+     * Remember the function's call time
      */
-    if( fgState.Position.Use == FALSE )
-    {
-        fgState.Position.X = -1;
-        fgState.Position.Y = -1;
-    }
+#if TARGET_HOST_UNIX_X11
+    gettimeofday(&fgState.Time.Value, NULL);
+#elif TARGET_HOST_WIN32
+    fgState.Time.Value = timeGetTime();
+#endif
+    fgState.Time.Set = TRUE;
 
-    if( fgState.Size.Use == FALSE )
+    /* check if GLUT_FPS env var is set */
     {
-        fgState.Size.X   =  300;
-        fgState.Size.Y   =  300;
-        fgState.Size.Use = TRUE;
+        const char *fps = getenv("GLUT_FPS");
+        if (fps) {
+            sscanf(fps, "%d", &fgState.FPSInterval);
+            if (fgState.FPSInterval <= 0)
+                fgState.FPSInterval = 5000;  /* 5000 milliseconds */
+        }
     }
 
     /*
-     * Some more settings to come
-     */
-    fgState.ForceDirectContext = FALSE;
-    fgState.TryDirectContext   = TRUE;
-    fgState.ForceIconic        = FALSE;
-    fgState.GLDebugSwitch      = FALSE;
-    fgState.XSyncSwitch        = FALSE;
-
-    /*
-     * Assume we want to ignore the automatic key repeat
-     */
-    fgState.IgnoreKeyRepeat = TRUE;
-
-    /*
-     * The default display mode to be used
-     */
-    fgState.DisplayMode = GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH;
-
-    /*
-     * Set the default game mode settings
-     */
-    fgState.GameModeSize.X  = 640;
-    fgState.GameModeSize.Y  = 480;
-    fgState.GameModeDepth   =  16;
-    fgState.GameModeRefresh =  72;
-
-    /*
-     * Remember the function's call time
-     */
-    fgState.Timer = g_timer_new();
-    g_timer_start( fgState.Timer );
-
-    /*
      * Grab the environment variable indicating the X display to use.
      * This is harmless under Win32, so let's let it stay here...
      */
-    displayName = (gchar *) strdup( (gchar *) g_getenv( "DISPLAY" ) );
+#if TARGET_HOST_WIN32
+    if ( !getenv ( "DISPLAY" ) )
+      displayName = strdup ( "" ) ;
+    else
+#endif
+    displayName = strdup( getenv( "DISPLAY" ) );
 
     /*
      * Have the program arguments parsed.
@@ -379,12 +427,12 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
              * Check for possible lack of the next argument
              */
             if( ++i >= argc )
-                g_error( "-display parameter must be followed by display name" );
+                fgError( "-display parameter must be followed by display name" );
 
             /*
              * Release the previous display name (the one from app's environment)
              */
-            g_free( displayName );
+            free( displayName );
 
             /*
              * Make a working copy of the name for us to use
@@ -404,23 +452,51 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
          */
         else if( strcmp( argv[ i ], "-geometry" ) == 0 )
         {
-            /*
-             * Again, check if there is at least one more argument
-             */
-            if( ++i >= argc )
-                g_error( "-geometry parameter must be followed by window geometry settings" );
-
-            /*
-             * Otherwise make a duplicate of the geometry settings...
-             */
-            geometrySettings = strdup( argv[ i ] );
+          int result, x, y;
+          unsigned int w, h;
+
+          /*
+           * Again, check if there is at least one more argument
+           */
+          if ( ++i >= argc )
+            fgError( "-geometry parameter must be followed by window geometry settings" );
+
+          /*
+           * Otherwise scan the geometry settings...
+           */
+          result = sscanf ( argv[i], "%dx%d+%d+%d", &x, &y, &w, &h );
+
+          /*
+           * Check what we have been supplied with...
+           */
+          if ( result > 3 )
+            fgState.Size.Y = h ;
+
+          if ( result > 2 )
+            fgState.Size.X = w ;
+
+          if( result > 1 )
+          {
+            if( y < 0 )
+              fgState.Position.Y = fgDisplay.ScreenHeight + y - fgState.Size.Y;
+            else
+              fgState.Position.Y = y;
+          }
 
-            /*
-             * Have both arguments removed
-             */
-            argv[ i - 1 ] = NULL;
-            argv[   i   ] = NULL;
-            (* pargc) -= 2;
+          if( result > 0 )
+          {
+            if( x < 0 )
+              fgState.Position.X = fgDisplay.ScreenWidth + x - fgState.Size.X;
+            else
+              fgState.Position.X = x;
+          }
+
+          /*
+           * Have both arguments removed
+           */
+          argv[ i - 1 ] = NULL;
+          argv[   i   ] = NULL;
+          (* pargc) -= 2;
         }
 
         /*
@@ -432,7 +508,7 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
              * We try to force direct rendering...
              */
             if( fgState.TryDirectContext == FALSE )
-                g_error( "parameters ambiguity, -direct and -indirect cannot be both specified" );
+                fgError( "parameters ambiguity, -direct and -indirect cannot be both specified" );
 
             fgState.ForceDirectContext = TRUE;
             argv[ i ] = NULL;
@@ -444,7 +520,7 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
              * We try to force indirect rendering...
              */
             if( fgState.ForceDirectContext == TRUE )
-                g_error( "parameters ambiguity, -direct and -indirect cannot be both specified" );
+                fgError( "parameters ambiguity, -direct and -indirect cannot be both specified" );
 
             fgState.TryDirectContext = FALSE;
             argv[ i ] = NULL;
@@ -486,19 +562,14 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
     /*
      * Have the arguments list compacted now
      */
-    for( i=1; i<argc; i++ )
+    j = 2 ;
+    for( i = 1; i < *pargc; i++, j++ )
     {
-        if( argv[ i ] == NULL )
-        {
-            for( j=i; j<argc; j++ )
-            {
-                if( argv[ j ] != NULL )
-                {
-                    argv[ i ] = argv[ j ];
-                    argv[ j ] = NULL;
-                }
-            }
-        }
+      if( argv[ i ] == NULL )
+      {
+        while ( argv[j] == NULL ) j++ ;  /* Guaranteed to end because there are "*pargc" arguments left */
+        argv[i] = argv[j] ;
+      }
     }
 
     /*
@@ -508,50 +579,6 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
      */
     fgInitialize( displayName );
 
-#if TARGET_HOST_UNIX_X11
-    /*
-     * We can process the default window geometry settings safely now
-     *
-     * WARNING: have this rewritten to be portable. That won't be hard.
-     */
-    if( geometrySettings != NULL )
-    {
-        gint result, x, y, w, h;
-
-        /*
-         * Have the settings parsed now. This is easy.
-         * We will use the XParseGeometry function.
-         */
-        result = XParseGeometry( geometrySettings, &x, &y, (guint *) &w, (guint *) &h );
-
-        /*
-         * Check what we have been supplied with...
-         */
-        if( (result & WidthValue) && (w >= 0) )
-            fgState.Size.X = w;
-
-        if( (result & HeightValue) && (h >= 0) )
-            fgState.Size.Y = h;
-
-        if( result & XValue )
-            if( result & XNegative )
-                fgState.Position.X = fgDisplay.ScreenWidth + x - fgState.Size.X;
-            else
-                fgState.Position.X = x;
-
-        if( result & YValue )
-            if( result & YNegative )
-                fgState.Position.Y = fgDisplay.ScreenHeight + y - fgState.Size.Y;
-            else
-                fgState.Position.Y = y;
-
-        /*
-         * Free the geometry settings string
-         */
-        g_free( geometrySettings );
-    }
-#endif
-
     /*
      * Check for the minus one settings for both position and size...
      */
@@ -564,7 +591,7 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
     /*
      * Do not forget about releasing the display name string
      */
-    g_free( displayName );
+    free( displayName );
 }
 
 /*
@@ -603,7 +630,7 @@ void FGAPIENTRY glutInitWindowSize( int width, int height )
     /*
      * The settings can be disables when both values are negative
      */
-    if( (width >= 0) && (height >= 0) )
+    if( (width > 0) && (height > 0) )
     {
         /*
          * We want to specify the initial size of each of the windows
@@ -615,7 +642,7 @@ void FGAPIENTRY glutInitWindowSize( int width, int height )
     else
     {
         /*
-         * The initial size of each of the windows is specified by the wm
+         * The initial size of each of the windows is specified by the wm (officially this is an error condition)
          */
         fgState.Size.X   =    -1;
         fgState.Size.Y   =    -1;
@@ -626,7 +653,7 @@ void FGAPIENTRY glutInitWindowSize( int width, int height )
 /*
  * Sets the default display mode for all new windows
  */
-void FGAPIENTRY glutInitDisplayMode( int displayMode )
+void FGAPIENTRY glutInitDisplayMode( unsigned int displayMode )
 {
     /*
      * We will make use of this value when creating a new OpenGL context...
@@ -637,6 +664,7 @@ void FGAPIENTRY glutInitDisplayMode( int displayMode )
 
 /* -- INIT DISPLAY STRING PARSING ------------------------------------------ */
 
+#if 0 /* FIXME: CJP */
 /*
  * There is a discrete number of comparison operators we can encounter:
  *
@@ -833,7 +861,7 @@ void FGAPIENTRY glutInitDisplayString( char* displayMode )
              * Grab the value string that must follow the comparison operator...
              */
             if( comparison != FG_NONE && i < (gint) strlen( scanner->value.v_identifier ) )
-                valueString = g_strdup( scanner->value.v_identifier + i );
+                valueString = strdup( scanner->value.v_identifier + i );
 
             /*
              * If there was a value string, convert it to integer...
@@ -842,7 +870,7 @@ void FGAPIENTRY glutInitDisplayString( char* displayMode )
                 value = strtol( valueString, NULL, 0 );
 
             /*
-             * Now we need to match the capability string and it's ID
+             * Now we need to match the capability string and its ID
              */
             for( i=0; g_Tokens[ i ]!=NULL; i++ )
             {
@@ -916,10 +944,177 @@ void FGAPIENTRY glutInitDisplayString( char* displayMode )
      */
     g_scanner_destroy( scanner );
 }
+#endif
 
-/*** END OF FILE ***/
+#define NUM_TOKENS             28
+static char* Tokens[] =
+{
+    "alpha", "acca", "acc", "blue", "buffer", "conformant", "depth", "double", "green",
+    "index", "num", "red", "rgba", "rgb", "luminance", "stencil", "single", "stereo", "samples",
+    "slow", "win32pdf", "xvisual", "xstaticgray", "xgrayscale", "xstaticcolor", "xpseudocolor",
+    "xtruecolor", "xdirectcolor"
+};
+
+static int TokenLengths[] =
+{
+         5,      4,     3,      4,        6,           10,       5,        6,       5,
+         5,     3,     3,      4,     3,           9,         7,        6,        6,         7,
+        4,          8,         7,            11,           10,             12,             12,
+             10,             12
+};
+
+void FGAPIENTRY glutInitDisplayString( const char* displayMode )
+{
+  int glut_state_flag = 0 ;
+  /*
+   * Unpack a lot of options from a character string.  The options are delimited by blanks or tabs.
+   */
+  char *token ;
+  int len = strlen ( displayMode ) ;
+  char *buffer = malloc ( (len+1) * sizeof(char) ) ;
+  memcpy ( buffer, displayMode, len ) ;
+  buffer[len] = '\0' ;
+
+  token = strtok ( buffer, " \t" ) ;
+  while ( token )
+  {
+    /*
+     * Process this token
+     */
+    int i ;
+    for ( i = 0; i < NUM_TOKENS; i++ )
+    {
+      if ( strncmp ( token, Tokens[i], TokenLengths[i] ) == 0 ) break ;
+    }
+
+    switch ( i )
+    {
+    case 0 :  /* "alpha":  Alpha color buffer precision in bits */
+      glut_state_flag |= GLUT_ALPHA ;  /* Somebody fix this for me! */
+      break ;
+
+    case 1 :  /* "acca":  Red, green, blue, and alpha accumulation buffer precision in bits */
+      break ;
+
+    case 2 :  /* "acc":  Red, green, and blue accumulation buffer precision in bits with zero bits alpha */
+      glut_state_flag |= GLUT_ACCUM ;  /* Somebody fix this for me! */
+      break ;
+
+    case 3 :  /* "blue":  Blue color buffer precision in bits */
+      break ;
+
+    case 4 :  /* "buffer":  Number of bits in the color index color buffer */
+      break ;
+
+    case 5 :  /* "conformant":  Boolean indicating if the frame buffer configuration is conformant or not */
+      break ;
+
+    case 6 :  /* "depth":  Number of bits of precsion in the depth buffer */
+      glut_state_flag |= GLUT_DEPTH ;  /* Somebody fix this for me! */
+      break ;
+
+    case 7 :  /* "double":  Boolean indicating if the color buffer is double buffered */
+      glut_state_flag |= GLUT_DOUBLE ;
+      break ;
+
+    case 8 :  /* "green":  Green color buffer precision in bits */
+      break ;
+
+    case 9 :  /* "index":  Boolean if the color model is color index or not */
+      glut_state_flag |= GLUT_INDEX ;
+      break ;
+
+    case 10 :  /* "num":  A special capability  name indicating where the value represents the Nth frame buffer configuration matching the description string */
+      break ;
+
+    case 11 :  /* "red":  Red color buffer precision in bits */
+      break ;
+
+    case 12 :  /* "rgba":  Number of bits of red, green, blue, and alpha in the RGBA color buffer */
+      glut_state_flag |= GLUT_RGBA ;  /* Somebody fix this for me! */
+      break ;
+
+    case 13 :  /* "rgb":  Number of bits of red, green, and blue in the RGBA color buffer with zero bits alpha */
+      glut_state_flag |= GLUT_RGB ;  /* Somebody fix this for me! */
+      break ;
+
+    case 14 :  /* "luminance":  Number of bits of red in the RGBA and zero bits of green, blue (alpha not specified) of color buffer precision */
+      glut_state_flag |= GLUT_LUMINANCE ;  /* Somebody fix this for me! */
+      break ;
+
+    case 15 :  /* "stencil":  Number of bits in the stencil buffer */
+      glut_state_flag |= GLUT_STENCIL ;  /* Somebody fix this for me! */
+      break ;
+
+    case 16 :  /* "single":  Boolean indicate the color buffer is single buffered */
+      glut_state_flag |= GLUT_SINGLE ;
+      break ;
+
+    case 17 :  /* "stereo":  Boolean indicating the color buffer supports OpenGL-style stereo */
+      glut_state_flag |= GLUT_STEREO ;
+      break ;
 
+    case 18 :  /* "samples":  Indicates the number of multisamples to use based on GLX's SGIS_multisample extension (for antialiasing) */
+      glut_state_flag |= GLUT_MULTISAMPLE ;  /* Somebody fix this for me! */
+      break ;
 
+    case 19 :  /* "slow":  Boolean indicating if the frame buffer configuration is slow or not */
+      break ;
 
+    case 20 :  /* "win32pdf":  matches the Win32 Pixel Format Descriptor by number */
+#ifdef TARGET_HOST_WIN32
+#endif
+      break ;
+
+    case 21 :  /* "xvisual":  matches the X visual ID by number */
+#ifdef TARGET_HOST_UNIX_X11
+#endif
+      break ;
 
+    case 22 :  /* "xstaticgray":  boolean indicating if the frame buffer configuration's X visual is of type StaticGray */
+#ifdef TARGET_HOST_UNIX_X11
+#endif
+      break ;
+
+    case 23 :  /* "xgrayscale":  boolean indicating if the frame buffer configuration's X visual is of type GrayScale */
+#ifdef TARGET_HOST_UNIX_X11
+#endif
+      break ;
 
+    case 24 :  /* "xstaticcolor":  boolean indicating if the frame buffer configuration's X visual is of type StaticColor */
+#ifdef TARGET_HOST_UNIX_X11
+#endif
+      break ;
+
+    case 25 :  /* "xpseudocolor":  boolean indicating if the frame buffer configuration's X visual is of type PseudoColor */
+#ifdef TARGET_HOST_UNIX_X11
+#endif
+      break ;
+
+    case 26 :  /* "xtruecolor":  boolean indicating if the frame buffer configuration's X visual is of type TrueColor */
+#ifdef TARGET_HOST_UNIX_X11
+#endif
+      break ;
+
+    case 27 :  /* "xdirectcolor":  boolean indicating if the frame buffer configuration's X visual is of type DirectColor */
+#ifdef TARGET_HOST_UNIX_X11
+#endif
+      break ;
+
+    case 28 :  /* Unrecognized */
+      printf ( "WARNING - Display string token not recognized:  %s\n", token ) ;
+      break ;
+    }
+
+    token = strtok ( NULL, " \t" ) ;
+  }
+
+  free ( buffer ) ;
+
+  /*
+   * We will make use of this value when creating a new OpenGL context...
+   */
+  fgState.DisplayMode = glut_state_flag;
+}
+
+/*** END OF FILE ***/