Preserve output state so that everything afterwards doesn't get turned into hex

master
Liam Marshall 2015-05-15 13:43:23 -05:00
parent 1752fcee8c
commit 7223f2ac05
1 changed files with 3 additions and 1 deletions

View File

@ -82,7 +82,9 @@ bool report_glerror(const char * function)
{
GLenum tGLErr = glGetError();
if (tGLErr != GL_NO_ERROR) {
cerr << "OpenGL error 0x" << hex << tGLErr << ": " << gluErrorString(tGLErr) << " after " << function << endl;
std::ostringstream hexErr;
hexErr << hex << tGLErr;
cerr << "OpenGL error 0x" << hexErr.str() << ": " << gluErrorString(tGLErr) << " after " << function << endl;
return true;
}
return false;