From d0df2df7ad9e2501f72394e0389df411a8f20425 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 21 Nov 2006 16:59:04 +0000 Subject: [PATCH] Replaced the setTextureUnit(0) call in State::reset() with code that just sets the member variables without requiring a graphics context. --- src/osg/State.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/osg/State.cpp b/src/osg/State.cpp index a6d536bf1..abe21295f 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -123,7 +123,18 @@ void State::reset() _projection = _identity; dirtyAllVertexArrays(); + +#if 0 + // reset active texture unit values and call OpenGL + // note, this OpenGL op precludes the use of State::reset() without a + // valid graphics context, therefore the new implementation below + // is prefered. setActiveTextureUnit(0); +#else + // reset active texture unit values without calling OpenGL + _currentActiveTextureUnit = 0; + _currentClientActiveTextureUnit = 0; +#endif _lastAppliedProgramObject = 0;