anathema's picture

GL.GetString(StringName.Version) returning wrong value

Project:The Open Toolkit library
Version:all versions
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
c2woody's picture

#1

What context did you request?

anathema's picture

#2

I just created a GLControl with the parameter-less constructor:

GLControl glc = new GLControl();
glc.MakeCurrent();
string version = GL.GetString(StringName.Version);

the Fiddler's picture

#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:

int major, minor;
GL.GetInteger(GetPName.Major, out major);
GL.GetInteger(GetPName.Minor, out minor);

OpenTK provides constructors that allow you to specify the desired OpenGL version.

anathema's picture

#4

Status:open» closed

Ah :-) I thought it might be something like that. Many thanks!

c2woody's picture

#5

Quote:

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.

the Fiddler's picture

#6

Ah, you are right. GL.GetString(StringName.Extensions) is the deprecated one, not Version.