How would one best do to find the version of GLSL that an OpenGL implementation supports, in a way that can be reliably used programmatically?
Is the best way to get the GL_SHADING_LANGUAGE_VERSION
string and try to parse it? Can it be relied upon to be returned in a well-defined format? My Intel driver returns 1.20
which is simple enough to parse, but my nVidia card returns 4.20 NVIDIA via Cg compiler
. Can it be trusted to be matched by the (\d+)\.(\d+)( .*)?
regex? This answer seems to indicate otherwise, returning OpenGL ES GLSL ES 1.0
.
Is any of this correct, and/or is there some other way? Specifically, I want to check so that at least GLSL 1.20 is supported.