-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCanvas.h
More file actions
59 lines (44 loc) · 1.18 KB
/
Canvas.h
File metadata and controls
59 lines (44 loc) · 1.18 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
56
57
58
59
#pragma once
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <memory>
#include <map>
#include "Renderer.h"
#include "TriangleMesh.h"
#include "Camera.h"
#include "Scene.h"
class Canvas {
public:
static Canvas& GetInstance();
~Canvas();
bool GetGammaCorrection() const { return _gammaCorrection; }
int GetPRTMode() const { return _prtMode; }
glm::mat4 GetSkyBoxRotation() const;
void Run();
private:
// Singleton constructor
Canvas(int width, int height);
void update();
void draw();
void init();
void beginIMGUI();
void endIMGUI();
void showSkyBoxSelector();
void showMeshModelSelector();
void showPRTModeSelector();
int _width, _height;
GLFWwindow* _window;
glm::vec2 _orbitParameter;
bool _isDragging;
float _factor;
float _distance;
double _elapsedPerFrame;
bool _gammaCorrection;
int _prtMode;
glm::vec3 _skyBoxRotate;
std::shared_ptr<Renderer> _renderer;
std::shared_ptr<Camera> _camera;
std::shared_ptr<Scene> _curScene;
std::map<std::string, std::shared_ptr<EnvironmentMap>> _envirMaps;
std::map<std::string, std::shared_ptr<Scene>> _sceneMaps;
};