-
Notifications
You must be signed in to change notification settings - Fork 1
/
scene.h
55 lines (39 loc) · 1.28 KB
/
scene.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef SCENE_H__
#define SCENE_H__
#include "scenenode.h"
#include "shader.h"
#include "matrix4.h"
#include "sceneparams.h"
#include "camera.h"
class Texture;
class Scene
{
public:
Scene();
~Scene();
void Update(float elapsedTime);
bool Render(Shader* defaultShader, Texture* defaultTexture);
void SetRoot(SceneNode* node);
SceneNode* GetRoot() const;
void KeyPressEvent(unsigned char key);
void KeyReleaseEvent(unsigned char key);
void MouseMoveEvent(int x, int y);
void MousePressEvent(const MOUSE_BUTTON &button, int x, int y);
void MouseReleaseEvent(const MOUSE_BUTTON &button, int x, int y);
void WindowFocusEvent(bool hasFocus);
void WindowResizeEvent(int width, int height);
SceneParams& GetParams();
void SetCamera(Camera* camera);
Camera* GetCamera();
const Matrix4f& GetDefaultPerspective() const;
private:
bool InitDefaultShaderIfNeeded();
bool InitDefaultPerspective(int width, int height);
void InitSceneParams(Shader* defaultShader, Texture* defaultTexture);
private:
SceneNode* m_root;
SceneParams m_params;
Matrix4f m_projection;
Camera* m_camera;
};
#endif // SCENE_H__