PDA

View Full Version : An example of triangle in opengl 4.1 with vertex buffer object and simplest shaders



bartosz.kwasniewski
25th December 2010, 17:05
An example of triangle in opengl 4.1 with vertex buffer object and simplest shaders, to download: 5650... I spent one day to start with qt and shaders. It can be helpuful for others...

saraksh
27th December 2010, 12:37
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:
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. - I havn't check this, but that's possible that both use the same approach to opengl wraping.

bartosz.kwasniewski
30th December 2010, 17:03
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...