now have a default reshape callback function that is used if the user didn't set...
[freeglut] / src / fg_structure.c
index 8a5b4f5..be9d1ce 100644 (file)
@@ -49,6 +49,7 @@ SFG_Structure fgStructure = { { NULL, NULL },  /* The list of windows       */
 /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
 
 extern void fgPlatformCreateWindow ( SFG_Window *window );
+extern void fghDefaultReshape(int width, int height);
 
 static void fghClearCallBacks( SFG_Window *window )
 {
@@ -72,11 +73,12 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
                             GLboolean gameMode, GLboolean isMenu )
 {
     /* Have the window object created */
-    SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );
+    SFG_Window *window = (SFG_Window *)calloc( 1, sizeof(SFG_Window) );
 
        fgPlatformCreateWindow ( window );
 
     fghClearCallBacks( window );
+    SET_WCB( *window, Reshape, fghDefaultReshape);
 
     /* Initialize the object properties */
     window->ID = ++fgStructure.WindowID;
@@ -90,15 +92,11 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
     else
         fgListAppend( &fgStructure.Windows, &window->Node );
 
-    /* Set the default mouse cursor and reset the modifiers value */
+    /* Set the default mouse cursor */
     window->State.Cursor    = GLUT_CURSOR_INHERIT;
 
-    window->IsMenu = isMenu;
-
-    window->State.IgnoreKeyRepeat = GL_FALSE;
-    window->State.KeyRepeating    = GL_FALSE;
-    window->State.IsFullscreen    = GL_FALSE;
-    window->State.VisualizeNormals= GL_FALSE;
+    /* Mark window as menu if a menu is to be created */
+    window->IsMenu          = isMenu;
 
     /*
      * Open the window now. The fgOpenWindow() function is system