From bc4f2c12094bfc68a35a89dd78112203370cb0b3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 3 Dec 2010 17:50:38 +0000 Subject: [PATCH] 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. " --- src/osgText/Text.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osgText/Text.cpp b/src/osgText/Text.cpp index f262c9410..f2d610486 100644 --- a/src/osgText/Text.cpp +++ b/src/osgText/Text.cpp @@ -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) {