Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
OpenGL issues in QT5
electrohamster last edited by
I'm having some difficulty with OpenGL in Qt5 and am not sure I know what I'm doing wrong.
I can run the 5.0 OpenGL examples fine and I can run the NeHe 4.8 OpenGL examples fine http://qt-project.org/wiki/NeHe_in_Qt
When I convert the simple NeHe 4.8 examples to 5.0 though the only thing that works is clearing the screen to black, none of the polygons are rendered.
I found this post which which implies that the OpenGL context works differently in Qt5 http://qt-project.org/forums/viewthread/20033
For reference, my ultimate goal is to use a QDeclarativeView with an QGLWidget for the viewport and a QGraphicsScene for the scene with glut calls in drawBackground(QPainter *painter, const QRectF &rect)
ZapB last edited by
My advice is start off simple and just use a QWindow subclass, create yourself a QOpenGLContext to get your own rendering working.
Once that is working, change your window class to inherit from QDeclarativeView and set a QML scene on it and integrate your rendering.
These two videos may be of interest to you ;)