Added State::glDrawBuffer/glReadBuffer() method to implement lazy state updating for glDrawBuffer and glReadBuffer

This commit is contained in:
Robert Osfield
2018-03-06 09:49:02 +00:00
parent ee3235e7e0
commit 64341cfb72
2 changed files with 36 additions and 0 deletions

View File

@@ -303,6 +303,14 @@ class OSG_EXPORT State : public Referenced
/** Apply any shader composed state.*/
void applyShaderComposition();
void glDrawBuffer(GLenum buffer);
GLenum getDrawBuffer() const { return _drawBuffer; }
void glReadBuffer(GLenum buffer);
GLenum getReadBuffer() const { return _readBuffer; }
/** Set whether a particular OpenGL mode is valid in the current graphics context.
* Use to disable OpenGL modes that are not supported by current graphics drivers/context.*/
inline void setModeValidity(StateAttribute::GLMode mode,bool valid)
@@ -1079,6 +1087,9 @@ class OSG_EXPORT State : public Referenced
ref_ptr<FrameStamp> _frameStamp;
GLenum _drawBuffer;
GLenum _readBuffer;
ref_ptr<const RefMatrix> _identity;
ref_ptr<const RefMatrix> _initialViewMatrix;
ref_ptr<const RefMatrix> _projection;