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:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user