From 678c456fc841260d7a91adf1728bd4958cfa9ba5 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 27 Apr 2004 19:09:58 +0000 Subject: [PATCH] Made s/getBackgroundColor() deprecated, and add in new s/getClearColor() to replace it. --- include/osgUtil/SceneView | 16 +++++++++++++--- src/osgUtil/SceneView.cpp | 6 +++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/include/osgUtil/SceneView b/include/osgUtil/SceneView index 1aa21a010..b2fa8020c 100644 --- a/include/osgUtil/SceneView +++ b/include/osgUtil/SceneView @@ -97,11 +97,21 @@ class OSGUTIL_EXPORT SceneView : public osg::Referenced inline osg::DisplaySettings* getDisplaySettings() { return _displaySettings.get(); } +#ifdef USE_DEPRECATED_API /** Set the background color used in glClearColor(). Defaults to an off blue color.*/ - void setBackgroundColor(const osg::Vec4& color) { _backgroundColor=color; } + void setBackgroundColor(const osg::Vec4& color) { _clearColor=color; } /** Get the background color.*/ - const osg::Vec4& getBackgroundColor() const { return _backgroundColor; } + const osg::Vec4& getBackgroundColor() const { return _clearColor; } +#endif + + /** Set the color used in glClearColor(). + Defaults to an off blue color.*/ + void setClearColor(const osg::Vec4& color) { _clearColor=color; } + /** Get the color usinged in glClearColor.*/ + const osg::Vec4& getClearColor() const { return _clearColor; } + + void setGlobalStateSet(osg::StateSet* state) { _globalStateSet = state; } osg::StateSet* getGlobalStateSet() { return _globalStateSet.get(); } @@ -478,7 +488,7 @@ class OSGUTIL_EXPORT SceneView : public osg::Referenced osg::ref_ptr _frameStamp; - osg::Vec4 _backgroundColor; + osg::Vec4 _clearColor; CullVisitor::ComputeNearFarMode _computeNearFar; osg::CullStack::CullingMode _cullingMode; diff --git a/src/osgUtil/SceneView.cpp b/src/osgUtil/SceneView.cpp index 6e49edb23..392548730 100644 --- a/src/osgUtil/SceneView.cpp +++ b/src/osgUtil/SceneView.cpp @@ -34,7 +34,7 @@ SceneView::SceneView(DisplaySettings* ds) { _displaySettings = ds; - _backgroundColor.set(0.2f, 0.2f, 0.4f, 1.0f); + _clearColor.set(0.2f, 0.2f, 0.4f, 1.0f); _computeNearFar = CullVisitor::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES; @@ -132,7 +132,7 @@ void SceneView::setDefaults() lightmodel->setAmbientIntensity(osg::Vec4(0.1f,0.1f,0.1f,1.0f)); _globalStateSet->setAttributeAndModes(lightmodel, osg::StateAttribute::ON); - _backgroundColor.set(0.2f, 0.2f, 0.4f, 1.0f); + _clearColor.set(0.2f, 0.2f, 0.4f, 1.0f); _cullMask = 0xffffffff; _cullMaskLeft = 0xffffffff; @@ -550,7 +550,7 @@ void SceneView::cullStage(const osg::Matrixd& projection,const osg::Matrixd& mod rendergraph->clean(); renderStage->setViewport(_viewport.get()); - renderStage->setClearColor(_backgroundColor); + renderStage->setClearColor(_clearColor); switch(_lightingMode)