I believe the correct way to use the QOpenGLFunction_3_1 class is actually to use protected inheritance, so that it's members are pulled into class scope and we can avoid the 'gl->' prefix. At least, this is the recommended approach for QOpenGLFunctions (http://qt-project.org/doc/qt-5/qopenglfunctions.html#details)
This commit is contained in:
@@ -33,7 +33,7 @@ distribution.
|
||||
#include <QOpenGLVertexArrayObject>
|
||||
#include <QOpenGLBuffer>
|
||||
|
||||
class OpenGLWidget : public QGLWidget
|
||||
class OpenGLWidget : public QGLWidget, protected QOpenGLFunctions_3_1
|
||||
{
|
||||
public:
|
||||
//Constructor
|
||||
@@ -60,7 +60,6 @@ private:
|
||||
GLuint vertexArrayObject;
|
||||
|
||||
QOpenGLShaderProgram shader;
|
||||
QOpenGLFunctions_3_1* gl;
|
||||
|
||||
//Mouse data
|
||||
QPoint m_LastFrameMousePos;
|
||||
|
Reference in New Issue
Block a user