From Johannes Bauerle, "When trying to use the osgText functionality in an osg application built without support for the fixed function pipeline I got a lot of warning messages about invalid calls.

I found two indirect calls to the glTexEnv in the file Text.cpp:

state.applyTextureAttribute(0,getActiveFont()->getTexEnv());

In the attached fix I surrounded these calls with #ifdef's checking for OSG_GL_FIXED_FUNCTION_AVAILABLE to ensure that the above function is only called when the fixed function pipeline is available.
"
This commit is contained in:
Robert Osfield
2010-12-03 17:50:38 +00:00
parent c70679107d
commit bc4f2c1209

View File

@@ -1207,8 +1207,9 @@ void Text::drawImplementation(osg::State& state, const osg::Vec4& colorMultiplie
#else
state.applyTextureMode(0,GL_TEXTURE_2D,false);
#endif
#if defined(OSG_GL_FIXED_FUNCTION_AVAILABLE)
state.applyTextureAttribute(0,getActiveFont()->getTexEnv());
#endif
if (_characterSizeMode!=OBJECT_COORDS || _autoRotateToScreen)
{
int frameNumber = state.getFrameStamp()?state.getFrameStamp()->getFrameNumber():0;
@@ -1345,7 +1346,9 @@ void Text::drawImplementation(osg::State& state, const osg::Vec4& colorMultiplie
#else
state.applyTextureMode(0,GL_TEXTURE_2D,false);
#endif
#if defined(OSG_GL_FIXED_FUNCTION_AVAILABLE)
state.applyTextureAttribute(0,getActiveFont()->getTexEnv());
#endif
if (_drawMode & TEXT)
{