timers internally now use 64bit unsigned int, if available
[freeglut] / src / Common / freeglut_init.c
index 27abc46..bb0c097 100644 (file)
@@ -44,7 +44,7 @@
 /* -- GLOBAL VARIABLES ----------------------------------------------------- */
 
 /*
- * A structure pointed by g_pDisplay holds all information
+ * A structure pointed by fgDisplay holds all information
  * regarding the display, screen, root window etc.
  */
 SFG_Display fgDisplay;
@@ -73,9 +73,9 @@ SFG_State fgState = { { -1, -1, GL_FALSE },  /* Position */
                       0,                      /* ActiveMenus */
                       NULL,                   /* MenuStateCallback */
                       NULL,                   /* MenuStatusCallback */
-                      { 640, 480, GL_TRUE },  /* GameModeSize */
-                      16,                     /* GameModeDepth */
-                      72,                     /* GameModeRefresh */
+                      { -1, -1, GL_TRUE },    /* GameModeSize */
+                      -1,                     /* GameModeDepth */
+                      -1,                     /* GameModeRefresh */
                       GLUT_ACTION_EXIT,       /* ActionOnWindowClose */
                       GLUT_EXEC_STATE_INIT,   /* ExecState */
                       NULL,                   /* ProgramName */
@@ -286,10 +286,10 @@ void fgDeinitialize( void )
     fgState.KeyRepeat       = GLUT_KEY_REPEAT_ON;
     fgState.Modifiers       = INVALID_MODIFIERS;
 
-    fgState.GameModeSize.X  = 640;
-    fgState.GameModeSize.Y  = 480;
-    fgState.GameModeDepth   =  16;
-    fgState.GameModeRefresh =  72;
+    fgState.GameModeSize.X  = -1;
+    fgState.GameModeSize.Y  = -1;
+    fgState.GameModeDepth   = -1;
+    fgState.GameModeRefresh = -1;
 
     fgListInit( &fgState.Timers );
     fgListInit( &fgState.FreeTimers );
@@ -314,25 +314,10 @@ void fgDeinitialize( void )
 }
 
 
-#if TARGET_HOST_MS_WINDOWS
-#define NoValue         0x0000
-#define XValue          0x0001
-#define YValue          0x0002
-#define WidthValue      0x0004
-#define HeightValue     0x0008
-#define AllValues       0x000F
-#define XNegative       0x0010
-#define YNegative       0x0020
-
-extern int XParseGeometry (
-    const char *string,
-    int *x,
-    int *y,
-    unsigned int *width,    /* RETURN */
-    unsigned int *height);    /* RETURN */
-#endif
-
 /* -- INTERFACE FUNCTIONS -------------------------------------------------- */
+#if !TARGET_HOST_POSIX_X11
+#   include "../Common/xparsegeometry_repl.h"
+#endif
 
 /*
  * Perform initialization. This usually happens on the program startup
@@ -368,7 +353,7 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
     fgPlatformInitialize( displayName );
 
     /*
-     * Geometry parsing deffered until here because we may need the screen
+     * Geometry parsing deferred until here because we may need the screen
      * size.
      */
 
@@ -513,7 +498,7 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode )
                      configuration is conformant or not */
             break ;
 
-        case 6 : /* "depth":  Number of bits of precsion in the depth buffer */
+        case 6 : /* "depth":  Number of bits of precision in the depth buffer */
             glut_state_flag |= GLUT_DEPTH ;  /* Somebody fix this for me! */
             break ;
 
@@ -633,8 +618,7 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode )
             break ;
 
         case 35 :  /* "borderless":  windows should not have borders */
-#if TARGET_HOST_POSIX_X11
-#endif
+            glut_state_flag |= GLUT_BORDERLESS;
             break ;
 
         case 36 :  /* "aux":  some number of aux buffers */
@@ -660,7 +644,7 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode )
 
 void FGAPIENTRY glutInitContextVersion( int majorVersion, int minorVersion )
 {
-    /* We will make use of these valuse when creating a new OpenGL context... */
+    /* We will make use of these value when creating a new OpenGL context... */
     fgState.MajorVersion = majorVersion;
     fgState.MinorVersion = minorVersion;
 }
@@ -698,4 +682,4 @@ void FGAPIENTRY glutInitWarningFunc( void (* vfgWarning) ( const char *fmt, va_l
     fgState.WarningFunc = vfgWarning;
 }
 
-/*** END OF FILE ***/
+/*** END OF FILE ***/
\ No newline at end of file