-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRuntimeFrameWork.h
More file actions
94 lines (83 loc) · 2.42 KB
/
RuntimeFrameWork.h
File metadata and controls
94 lines (83 loc) · 2.42 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#pragma once
class CCamera;
class Map;
class Player;
class Robot;
class Airplane;
class Bomb;
class Explosion_effect;
class Scene;
class CRuntimeFrameWork
{
private:
// static CRuntimeFrameWork* mySelf;
private:
GLboolean m_bGimbalLock{ true };
private:
int scene_Num = 1;
GLint m_fCurrentTime;
GLfloat m_fPrevTime;
GLint m_nCurrentFrame;
GLfloat m_mtxLocal[16];
GLfloat m_mtxLocal2[16];
Vector3D m_vRotate;
Vector3D mouse;
Vector3D preMouse;
Vector3D vRotate;
Vector3D vEye;
Vector3D vLook;
Vector3D vUp;
CCamera* m_pCamera{ nullptr };
Map* m_pMap{nullptr};
Player* m_pPlayer{ nullptr };
Robot* m_pRobot{ nullptr };
Airplane* m_pAirplane{ nullptr };
Bomb* m_pBomb[15][15]{ nullptr };
Explosion_effect* m_pExplosion[15][15]{ nullptr };
Scene* m_pScene{ nullptr };
// using ¼±¾ð
public:
GLint m_nViewPortWidth;
GLint m_nViewPortHeight;
//typedef GLvoid(*Idle)();
using Idle = GLvoid(*)();
using Display = GLvoid(*)();
//typedef GLvoid(*KeyBoard)(unsigned char, int, int);
using KeyBoard = GLvoid(*)(unsigned char, int, int);
using SpecialKeyBoard = GLvoid(*)(int, int, int);
using Mouse = GLvoid(*)(int, int, int, int);
using MouseMove = GLvoid(*)(int, int);
using Resize = GLvoid(*)(int, int);
using Timer = GLvoid(*)(int);
// ÇÔ¼ö Æ÷ÀÎÅÍ ¼±¾ð
private:
Idle m_fpIdle{ nullptr };
Display m_fpRender{ nullptr };
KeyBoard m_fpKeyBorad{ nullptr };
SpecialKeyBoard m_fpSpecialKey{ nullptr };
Mouse m_fpMouse{ nullptr };
MouseMove m_fpMouseMove{ nullptr };
Resize m_fpReshape{ nullptr };
Timer m_fpTimer{ nullptr };
public:
void RegisterTimer(Timer func) { m_fpTimer = func; }
void RegisterIdle(Idle func) { m_fpIdle = func; };
void RegisterRender(Display func) { m_fpRender = func; };
void RegisterKeyBoard(KeyBoard func) { m_fpKeyBorad = func; };
void RegisterSpecialKeyBoard(SpecialKeyBoard func) { m_fpSpecialKey = func; };
void RegisterMouse(Mouse func) { m_fpMouse = func; };
void RegisterMouseMove(MouseMove func) { m_fpMouseMove = func; };
void RegisterReshape(Resize func) { m_fpReshape = func; };
public:
CRuntimeFrameWork();
~CRuntimeFrameWork() = default;
GLvoid Init();
GLvoid Update();
GLvoid Render();
GLvoid OnProcessKeyBoard(unsigned char key, int x, int y);
GLvoid OnProcessSpecialKeyBoard(int key, int x, int y);
GLvoid OnProcessMouse(int button, int state, int x, int y);
GLvoid OnProcessMouseMove(int x, int y);
GLvoid TimerFunc(int value);
GLvoid Reshape(int width, int height);
};