diff options
| author | Kyle Ambroff <ambroff@lindenlab.com> | 2010-11-15 14:14:00 -0800 |
|---|---|---|
| committer | Kyle Ambroff <ambroff@lindenlab.com> | 2010-11-15 14:14:00 -0800 |
| commit | ed9af1151fea725574ddedafd75a9ecfb5927082 (patch) | |
| tree | 6fb865d740e84865b439d224043a5de7151765c8 /indra/llrender/llgl.cpp | |
| parent | 0dbf75ab657446b51e6e9795ddccc16bb9f6fd02 (diff) | |
| parent | a9eb639511a09dc072e67e10d8885a0b4f7587da (diff) | |
Merge with lindenlab/viewer-development
Diffstat (limited to 'indra/llrender/llgl.cpp')
| -rw-r--r-- | indra/llrender/llgl.cpp | 27 |
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)) |
