-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLesson1Renderer.h
More file actions
51 lines (37 loc) · 1.44 KB
/
Lesson1Renderer.h
File metadata and controls
51 lines (37 loc) · 1.44 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
#ifndef LESSON1RENDERER_H
#define LESSON1RENDERER_H
#include "TutorialRenderer.h"
class Lesson1Renderer : public TutorialRenderer
{
Q_OBJECT
Q_PROPERTY(InterpolationType currentInterpolationType READ currentInterpolationType WRITE setCurrentInterpolationType NOTIFY currentInterpolationTypeChanged)
public:
enum InterpolationType
{
Flat,
Smooth,
Gouraud
};
Q_ENUM(InterpolationType)
Q_INVOKABLE Lesson1Renderer();
~Lesson1Renderer() override;
virtual void initialize() override;
virtual void keyReleaseEvent(QKeyEvent* event) override;
virtual QString getOptionsUrl() const override { return "Lesson1Options.qml"; }
virtual QString getDescriptionUrl() const override { return "file:///" + QDir::currentPath() + "/Assets/Lesson 1/Description/description.html"; }
InterpolationType currentInterpolationType() const;
void setCurrentInterpolationType(InterpolationType type);
signals:
void currentInterpolationTypeChanged(InterpolationType type);
public slots:
virtual void paint() override;
protected:
virtual void update(float deltaTime) override;
private:
InterpolationType interpolationType = Flat;
Transform modelTransform;
Model model;
QOpenGLShaderProgram* program = nullptr;
};
Q_DECLARE_METATYPE(Lesson1Renderer*)
#endif // LESSON1RENDERER_H