+#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( 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 ;