Changed the error number reporting to be reported as hex.

This commit is contained in:
Robert Osfield
2005-11-01 20:16:31 +00:00
parent 5319e1d650
commit 44d0e90f92

View File

@@ -827,11 +827,11 @@ bool State::checkGLErrors(const char* str) const
if (errorNo!=GL_NO_ERROR)
{
const char* error = (char*)gluErrorString(errorNo);
if (error) osg::notify(WARN)<<"Warning: detected OpenGL error '" << error;
else osg::notify(WARN)<<"Warning: detected OpenGL error '" << errorNo;
if (error) osg::notify(WARN)<<"Warning: detected OpenGL error '" << error<<"'";
else osg::notify(WARN)<<"Warning: detected OpenGL error number 0x" << std::hex << errorNo;
if (str) osg::notify(WARN)<<"' at "<<str<< std::endl;
else osg::notify(WARN)<<"' in osg::State."<< std::endl;
if (str) osg::notify(WARN)<<" at "<<str<< std::endl;
else osg::notify(WARN)<<" in osg::State."<< std::endl;
return true;
}
@@ -845,7 +845,7 @@ bool State::checkGLErrors(StateAttribute::GLMode mode) const
{
const char* error = (char*)gluErrorString(errorNo);
if (error) osg::notify(WARN)<<"Warning: detected OpenGL error '"<< error <<"' after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
else osg::notify(WARN)<<"Warning: detected OpenGL error '"<< errorNo <<"' after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
else osg::notify(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
return true;
}
@@ -859,7 +859,7 @@ bool State::checkGLErrors(const StateAttribute* attribute) const
{
const char* error = (char*)gluErrorString(errorNo);
if (error) osg::notify(WARN)<<"Warning: detected OpenGL error '"<< error <<"' after applying attribute "<<attribute->className()<<" "<<attribute<< std::endl;
else osg::notify(WARN)<<"Warning: detected OpenGL error '"<< errorNo <<"' after applying attribute "<<attribute->className()<<" "<<attribute<< std::endl;
else osg::notify(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying attribute "<<attribute->className()<<" "<<attribute<< std::endl;
return true;
}