Moved the exit on escape into Window, and added a virtual free method on both

Window an Viewer to clean up the windows, this is now called before exit is
finally called, ensure that more more memroy is clean up prior to exit.
This commit is contained in:
Robert Osfield
2002-03-23 21:28:25 +00:00
parent 33b0ceac0d
commit f50c5f7a5e
4 changed files with 62 additions and 7 deletions

View File

@@ -96,6 +96,8 @@ class OSGGLUT_EXPORT Viewer : public Window, public osgUtil::GUIActionAdapter
protected:
virtual void clear();
virtual void display();
virtual void reshape(GLint w, GLint h);
virtual void mouseMotion(int x, int y);
@@ -142,6 +144,7 @@ class OSGGLUT_EXPORT Viewer : public Window, public osgUtil::GUIActionAdapter
} times[3]; // store up to 3 frames worth of times
bool _useDisplayLists;
osg::Timer _timer;
osg::Timer_t _tickRatePerSecond;
osg::Timer_t _initialTick;

View File

@@ -31,6 +31,8 @@ class OSGGLUT_EXPORT Window
protected:
virtual void clear();
static void displayCB();
static void reshapeCB(int w, int h);
static void visibilityCB(int state);
@@ -68,6 +70,9 @@ class OSGGLUT_EXPORT Window
bool _fullscreen;
int _saved_wx, _saved_wy, _saved_ww,_saved_wh;
bool _exit;
void check_if_exit();
};