-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfragmentpane.h
More file actions
45 lines (36 loc) · 904 Bytes
/
fragmentpane.h
File metadata and controls
45 lines (36 loc) · 904 Bytes
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
42
43
44
45
#ifndef FRAGMENTPANE_H
#define FRAGMENTPANE_H
#include <QtWidgets>
#include <QGLWidget>
#include <QtOpenGL>
#include <QOpenGLFunctions>
#include <QOpenGLShader>
class FragmentPane : public QGLWidget, protected QOpenGLFunctions
{
Q_OBJECT
public:
explicit FragmentPane(QWidget* parent = 0);
void SetNormalMap(QImage texture);
void SetDiffuse(QImage texture);
signals:
public slots:
void slotZoomFactorChange(int value);
void update();
protected:
void initializeGL();
void paintGL();
void mousePressEvent(QMouseEvent *event);
private:
QVector<QVector3D> vertices;
QVector<QVector2D> texCoords;
QVector3D lightPos;
QGLShaderProgram *program;
float zoomFactor;
bool hasDiffuse;
bool hasNormal;
GLuint diffuseTexture;
GLuint normalTexture;
float t;
void createSprite(int width, int height);
};
#endif // FRAGMENTPANE_H