Added Camera::s/getClearAccum, s/getClearStencil and s/getClearDepth.

This commit is contained in:
Robert Osfield
2008-03-31 11:44:31 +00:00
parent 225e1957b3
commit 64f8631d9d
6 changed files with 99 additions and 26 deletions

View File

@@ -82,12 +82,6 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
const osg::DisplaySettings* getDisplaySettings() const { return _displaySettings.get(); }
/** Sets the clear color. */
inline void setClearColor(const Vec4& color) { _clearColor = color; }
/** Returns the clear color. */
inline const Vec4& getClearColor() const { return _clearColor; }
/** Set the clear mask used in glClear(..).
* Defaults to GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT. */
inline void setClearMask(GLbitfield mask) { _clearMask = mask; }
@@ -95,10 +89,39 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
/** Get the clear mask.*/
inline GLbitfield getClearMask() const { return _clearMask; }
/** Set the clear color used in glClearColor(..).
* glClearColor is only called if mask & GL_COLOR_BUFFER_BIT is true*/
void setClearColor(const osg::Vec4& color) { _clearColor=color; }
/** Get the clear color.*/
const osg::Vec4& getClearColor() const { return _clearColor; }
/** Set the clear accum used in glClearAccum(..).
* glClearAcumm is only called if mask & GL_ACCUM_BUFFER_BIT is true. */
void setClearAccum(const osg::Vec4& color) { _clearAccum=color; }
/** Get the clear accum value.*/
const osg::Vec4& getClearAccum() const { return _clearAccum; }
/** Set the clear depth used in glClearDepth(..). Defaults to 1.0
* glClearDepth is only called if mask & GL_DEPTH_BUFFER_BIT is true. */
void setClearDepth(double depth) { _clearDepth=depth; }
/** Get the clear depth value.*/
double getClearDepth() const { return _clearDepth; }
/** Set the clear stencil value used in glClearStencil(). Defaults to 0;
* glClearStencil is only called if mask & GL_STENCIL_BUFFER_BIT is true*/
void setClearStencil(int stencil) { _clearStencil=stencil; }
/** Get the clear stencil value.*/
int getClearStencil() const { return _clearStencil; }
/** Set the color mask of the camera to use specified osg::ColorMask. */
void setColorMask(osg::ColorMask* colorMask);
/** Set the color mask of the camera to specified values. */
void setColorMask(bool red, bool green, bool blue, bool alpha);
@@ -483,8 +506,12 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
osg::ref_ptr<osg::DisplaySettings> _displaySettings;
Vec4 _clearColor;
GLbitfield _clearMask;
osg::Vec4 _clearColor;
osg::Vec4 _clearAccum;
double _clearDepth;
int _clearStencil;
ref_ptr<ColorMask> _colorMask;
ref_ptr<Viewport> _viewport;

View File

@@ -94,7 +94,6 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
/** Get the clear color.*/
const osg::Vec4& getClearColor() const { return _clearColor; }
/** Set the clear accum used in glClearAccum(..).
* glClearAcumm is only called if mask & GL_ACCUM_BUFFER_BIT is true. */
void setClearAccum(const osg::Vec4& color) { _clearAccum=color; }
@@ -102,8 +101,6 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
/** Get the clear accum.*/
const osg::Vec4& getClearAccum() const { return _clearAccum; }
/** Set the clear depth used in glClearDepth(..). Defaults to 1.0
* glClearDepth is only called if mask & GL_DEPTH_BUFFER_BIT is true. */
void setClearDepth(double depth) { _clearDepth=depth; }
@@ -111,13 +108,13 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
/** Get the clear depth.*/
double getClearDepth() const { return _clearDepth; }
/** Set the clear stencil value used in glClearStencil(). Defaults to 0;
* glClearStencil is only called if mask & GL_STENCIL_BUFFER_BIT is true*/
void setClearStencil(int stencil) { _clearStencil=stencil; }
/** Get the clear color.*/
int getClearStencil() const { return _clearStencil; }
void setCamera(osg::Camera* camera) { if (_camera!=camera) { _camera = camera; _cameraRequiresSetUp = true; } }
osg::Camera* getCamera() { return _camera; }

View File

@@ -113,6 +113,7 @@ class OSGUTIL_EXPORT SceneView : public osg::Object, public osg::CullSettings
/** Set the color used in glClearColor().
Defaults to an off blue color.*/
void setClearColor(const osg::Vec4& color) { _camera->setClearColor(color); }
/** Get the color used in glClearColor.*/
const osg::Vec4& getClearColor() const { return _camera->getClearColor(); }