
GL.GetString(StringName.Version) returning wrong value
Posted Sunday, 9 January, 2011 - 11:10 by anathema| Project: | The Open Toolkit library |
| Version: | all versions |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Raising this as a support request rather than a bug, as I suspect it's me doing something wrong :-)
Running the above code returns a string of "2.1.2" on my system, and getting ShadingLanguageVersion returns "1.20 NVIDIA via Cg compiler". The thing is, my card supports OpenGL 3.2.0 and GLSL 1.50...
I've confirmed that glview returns the correct values. Anyone know what's going on here? :-)


Comments
#1
What context did you request?
#2
I just created a GLControl with the parameter-less constructor:
GLControl glc = new GLControl();
glc.MakeCurrent();
string version = GL.GetString(StringName.Version);
#3
Since 3.1+ is not backwards compatible with 2.1, drivers will give you a 2.1 context unless you request a higher one (otherwise existing applications would break). For instance,
GL.GetString(StringName.Version)is not even valid in 3.1. You need to use:OpenTK provides constructors that allow you to specify the desired OpenGL version.
#4
Ah :-) I thought it might be something like that. Many thanks!
#5
For instance, GL.GetString(StringName.Version) is not even valid in 3.1.
Can't find any source for that, it is fully supported in forward compatible contexts (except the EXTENSIONS checking) and works fine.
The returned string depends on the requested context though, as The Fiddler wrote the default context is 1.x/2.x compatible and thus the returned version is limited.
#6
Ah, you are right.
GL.GetString(StringName.Extensions)is the deprecated one, notVersion.