PDA

View Full Version : How to check or set GLSL version?



bartosz.kwasniewski
19th December 2010, 16:19
You can check and set in QGLFormat a version of OpenGL, but how to do the same for GLSL?
There is glGetString, but for GL_SHADING_LANGUAGE_VERSION you get undeclared identifier



const GLubyte* pVersion = glGetString(GL_VERSION);
//const GLubyte* pShaderVersion = glGetString(GL_SHADING_LANGUAGE_VERSION); //undeclared identifier

stampede
19th December 2010, 21:17
#include "glext.h"
glext.h (http://www.opengl.org/registry/api/glext.h)

bartosz.kwasniewski
20th December 2010, 23:50
Thank you. I tried to include it, but I had errors, but now i put it after<QtOpenGL>, and it's working.


#include <QtGui>
#include <QtOpenGL>
#include <GL\glext.h> //Must be placed after "#include <QtOpenGL>"
#include "MyQGLWidget.h"
#include <QDebug>
...
And I have: GL_VERSION: 3.3.0 GL_SHADING_LANGUAGE_VERSION: 3.30 NVIDIA via Cg compiler