glwidget.h
___________________________________________________________________________
#ifndef GLWIDGET_H
#define GLWIDGET_H
#include <QOpenGLFunctions>
#include <QOpenGLWidget>
#include <QWidget>
class GLWidget : public QOpenGLWidget ,protected QOpenGLFunctions
{
Q_OBJECT
public:
explicit GLWidget(QWidget *parent);
protected:
void initializeGL();
};
#endif // GLWIDGET_H
glwidget.cpp
__________________________________________________________________
#include "glwidget.h"
GLWidget::GLWidget(QWidget *parent) : QOpenGLWidget(parent)
{
}
void GLWidget::initializeGL()
{
initializeOpenGLFunctions();
glClearColor(1,0,0,1);
}