4 * Various freeglut initialization functions.
6 * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
7 * Written by Pawel W. Olszta, <olszta@sourceforge.net>
8 * Creation date: Thu Dec 2 1999
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 #include <GL/freeglut.h>
29 #include "freeglut_internal.h"
32 * TODO BEFORE THE STABLE RELEASE:
34 * fgDeinitialize() -- Win32's OK, X11 needs the OS-specific
35 * deinitialization done
36 * glutInitDisplayString() -- display mode string parsing
38 * Wouldn't it be cool to use gettext() for error messages? I just love
39 * bash saying "nie znaleziono pliku" instead of "file not found" :)
40 * Is gettext easily portable?
43 /* -- GLOBAL VARIABLES ----------------------------------------------------- */
46 * A structure pointed by g_pDisplay holds all information
47 * regarding the display, screen, root window etc.
49 SFG_Display fgDisplay;
52 * The settings for the current freeglut session
54 SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */
55 { 300, 300, GL_TRUE }, /* Size */
56 GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH, /* DisplayMode */
57 GL_FALSE, /* Initialised */
58 GLUT_TRY_DIRECT_CONTEXT, /* DirectContext */
59 GL_FALSE, /* ForceIconic */
60 GL_FALSE, /* UseCurrentContext */
61 GL_FALSE, /* GLDebugSwitch */
62 GL_FALSE, /* XSyncSwitch */
63 GLUT_KEY_REPEAT_ON, /* KeyRepeat */
64 INVALID_MODIFIERS, /* Modifiers */
68 #if TARGET_HOST_WIN32 || TARGET_HOST_WINCE
69 { 0, GL_FALSE }, /* Time */
71 { { 0, 0 }, GL_FALSE },
73 { NULL, NULL }, /* Timers */
74 { NULL, NULL }, /* FreeTimers */
75 NULL, /* IdleCallback */
77 NULL, /* MenuStateCallback */
78 NULL, /* MenuStatusCallback */
79 { 640, 480, GL_TRUE }, /* GameModeSize */
80 16, /* GameModeDepth */
81 72, /* GameModeRefresh */
82 GLUT_ACTION_EXIT, /* ActionOnWindowClose */
83 GLUT_EXEC_STATE_INIT, /* ExecState */
84 NULL, /* ProgramName */
85 GL_FALSE, /* JoysticksInitialised */
86 GL_FALSE /* InputDevsInitialised */
90 /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
93 * A call to this function should initialize all the display stuff...
95 static void fghInitialize( const char* displayName )
97 #if TARGET_HOST_UNIX_X11
98 fgDisplay.Display = XOpenDisplay( displayName );
100 if( fgDisplay.Display == NULL )
101 fgError( "failed to open display '%s'", XDisplayName( displayName ) );
103 if( !glXQueryExtension( fgDisplay.Display, NULL, NULL ) )
104 fgError( "OpenGL GLX extension not supported by display '%s'",
105 XDisplayName( displayName ) );
107 fgDisplay.Screen = DefaultScreen( fgDisplay.Display );
108 fgDisplay.RootWindow = RootWindow(
113 fgDisplay.ScreenWidth = DisplayWidth(
117 fgDisplay.ScreenHeight = DisplayHeight(
122 fgDisplay.ScreenWidthMM = DisplayWidthMM(
126 fgDisplay.ScreenHeightMM = DisplayHeightMM(
131 fgDisplay.Connection = ConnectionNumber( fgDisplay.Display );
133 /* Create the window deletion atom */
134 fgDisplay.DeleteWindow = XInternAtom(
140 #elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
145 /* What we need to do is to initialize the fgDisplay global structure here. */
146 fgDisplay.Instance = GetModuleHandle( NULL );
148 atom = GetClassInfo( fgDisplay.Instance, _T("FREEGLUT"), &wc );
152 ZeroMemory( &wc, sizeof(WNDCLASS) );
155 * Each of the windows should have its own device context, and we
156 * want redraw events during Vertical and Horizontal Resizes by
159 * XXX Old code had "| CS_DBCLCKS" commented out. Plans for the
160 * XXX future? Dead-end idea?
162 wc.lpfnWndProc = fgWindowProc;
165 wc.hInstance = fgDisplay.Instance;
166 wc.hIcon = LoadIcon( fgDisplay.Instance, _T("GLUT_ICON") );
168 #if TARGET_HOST_WIN32
169 wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
171 wc.hIcon = LoadIcon( NULL, IDI_WINLOGO );
172 #else /* TARGET_HOST_WINCE */
173 wc.style = CS_HREDRAW | CS_VREDRAW;
176 wc.hCursor = LoadCursor( NULL, IDC_ARROW );
177 wc.hbrBackground = NULL;
178 wc.lpszMenuName = NULL;
179 wc.lpszClassName = _T("FREEGLUT");
181 /* Register the window class */
182 atom = RegisterClass( &wc );
183 FREEGLUT_INTERNAL_ERROR_EXIT ( atom, "Window Class Not Registered", "fghInitialize" );
186 /* The screen dimensions can be obtained via GetSystemMetrics() calls */
187 fgDisplay.ScreenWidth = GetSystemMetrics( SM_CXSCREEN );
188 fgDisplay.ScreenHeight = GetSystemMetrics( SM_CYSCREEN );
191 HWND desktop = GetDesktopWindow( );
192 HDC context = GetDC( desktop );
194 fgDisplay.ScreenWidthMM = GetDeviceCaps( context, HORZSIZE );
195 fgDisplay.ScreenHeightMM = GetDeviceCaps( context, VERTSIZE );
197 ReleaseDC( desktop, context );
200 /* Set the timer granularity to 1 ms */
201 timeBeginPeriod ( 1 );
205 fgState.Initialised = GL_TRUE;
207 /* InputDevice uses GlutTimerFunc(), so fgState.Initialised must be TRUE */
208 fgInitialiseInputDevices();
212 * Perform the freeglut deinitialization...
214 void fgDeinitialize( void )
218 if( !fgState.Initialised )
220 fgWarning( "fgDeinitialize(): "
221 "no valid initialization has been performed" );
225 /* If there was a menu created, destroy the rendering context */
226 if( fgStructure.MenuContext )
228 free( fgStructure.MenuContext );
229 fgStructure.MenuContext = NULL;
232 fgDestroyStructure( );
234 while( ( timer = fgState.Timers.First) )
236 fgListRemove( &fgState.Timers, &timer->Node );
240 while( ( timer = fgState.FreeTimers.First) )
242 fgListRemove( &fgState.FreeTimers, &timer->Node );
246 #if !TARGET_HOST_WINCE
247 if ( fgState.JoysticksInitialised )
250 if ( fgState.InputDevsInitialised )
251 fgInputDeviceClose( );
252 #endif /* !TARGET_HOST_WINCE */
253 fgState.JoysticksInitialised = GL_FALSE;
254 fgState.InputDevsInitialised = GL_FALSE;
256 fgState.Initialised = GL_FALSE;
258 fgState.Position.X = -1;
259 fgState.Position.Y = -1;
260 fgState.Position.Use = GL_FALSE;
262 fgState.Size.X = 300;
263 fgState.Size.Y = 300;
264 fgState.Size.Use = GL_TRUE;
266 fgState.DisplayMode = GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH;
268 fgState.DirectContext = GLUT_TRY_DIRECT_CONTEXT;
269 fgState.ForceIconic = GL_FALSE;
270 fgState.UseCurrentContext = GL_FALSE;
271 fgState.GLDebugSwitch = GL_FALSE;
272 fgState.XSyncSwitch = GL_FALSE;
273 fgState.ActionOnWindowClose = GLUT_ACTION_EXIT;
274 fgState.ExecState = GLUT_EXEC_STATE_INIT;
276 fgState.KeyRepeat = GLUT_KEY_REPEAT_ON;
277 fgState.Modifiers = INVALID_MODIFIERS;
279 fgState.GameModeSize.X = 640;
280 fgState.GameModeSize.Y = 480;
281 fgState.GameModeDepth = 16;
282 fgState.GameModeRefresh = 72;
284 fgState.Time.Set = GL_FALSE;
286 fgListInit( &fgState.Timers );
287 fgListInit( &fgState.FreeTimers );
289 fgState.IdleCallback = NULL;
290 fgState.MenuStateCallback = ( FGCBMenuState )NULL;
291 fgState.MenuStatusCallback = ( FGCBMenuStatus )NULL;
293 fgState.SwapCount = 0;
294 fgState.SwapTime = 0;
295 fgState.FPSInterval = 0;
297 if( fgState.ProgramName )
299 free( fgState.ProgramName );
300 fgState.ProgramName = NULL;
303 #if TARGET_HOST_UNIX_X11
306 * Make sure all X-client data we have created will be destroyed on
309 XSetCloseDownMode( fgDisplay.Display, DestroyAll );
312 * Close the display connection, destroying all windows we have
315 XCloseDisplay( fgDisplay.Display );
317 #elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
319 /* Reset the timer granularity */
324 fgState.Initialised = GL_FALSE;
328 * Everything inside the following #ifndef is copied from the X sources.
331 #if TARGET_HOST_WIN32 || TARGET_HOST_WINCE
335 Copyright 1985, 1986, 1987,1998 The Open Group
337 Permission to use, copy, modify, distribute, and sell this software and its
338 documentation for any purpose is hereby granted without fee, provided that
339 the above copyright notice appear in all copies and that both that
340 copyright notice and this permission notice appear in supporting
343 The above copyright notice and this permission notice shall be included
344 in all copies or substantial portions of the Software.
346 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
347 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
348 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
349 IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
350 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
351 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
352 OTHER DEALINGS IN THE SOFTWARE.
354 Except as contained in this notice, the name of The Open Group shall
355 not be used in advertising or otherwise to promote the sale, use or
356 other dealings in this Software without prior written authorization
361 #define NoValue 0x0000
362 #define XValue 0x0001
363 #define YValue 0x0002
364 #define WidthValue 0x0004
365 #define HeightValue 0x0008
366 #define AllValues 0x000F
367 #define XNegative 0x0010
368 #define YNegative 0x0020
371 * XParseGeometry parses strings of the form
372 * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
373 * width, height, xoffset, and yoffset are unsigned integers.
374 * Example: "=80x24+300-49"
375 * The equal sign is optional.
376 * It returns a bitmask that indicates which of the four values
377 * were actually found in the string. For each value found,
378 * the corresponding argument is updated; for each value
379 * not found, the corresponding argument is left unchanged.
383 ReadInteger(char *string, char **NextString)
385 register int Result = 0;
390 else if (*string == '-')
395 for (; (*string >= '0') && (*string <= '9'); string++)
397 Result = (Result * 10) + (*string - '0');
399 *NextString = string;
406 static int XParseGeometry (
410 unsigned int *width, /* RETURN */
411 unsigned int *height) /* RETURN */
414 register char *strind;
415 unsigned int tempWidth = 0, tempHeight = 0;
416 int tempX = 0, tempY = 0;
419 if ( (string == NULL) || (*string == '\0'))
422 string++; /* ignore possible '=' at beg of geometry spec */
424 strind = (char *)string;
425 if (*strind != '+' && *strind != '-' && *strind != 'x') {
426 tempWidth = ReadInteger(strind, &nextCharacter);
427 if (strind == nextCharacter)
429 strind = nextCharacter;
433 if (*strind == 'x' || *strind == 'X') {
435 tempHeight = ReadInteger(strind, &nextCharacter);
436 if (strind == nextCharacter)
438 strind = nextCharacter;
442 if ((*strind == '+') || (*strind == '-')) {
443 if (*strind == '-') {
445 tempX = -ReadInteger(strind, &nextCharacter);
446 if (strind == nextCharacter)
448 strind = nextCharacter;
454 tempX = ReadInteger(strind, &nextCharacter);
455 if (strind == nextCharacter)
457 strind = nextCharacter;
460 if ((*strind == '+') || (*strind == '-')) {
461 if (*strind == '-') {
463 tempY = -ReadInteger(strind, &nextCharacter);
464 if (strind == nextCharacter)
466 strind = nextCharacter;
472 tempY = ReadInteger(strind, &nextCharacter);
473 if (strind == nextCharacter)
475 strind = nextCharacter;
481 /* If strind isn't at the end of the string the it's an invalid
482 geometry specification. */
484 if (*strind != '\0') return 0;
490 if (mask & WidthValue)
492 if (mask & HeightValue)
493 *height = tempHeight;
498 /* -- INTERFACE FUNCTIONS -------------------------------------------------- */
501 * Perform initialization. This usually happens on the program startup
502 * and restarting after glutMainLoop termination...
504 void FGAPIENTRY glutInit( int* pargc, char** argv )
506 char* displayName = NULL;
507 char* geometry = NULL;
508 int i, j, argc = *pargc;
510 if( fgState.Initialised )
511 fgError( "illegal glutInit() reinitialization attempt" );
513 if (pargc && *pargc && argv && *argv && **argv)
515 fgState.ProgramName = strdup (*argv);
517 if( !fgState.ProgramName )
518 fgError ("Could not allocate space for the program's name.");
521 fgCreateStructure( );
525 /* check if GLUT_FPS env var is set */
526 #if !TARGET_HOST_WINCE
528 const char *fps = getenv( "GLUT_FPS" );
532 sscanf( fps, "%d", &interval );
535 fgState.FPSInterval = 5000; /* 5000 millisecond default */
537 fgState.FPSInterval = interval;
541 displayName = getenv( "DISPLAY");
543 for( i = 1; i < argc; i++ )
545 if( strcmp( argv[ i ], "-display" ) == 0 )
548 fgError( "-display parameter must be followed by display name" );
550 displayName = argv[ i ];
552 argv[ i - 1 ] = NULL;
556 else if( strcmp( argv[ i ], "-geometry" ) == 0 )
559 fgError( "-geometry parameter must be followed by window "
560 "geometry settings" );
562 geometry = argv[ i ];
564 argv[ i - 1 ] = NULL;
568 else if( strcmp( argv[ i ], "-direct" ) == 0)
570 if( fgState.DirectContext == GLUT_FORCE_INDIRECT_CONTEXT )
571 fgError( "parameters ambiguity, -direct and -indirect "
572 "cannot be both specified" );
574 fgState.DirectContext = GLUT_FORCE_DIRECT_CONTEXT;
578 else if( strcmp( argv[ i ], "-indirect" ) == 0 )
580 if( fgState.DirectContext == GLUT_FORCE_DIRECT_CONTEXT )
581 fgError( "parameters ambiguity, -direct and -indirect "
582 "cannot be both specified" );
584 fgState.DirectContext = GLUT_FORCE_INDIRECT_CONTEXT;
588 else if( strcmp( argv[ i ], "-iconic" ) == 0 )
590 fgState.ForceIconic = GL_TRUE;
594 else if( strcmp( argv[ i ], "-gldebug" ) == 0 )
596 fgState.GLDebugSwitch = GL_TRUE;
600 else if( strcmp( argv[ i ], "-sync" ) == 0 )
602 fgState.XSyncSwitch = GL_TRUE;
608 /* Compact {argv}. */
609 for( i = j = 1; i < *pargc; i++, j++ )
611 /* Guaranteed to end because there are "*pargc" arguments left */
612 while ( argv[ j ] == NULL )
615 argv[ i ] = argv[ j ];
618 #endif /* TARGET_HOST_WINCE */
621 * Have the display created now. If there wasn't a "-display"
622 * in the program arguments, we will use the DISPLAY environment
623 * variable for opening the X display (see code above):
625 fghInitialize( displayName );
628 * Geometry parsing deffered until here because we may need the screen
634 unsigned int parsedWidth, parsedHeight;
635 int mask = XParseGeometry( geometry,
636 &fgState.Position.X, &fgState.Position.Y,
637 &parsedWidth, &parsedHeight );
638 /* TODO: Check for overflow? */
639 fgState.Size.X = parsedWidth;
640 fgState.Size.Y = parsedHeight;
642 if( (mask & (WidthValue|HeightValue)) == (WidthValue|HeightValue) )
643 fgState.Size.Use = GL_TRUE;
645 if( mask & XNegative )
646 fgState.Position.X += fgDisplay.ScreenWidth - fgState.Size.X;
648 if( mask & YNegative )
649 fgState.Position.Y += fgDisplay.ScreenHeight - fgState.Size.Y;
651 if( (mask & (XValue|YValue)) == (XValue|YValue) )
652 fgState.Position.Use = GL_TRUE;
657 * Sets the default initial window position for new windows
659 void FGAPIENTRY glutInitWindowPosition( int x, int y )
661 fgState.Position.X = x;
662 fgState.Position.Y = y;
664 if( ( x >= 0 ) && ( y >= 0 ) )
665 fgState.Position.Use = GL_TRUE;
667 fgState.Position.Use = GL_FALSE;
671 * Sets the default initial window size for new windows
673 void FGAPIENTRY glutInitWindowSize( int width, int height )
675 fgState.Size.X = width;
676 fgState.Size.Y = height;
678 if( ( width > 0 ) && ( height > 0 ) )
679 fgState.Size.Use = GL_TRUE;
681 fgState.Size.Use = GL_FALSE;
685 * Sets the default display mode for all new windows
687 void FGAPIENTRY glutInitDisplayMode( unsigned int displayMode )
689 /* We will make use of this value when creating a new OpenGL context... */
690 fgState.DisplayMode = displayMode;
694 /* -- INIT DISPLAY STRING PARSING ------------------------------------------ */
696 static char* Tokens[] =
698 "alpha", "acca", "acc", "blue", "buffer", "conformant", "depth", "double",
699 "green", "index", "num", "red", "rgba", "rgb", "luminance", "stencil",
700 "single", "stereo", "samples", "slow", "win32pdf", "win32pfd", "xvisual",
701 "xstaticgray", "xgrayscale", "xstaticcolor", "xpseudocolor",
702 "xtruecolor", "xdirectcolor",
703 "xstaticgrey", "xgreyscale", "xstaticcolour", "xpseudocolour",
704 "xtruecolour", "xdirectcolour", "borderless", "aux"
706 #define NUM_TOKENS (sizeof(Tokens) / sizeof(*Tokens))
708 void FGAPIENTRY glutInitDisplayString( const char* displayMode )
710 int glut_state_flag = 0 ;
712 * Unpack a lot of options from a character string. The options are
713 * delimited by blanks or tabs.
716 int len = strlen ( displayMode );
717 char *buffer = (char *)malloc ( (len+1) * sizeof(char) );
718 memcpy ( buffer, displayMode, len );
721 token = strtok ( buffer, " \t" );
724 /* Process this token */
726 for ( i = 0; i < NUM_TOKENS; i++ )
728 if ( strcmp ( token, Tokens[i] ) == 0 ) break ;
733 case 0 : /* "alpha": Alpha color buffer precision in bits */
734 glut_state_flag |= GLUT_ALPHA ; /* Somebody fix this for me! */
737 case 1 : /* "acca": Red, green, blue, and alpha accumulation buffer
741 case 2 : /* "acc": Red, green, and blue accumulation buffer precision
742 in bits with zero bits alpha */
743 glut_state_flag |= GLUT_ACCUM ; /* Somebody fix this for me! */
746 case 3 : /* "blue": Blue color buffer precision in bits */
749 case 4 : /* "buffer": Number of bits in the color index color buffer
753 case 5 : /* "conformant": Boolean indicating if the frame buffer
754 configuration is conformant or not */
757 case 6 : /* "depth": Number of bits of precsion in the depth buffer */
758 glut_state_flag |= GLUT_DEPTH ; /* Somebody fix this for me! */
761 case 7 : /* "double": Boolean indicating if the color buffer is
763 glut_state_flag |= GLUT_DOUBLE ;
766 case 8 : /* "green": Green color buffer precision in bits */
769 case 9 : /* "index": Boolean if the color model is color index or not
771 glut_state_flag |= GLUT_INDEX ;
774 case 10 : /* "num": A special capability name indicating where the
775 value represents the Nth frame buffer configuration
776 matching the description string */
779 case 11 : /* "red": Red color buffer precision in bits */
782 case 12 : /* "rgba": Number of bits of red, green, blue, and alpha in
783 the RGBA color buffer */
784 glut_state_flag |= GLUT_RGBA ; /* Somebody fix this for me! */
787 case 13 : /* "rgb": Number of bits of red, green, and blue in the
788 RGBA color buffer with zero bits alpha */
789 glut_state_flag |= GLUT_RGB ; /* Somebody fix this for me! */
792 case 14 : /* "luminance": Number of bits of red in the RGBA and zero
793 bits of green, blue (alpha not specified) of color buffer
795 glut_state_flag |= GLUT_LUMINANCE ; /* Somebody fix this for me! */
798 case 15 : /* "stencil": Number of bits in the stencil buffer */
799 glut_state_flag |= GLUT_STENCIL; /* Somebody fix this for me! */
802 case 16 : /* "single": Boolean indicate the color buffer is single
804 glut_state_flag |= GLUT_SINGLE ;
807 case 17 : /* "stereo": Boolean indicating the color buffer supports
808 OpenGL-style stereo */
809 glut_state_flag |= GLUT_STEREO ;
812 case 18 : /* "samples": Indicates the number of multisamples to use
813 based on GLX's SGIS_multisample extension (for
815 glut_state_flag |= GLUT_MULTISAMPLE ; /*Somebody fix this for me!*/
818 case 19 : /* "slow": Boolean indicating if the frame buffer
819 configuration is slow or not */
822 case 20 : /* "win32pdf": (incorrect spelling but was there before */
823 case 21 : /* "win32pfd": matches the Win32 Pixel Format Descriptor by
825 #if TARGET_HOST_WIN32
829 case 22 : /* "xvisual": matches the X visual ID by number */
830 #if TARGET_HOST_UNIX_X11
834 case 23 : /* "xstaticgray": */
835 case 29 : /* "xstaticgrey": boolean indicating if the frame buffer
836 configuration's X visual is of type StaticGray */
837 #if TARGET_HOST_UNIX_X11
841 case 24 : /* "xgrayscale": */
842 case 30 : /* "xgreyscale": boolean indicating if the frame buffer
843 configuration's X visual is of type GrayScale */
844 #if TARGET_HOST_UNIX_X11
848 case 25 : /* "xstaticcolor": */
849 case 31 : /* "xstaticcolour": boolean indicating if the frame buffer
850 configuration's X visual is of type StaticColor */
851 #if TARGET_HOST_UNIX_X11
855 case 26 : /* "xpseudocolor": */
856 case 32 : /* "xpseudocolour": boolean indicating if the frame buffer
857 configuration's X visual is of type PseudoColor */
858 #if TARGET_HOST_UNIX_X11
862 case 27 : /* "xtruecolor": */
863 case 33 : /* "xtruecolour": boolean indicating if the frame buffer
864 configuration's X visual is of type TrueColor */
865 #if TARGET_HOST_UNIX_X11
869 case 28 : /* "xdirectcolor": */
870 case 34 : /* "xdirectcolour": boolean indicating if the frame buffer
871 configuration's X visual is of type DirectColor */
872 #if TARGET_HOST_UNIX_X11
876 case 35 : /* "borderless": windows should not have borders */
877 #if TARGET_HOST_UNIX_X11
881 case 36 : /* "aux": some number of aux buffers */
882 glut_state_flag |= GLUT_AUX1;
885 case 37 : /* Unrecognized */
886 fgWarning ( "WARNING - Display string token not recognized: %s",
891 token = strtok ( NULL, " \t" );
896 /* We will make use of this value when creating a new OpenGL context... */
897 fgState.DisplayMode = glut_state_flag;
900 /*** END OF FILE ***/