summaryrefslogtreecommitdiff
path: root/indra/llrender/llgl.cpp
diff options
context:
space:
mode:
authorMark Palange (Mani) <palange@lindenlab.com>2010-11-10 14:28:54 -0800
committerMark Palange (Mani) <palange@lindenlab.com>2010-11-10 14:28:54 -0800
commit7eed962a6237f74ec980e06d53886259ef225c55 (patch)
tree6f90cd7736c74164f5cfaff071ecfc9f63b7a46f /indra/llrender/llgl.cpp
parentb2e84d739b4f5c00b497e57e892fc10d78af8b76 (diff)
parent9d33a548b636fa739de2aa11ba9ed02b301c53a5 (diff)
Merge
Diffstat (limited to 'indra/llrender/llgl.cpp')
-rw-r--r--indra/llrender/llgl.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 096e8e07ab..6ea63809f8 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -1055,6 +1055,33 @@ void flush_glerror()
glGetError();
}
+//this function outputs gl error to the log file, does not crash the code.
+void log_glerror()
+{
+ if (LL_UNLIKELY(!gGLManager.mInited))
+ {
+ return ;
+ }
+ // Create or update texture to be used with this data
+ GLenum error;
+ error = glGetError();
+ while (LL_UNLIKELY(error))
+ {
+ GLubyte const * gl_error_msg = gluErrorString(error);
+ if (NULL != gl_error_msg)
+ {
+ llwarns << "GL Error: " << error << " GL Error String: " << gl_error_msg << llendl ;
+ }
+ else
+ {
+ // gluErrorString returns NULL for some extensions' error codes.
+ // you'll probably have to grep for the number in glext.h.
+ llwarns << "GL Error: UNKNOWN 0x" << std::hex << error << std::dec << llendl;
+ }
+ error = glGetError();
+ }
+}
+
void do_assert_glerror()
{
if (LL_UNLIKELY(!gGLManager.mInited))