-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLesson2Renderer.h
More file actions
55 lines (40 loc) · 1.74 KB
/
Lesson2Renderer.h
File metadata and controls
55 lines (40 loc) · 1.74 KB
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
46
47
48
49
50
51
52
53
54
55
#ifndef LESSON2RENDERER_H
#define LESSON2RENDERER_H
#include "TutorialRenderer.h"
class Lesson2Renderer : public TutorialRenderer
{
Q_OBJECT
Q_PROPERTY(bool normalMappingUsed READ normalMappingUsed WRITE setNormalMappingUsed NOTIFY normalMappingUsedChanged)
Q_PROPERTY(bool displayAsColor READ displayAsColor WRITE setDisplayAsColor NOTIFY displayAsColorChanged)
Q_PROPERTY(bool displayVectors READ displayVectors WRITE setDisplayVectors NOTIFY displayVectorsChanged)
public:
Q_INVOKABLE Lesson2Renderer();
~Lesson2Renderer() override;
virtual void initialize() override;
virtual QString getOptionsUrl() const override { return "Lesson2Options.qml"; }
virtual QString getDescriptionUrl() const override { return "file:///" + QDir::currentPath() + "/Assets/Lesson 2/Description/description.html"; }
bool normalMappingUsed() const;
void setNormalMappingUsed(bool value);
bool displayAsColor() const;
void setDisplayAsColor(bool value);
bool displayVectors() const;
void setDisplayVectors(bool value);
signals:
void normalMappingUsedChanged(bool value);
void displayAsColorChanged(bool value);
void displayVectorsChanged(bool value);
public slots:
virtual void paint() override;
protected:
virtual void update(float deltaTime) override;
private:
bool normalMapsAllowed = true;
bool displayNormalsAsColors = false;
bool displayNormalsAsVectors = false;
Transform modelTransform;
Model model;
QOpenGLShaderProgram* program = nullptr;
QOpenGLShaderProgram* vectorsProgram = nullptr;
};
Q_DECLARE_METATYPE(Lesson2Renderer*)
#endif // LESSON2RENDERER_H