Added support for AbortRendering flag pointer in osg::State which is used
by osgUtil::RenderLeaf to test if any abort state has been set, if so it doesn't do any further drawing. The osgProducer::Viewer has been set up to set the osg::State's it manages with their AbortRendering flag pointers set to the osgProducer::Viewer::_done memeber varaible. Now when escape is pressed the rendering is aborted early.
This commit is contained in:
@@ -565,6 +565,14 @@ class SG_EXPORT State : public Referenced
|
||||
typedef std::vector<StateAttribute::GLModeValue> ValueVec;
|
||||
|
||||
|
||||
/** Set flag for early termination of the draw traversal.*/
|
||||
void setAbortRenderingPtr(bool* abortPtr) { _abortRenderingPtr = abortPtr; }
|
||||
|
||||
/** Get flag for early termination of the draw traversal,
|
||||
* if true steps should be taken to complete rendering early.*/
|
||||
bool getAbortRendering() const { return _abortRenderingPtr!=0?(*_abortRenderingPtr):false; }
|
||||
|
||||
|
||||
void setReportGLErrors(bool flag) { _reportGLErrors = flag; }
|
||||
bool getReportGLErrors() const { return _reportGLErrors; }
|
||||
|
||||
@@ -572,6 +580,7 @@ class SG_EXPORT State : public Referenced
|
||||
bool checkGLErrors(StateAttribute::GLMode mode) const;
|
||||
bool checkGLErrors(const StateAttribute* attribute) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~State();
|
||||
@@ -585,7 +594,7 @@ class SG_EXPORT State : public Referenced
|
||||
|
||||
ref_ptr<DisplaySettings> _displaySettings;
|
||||
|
||||
|
||||
bool* _abortRenderingPtr;
|
||||
bool _reportGLErrors;
|
||||
|
||||
struct ModeStack
|
||||
|
||||
Reference in New Issue
Block a user