From 4dac60540af70dd60a265624cbca119956db73ca Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 7 Mar 2018 17:44:48 +0000 Subject: [PATCH] Changed the default values of _drawBuffer and _readBuffer to make sure that the lazy state updating in State.glDrawBuffers(GLenum)/glReadBuffers(Glenum) doesn't ever ignore the first call. --- src/osg/State.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osg/State.cpp b/src/osg/State.cpp index ac20854e0..521c8881d 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -51,8 +51,8 @@ State::State(): _shaderComposer = new ShaderComposer; _currentShaderCompositionProgram = 0L; - _drawBuffer = GL_NONE; - _readBuffer = GL_NONE; + _drawBuffer = GL_INVALID_ENUM; // avoid the lazy state mechanism from ignoreing the first call to State::glDrawBuffer() to make sure it's always passed to OpenGL + _readBuffer = GL_INVALID_ENUM; // avoid the lazy state mechanism from ignoreing the first call to State::glReadBuffer() to make sure it's always passed to OpenGL _identity = new osg::RefMatrix(); // default RefMatrix constructs to identity. _initialViewMatrix = _identity;