]> git.sesse.net Git - casparcg/commitdiff
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Wed, 16 Nov 2011 18:01:51 +0000 (18:01 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Wed, 16 Nov 2011 18:01:51 +0000 (18:01 +0000)
common/gl/gl_check.cpp

index 859a7eaaca4ba896c5cd93e6aa3b218318d7b15d..8a5e745b0b3e179090f84e9445d65cd6c4cc590c 100644 (file)
@@ -40,12 +40,18 @@ namespace caspar { namespace gl {
 void SMFL_GLCheckError(const std::string& expr, const std::string& file, unsigned int line)\r
 {\r
        // Get the last error\r
-       GLenum ErrorCode = glGetError();\r
+       GLenum LastErrorCode = GL_NO_ERROR;\r
 \r
-       if (ErrorCode != GL_NO_ERROR)\r
+       for(GLenum ErrorCode = glGetError(); ErrorCode != GL_NO_ERROR; ErrorCode = glGetError())\r
+       {\r
+               CASPAR_LOG(error) << "OpenGL Error: " << ErrorCode << L" " << glewGetErrorString(ErrorCode);\r
+               LastErrorCode = ErrorCode;\r
+       }\r
+\r
+       if (LastErrorCode != GL_NO_ERROR)\r
        {\r
                // Decode the error code\r
-               switch (ErrorCode)\r
+               switch (LastErrorCode)\r
                {\r
                        case GL_INVALID_ENUM :\r
                                BOOST_THROW_EXCEPTION(ogl_invalid_enum()\r