36 lines
622 B
C++
36 lines
622 B
C++
|
#ifndef OPENGL_WIDGET_HH
|
||
|
#define OPENGL_WIDGET_HH
|
||
|
|
||
|
#include "opengl_mesh.hh"
|
||
|
|
||
|
#include <QOpenGLWidget>
|
||
|
#include <QMatrix4x4>
|
||
|
#include <QOpenGLFunctions_4_4_Core>
|
||
|
#include <QOpenGLShaderProgram>
|
||
|
|
||
|
#define FOV 70
|
||
|
|
||
|
|
||
|
class OpenGLWidget : public QOpenGLWidget, public QOpenGLFunctions_4_4_Core {
|
||
|
Q_OBJECT
|
||
|
|
||
|
GLuint pos_attr, proj_attr, view_attr, model_attr;
|
||
|
|
||
|
public:
|
||
|
static OpenGLWidget *instance;
|
||
|
|
||
|
QVector<OpenGLMesh> meshes;
|
||
|
|
||
|
OpenGLWidget(QWidget *parent=nullptr);
|
||
|
~OpenGLWidget();
|
||
|
void initializeGL() override;
|
||
|
void resizeGL(int w, int h) override;
|
||
|
void paintGL() override;
|
||
|
|
||
|
signals:
|
||
|
void initialized();
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif
|