[Qt-interest] QtOpenGL and VBO
Oliver.Knoll at comit.ch
Oliver.Knoll at comit.ch
Thu May 6 09:10:24 CEST 2010
Krzysztof Szewczyk wrote on Wednesday, May 05, 2010 10:23 PM:
> ...
> /usr/include/GL/glew.h:84: error: #error gl.h included before glew.h
> If anyone how to deal with vbo i Qt please help.
First #include glew.h, only then #include the Qt OpenGL related headers:
#include <GL/glew.h>
#include <QtGui/QGLWidget>
But I found out that Qt implements more and more of these tasks, such as GL shader programs (http://doc.trolltech.com/4.6/qglshaderprogram.html), so for my simple OpenGL usage scenario, displaying "photo" images as textures, I could get rid of all "GL 3 specific calls" (most of them which are also available in GL 2, but only as extensions etc., and hence only practicably accessible via GLEW), since Qt now does the "dirty work" (I would still LOVE to be able to be able to create a OpenGL 3 context though - QGL3Context? :) and so now my code only consists of "GL drawing code" which is also covered by OpenGL 1.1 - so I could get rid of GLEW again.
As for your concrete need to create VBO ("Vertex Buffer Object"), I thing http://doc.trolltech.com/4.7-snapshot/qglbuffer.html is (will be) your answer ;) - or just include the headers in the proper order, as outlined above, that works, too.
Cheers, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
More information about the Qt-interest-old
mailing list