From 4600acb3b795978c3372b4d2119979164986ae10 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 3 Nov 2016 17:33:38 +0000 Subject: [PATCH] Restructed check for whether to print out shaders to make it easier to toggle on/off --- src/osg/Shader.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/osg/Shader.cpp b/src/osg/Shader.cpp index 7f4fd8eeb..fe73c3aba 100644 --- a/src/osg/Shader.cpp +++ b/src/osg/Shader.cpp @@ -628,12 +628,13 @@ void Shader::PerContextShader::compileShader(osg::State& state) GLint compiled = GL_FALSE; // OSG_NOTICE<<"Compiling PerContextShader "<glShaderSource( _glShaderHandle, 1, &sourceText, NULL ); } else @@ -683,11 +682,11 @@ void Shader::PerContextShader::compileShader(osg::State& state) if (!versionLine.empty()) { - if (osg::getNotifyLevel()>=osg::INFO) + if (printOutShaders) { std::string sourceWithLineNumbers = insertLineNumbers(versionLine + _defineStr + source); - OSG_INFO << "\nCompiling " << _shader->getTypename() - << " source:\n" << sourceWithLineNumbers << std::endl; + OSG_NOTICE << "\nCompiling " << _shader->getTypename() + << " source:\n" << sourceWithLineNumbers << std::endl; } // OSG_NOTICE<<"Shader::PerContextShader::compileShader() : Found #version, lineNum = "<=osg::INFO) + if (printOutShaders) { std::string sourceWithLineNumbers = insertLineNumbers(_defineStr + source); - OSG_INFO << "\nCompiling " << _shader->getTypename() - << " source:\n" << sourceWithLineNumbers << std::endl; + OSG_NOTICE << "\nCompiling " << _shader->getTypename() + << " source:\n" << sourceWithLineNumbers << std::endl; } const GLchar* sourceText[2];