I would like to know if there is a common way of getting the line number of an GLSL compiler error. At first I thought I could parse glGetInfoLogARB but then i read that its output is not standardized.
It is not standardized, but among individual vendors it more or less is.
<Shader String Index>:<Line Number>(<Character Number>): <warning|error|...>:
While not perfect, an approach you could take if you needed to parse the info log for line numbers is to pre-process the input based on the GL_VENDOR string. The info log is usually for human interpretation though, so I am not sure how much effort this is really worth.
Speaking of non-standard things, glGetInfoLogARB (...) is archaic (it only exists in GL_ARB_shader_objects).
When GLSL went core in GL 2.0, the function was split into glGetShaderInfoLog (...) and glGetProgramInfoLog (...) for compiler and linker information respectively. For portability sake, you should not be using the old ARB extension; target GL 2.0 as your minimum version and use core GLSL instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With