PDA

View Full Version : getting versions



Pswin
08-27-2009, 03:41 PM
hi

i can get OpenGL version name by


glGetString(GL_VERSION);

and i can get OpenGL major and minor version by:


glGetIntegerv(GL_MAJOR_VERSION, &major);
glGetIntegerv(GL_MINOR_VERSION, &minor);


but how can i get GLSL version? (with out using glGetString)
and how can i get shader model??

Alfonse Reinheart
08-27-2009, 09:32 PM
but how can i get GLSL version? (with out using glGetString)

You can't.


and how can i get shader model??

Wiki Page (http://www.opengl.org/wiki/Detecting_the_Shader_Model)

Dark Photon
08-28-2009, 04:59 AM
but how can i get GLSL version? (with out using glGetString)
You can't.
Though integer major/minor queries would be nice to have, since the GLSL version string format is standard, just sscanf it. Not ideal but should be guaranteed to work:


The GL_VERSION and GL_SHADING_LANGUAGE_VERSION strings begin with a version number. The version number uses one of these forms:

major_number.minor_number
major_number.minor_number.release_number

Groovounet
08-28-2009, 05:10 AM
However glGetString is deprecated. I guest the GLSL version depend on the OpenGL version. That's actually what I assume but am I right to do that?

martinsm
08-28-2009, 08:30 AM
glGetString is not deprecated.
Only GL_EXTENSIONS enum value for its argument is deprecated.

Groovounet
08-28-2009, 10:15 AM
I feel it is going to take a while until I figure out all details about what is deprecated or not ...

Brolingstanz
08-28-2009, 10:39 AM
I know that feeling.

Alfonse Reinheart
08-28-2009, 11:03 AM
I feel it is going to take a while until I figure out all details about what is deprecated or not ...

It's as simple as reading the quick reference. glGetString is black, hence not deprecated. Indeed, it specifically says under it that using GL_EXTENSIONS in it is deprecated.