-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglscene.h
89 lines (65 loc) · 1.52 KB
/
glscene.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
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
/*
Àâòîð(ñ): Ñàííèêîâ, Êóëåáÿêèí, Ñòóïàê è Ïàðõîìåíêî
Íàçâàíèå êîìàíäû: AGRAGE
e-mail: [email protected]
*/
#if! defined(_GLSCENE_VILLAGE_)
#define _GLSCENE_VILLAGE_
#if _MSC_VER > 1000
#pragma once
#endif
#define CLASS_NAME _T("VillageGame")
// Áàçîâûé êëàññ ñöåíû OpenGL(íàêèäàë ïî ïðîñòîìó)
class xDlgScene {
private:
HINSTANCE instance;
LPDIRECTSOUND sound;
HWND hwnd;
HGLRC cgl;
bool fullscreen;
SIZE screen;
GLfloat glelapsed;
GLfloat gltime;
GLfloat glfps;
HDC cdc;
public:
xDlgScene(HINSTANCE hInstance);
~xDlgScene();
public:
bool Create(const TCHAR* caption, int width, int height, bool _fulllscreen = false);
int Run(void);
void Destroy(void);
void Begin2D(void);
void End2D(void);
HWND Handle(void) {
return hwnd;
}
HINSTANCE Module(void) {
return instance;
}
SIZE& Screen(void) {
return screen;
}
GLfloat fTime(void) {
return gltime;
}
GLfloat fElapsed(void) {
return glelapsed;
}
GLfloat fFPS(void) {
return glfps;
}
LPDIRECTSOUND Sound(void) {
return sound;
}
protected:
virtual void OnRender(void) {}
virtual void OnCreate(HDC hDC, HWND hwnd) {}
virtual void OnMouseDown(WPARAM wParam, int x, int y) {}
virtual void OnDestroy(void) {}
private:
static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
void this_render(void);
void this_loaden(void);
};
#endif