I am configuring a program that works with glut to work with Qt. I am using Qt 5.1.1. and it seems that some of openGL functionality has been lost from Qt4 to Qt5. In my program I create a QOpenGLContext and I am trying to render to a QWindow with the use of a vbo. The vbo part works fine.
Some of the other parts of the program depends on glew. I get the following warning when I run the program
#warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined [-Wcpp]
#warning To use GLEW with Qt, do not include <qopengl.h> or <QOpenGLFunctions> after glew.h [-Wcpp]
The output to the screen is black.
When I comment out the line
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, vboId);
which sends the pbo to the texture, a random image renders to the screen. I assume that this random image is stored in the memory which I am trying to access.
Obviously, you cannot use glew and qopenglfunctions together.
If you want to suggest that I use a QGLWidget and not a QopenGLContext with a QWindow, please explain to me how to use QGLWidget with cmake in Qt 5.1.1. I have read numerous answers suggesting that, but none of them works in Qt 5.1.1.