-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderer.h
41 lines (32 loc) · 829 Bytes
/
Renderer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef RENDERER_H
#define RENDERER_H
#include <QOpenGLWidget>
#include <QOpenGLTimerQuery>
#include <QElapsedTimer>
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>
#include <QOpenGLVertexArrayObject>
class Renderer : public QOpenGLWidget, protected QOpenGLFunctions
{
Q_OBJECT
public slots:
void recompileFragShader(QString slot);
public:
Renderer(QWidget *parent = Q_NULLPTR);
~Renderer();
void update();
void initializeGL() override;
void resizeGL(int, int) override;
void paintGL() override;
void initShaders();
private:
QElapsedTimer _elapsedTimer;
QOpenGLBuffer *vertices;
QOpenGLVertexArrayObject *vao;
QOpenGLShaderProgram *m_program;
QOpenGLShader *frag;
int iResolution;
qreal u_time;
};
#endif // RENDERER_H