An example of triangle in opengl 4.1 with vertex buffer object and simplest shaders, to download: QGLTriangleVBSL.zip... I spent one day to start with qt and shaders. It can be helpuful for others...
An example of triangle in opengl 4.1 with vertex buffer object and simplest shaders, to download: QGLTriangleVBSL.zip... I spent one day to start with qt and shaders. It can be helpuful for others...
Jeka (20th December 2011)
In qgl.h QT 4.7 has OpenGLVersionFlag up to 4.0. To get core profile for 4.1 I used gl3w from https://github.com/skaslev/gl3w. With it shaders compile fine, but QT produces : warning C7568: #version 410 not fully supported on current GPU target profile. Probaly QT has the same bug as glew:- I havn't check this, but that's possible that both use the same approach to opengl wraping.glGetString(GL_EXTENSIONS) being deprecated, an error is generated, no extension is returned and then GLEW fails to initialize. So currently, it’s not recommended to use GLEW with a core profile context.
So. I get from glGetIntegerv(GL_MAJOR_VERSION, &glVersion[0]) and glGetIntegerv(GL_MINOR_VERSION, &glVersion[1]); 4.1 OpenGL version. I initilized GLEW in initializeGL(). So now I can use pure OpenGL calls, because i need a QT for everything else than graphics - just a framework(UI, IO, User input, etc...). For matrices i'm using armadillo. (I'm making fully sepeated classes from qt for graphics - if i need sth. im making adapters...). If you use only shaders there is not so many calls from opengl (You need only: vbo, vba, gldrawelements, glVertexAttrib)...
So I dont get it why i have 4.1 version if this flag is set up to 4.0.. It works.. So im content...
Bookmarks