From d515b69d88b029f5c7e5fa07540eeda5c3854b93 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 9 Nov 2009 11:36:54 +0000 Subject: [PATCH] Added GL token mappings for standard GL errors numbers for when no GLU is available --- src/osg/State.cpp | 81 ++++++++++++++++++++++++++++++------- src/osgUtil/RenderStage.cpp | 10 +---- 2 files changed, 67 insertions(+), 24 deletions(-) diff --git a/src/osg/State.cpp b/src/osg/State.cpp index 51692b7e4..18d7ab812 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -1088,7 +1088,24 @@ bool State::checkGLErrors(const char* str) const if (error) osg::notify(WARN)<<"Warning: detected OpenGL error '" << error<<"'"; else osg::notify(WARN)<<"Warning: detected OpenGL error number 0x" << std::hex << errorNo << std::dec; #else - osg::notify(WARN)<<"Warning: detected OpenGL error number 0x" << std::hex << errorNo << std::dec; + switch(errorNo) + { + case(GL_INVALID_ENUM): + osg::notify(WARN)<<"Warning: detected OpenGL error GL_INVALID_ENUM"; + break; + case(GL_INVALID_VALUE): + osg::notify(WARN)<<"Warning: detected OpenGL error GL_INVALID_VALUE"; + break; + case(GL_INVALID_OPERATION): + osg::notify(WARN)<<"Warning: detected OpenGL error GL_INVALID_OPERATION"; + break; + case(GL_OUT_OF_MEMORY): + osg::notify(WARN)<<"Warning: detected OpenGL error GL_OUT_OF_MEMORY"; + break; + default: + osg::notify(WARN)<<"Warning: detected OpenGL error number 0x" << std::hex << errorNo << std::dec; + break; + } #endif if (str) osg::notify(WARN)<<" at "<className()<<" "<className()<<" "<className()<<" "<className()<<" "<className()<<" "<className()<<" "<className()<<" "<className()<<" "<className()<<" "<className()<<" "<glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);