From a4275fb8d7a20f5ac546bfe9a7fd84e6f648cb21 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 1 Nov 2005 11:18:40 +0000 Subject: [PATCH] From Brad Colbert, Added checking for a NULL return string rom gluErrorString (with slight reformating of this by Robert Osfield.) --- src/osg/State.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/osg/State.cpp b/src/osg/State.cpp index 525eeb825..a87e96221 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -826,9 +826,13 @@ bool State::checkGLErrors(const char* str) const GLenum errorNo = glGetError(); if (errorNo!=GL_NO_ERROR) { - osg::notify(WARN)<<"Warning: detected OpenGL error '"<className()<<" "<apply(*this); + const char* error = (char*)gluErrorString(errorNo); + if (error) osg::notify(WARN)<<"Warning: detected OpenGL error '"<< error <<"' after applying attribute "<className()<<" "<className()<<" "<