I'm using Qt 5.1 and I can't find these functions and I try to look at here
http://qt-project.org/doc/qt-5.1/qtgui/qopenglfunctions.html
they don't appear in the list, or they don't exist in the Qt?
I'm using Qt 5.1 and I can't find these functions and I try to look at here
http://qt-project.org/doc/qt-5.1/qtgui/qopenglfunctions.html
they don't appear in the list, or they don't exist in the Qt?
You may be interested in reading this tutorial.
It explains how to set up OpenGL with Qt 5.1, and most notably in part 2, how to use Vertex Array Objects. You have to create them using the "object-oriented" wrapper class QOpenGLVertexArrayObject
instead of calling the raw C-style OpenGL functions.
TL;DR
Don't inherit from QOpenGLFunctions
, inherit version 3 or later. If you're following along with https://learnopengl.com/, then use QOpenGLFunctions_3_3_Core
.
Explanation : https://doc.qt.io/qt-5/qtgui-module.html "The QOpenGLFunctions class provides cross-platform access to the OpenGL ES 2.0 API." glGenVertexArrays & glBindVertexArrays are only introduced in version 3. That's why inheriting from QOpenGLFunctions doesn't give you them.