John correctly observed that the initialization {OldHeight} and
authorRichard Rauch <rkr@olib.org>
Thu, 11 Dec 2003 00:08:49 +0000 (00:08 +0000)
committerRichard Rauch <rkr@olib.org>
Thu, 11 Dec 2003 00:08:49 +0000 (00:08 +0000)
{OldWidth} in the window structure should be done for both windows
and sub-windows, and the easiest way to do this is in the
freeglut_structure.c:fgCreateWindow() code.  So, transplant one line.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@383 7f0cb862-5218-0410-a997-914c9d46530a

src/freeglut_structure.c
src/freeglut_window.c

index 583f744..6aa02fd 100644 (file)
@@ -91,6 +91,7 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
      * Initialize the object properties
      */
     window->ID = ++fgStructure.WindowID;
+    window->State.OldHeight = window->State.OldWidth = -1;
 
     fgListInit( &window->Children );
     if( parent )
index 743b94f..07422f7 100644 (file)
@@ -610,7 +610,6 @@ int FGAPIENTRY glutCreateSubWindow( int parentID, int x, int y, int w, int h )
     parent = fgWindowByID( parentID );
     freeglut_return_val_if_fail( parent != NULL, 0 );
     window = fgCreateWindow( parent, "", x, y, w, h, GL_FALSE, GL_FALSE );
-    window->State.OldHeight = window->State.OldWidth = -1;
     return window->ID;
 }