Parsing glGetShaderInfoLog() to get error info. Is this reliable, or is there a better way?

Posted by m4ttbush on Game Development See other posts from Game Development or by m4ttbush
Published on 2012-10-10T13:35:59Z Indexed on 2012/10/10 15:55 UTC
Read the original article Hit count: 211

Filed under:
|

I want to get a list of errors and their line numbers so I can display the error information different to how it's formatted in the error string, and also show the line in error.

It looks easy enough to just parse the result of glGetShaderInfoLog(), look for "ERROR:" then read the next number up to : and then the next, and then the error description up to the next newline. But the OpenGL docs say "Application developers should not expect different OpenGL implementations to produce identical information logs." Which makes me worry that my code may behave incorrectly on different systems. I don't need them to be identical, I just need them to follow the same format.

So is there a better way to get a list of errors with line number separate, is it safe to assume that they'll always follow the "ERROR: 0:123:" format, or is there simply no reliable way to do this?

Thanks!

© Game Development or respective owner

Related posts about opengl

Related posts about glsl