-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathWtrEngine.h
More file actions
84 lines (64 loc) · 1.63 KB
/
WtrEngine.h
File metadata and controls
84 lines (64 loc) · 1.63 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
// WtrEngine.h: interface for the CWtrEngine class.
//
//////////////////////////////////////////////////////////////////////
#ifndef WTRENGINE_H
#define WTRENGINE_H
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include "common/wiskunde.h"
#include "WtrCamera.h"
#define OK 1
#define ERR 0
#define FONT_RANGE 255
class __declspec(dllexport) CWtrEngine
{
private:
HWND m_hWnd;
HDC m_hDC;
HGLRC m_hRC;
int m_iFont;
HFONT m_hFont;
int m_iWidth;
int m_iHeight;
DEVMODE* m_pDevmode;
int m_nFrequency;
int m_nFrameCount;
int m_nFrameRate;
float m_fFrameDeviance;
CWtrCamera m_Camera;
int InitPixelformat();
float GetNumTicksPerMs();
void FrameCount();
int InitTiming();
int InitFont();
public:
CWtrEngine();
virtual ~CWtrEngine();
int InitEngine(HWND hWnd, DEVMODE* pDevmode, bool fullscreen, HFONT hFont);
int PreRender();
int PostRender();
void Resize(int width, int height);
void InitView();
void Shutdown();
bool GotoFullscreen();
void LeaveFullscreen();
void ToggleCaptureCursor();
char* GetFPS();
CWtrCamera* GetCamera() { return &m_Camera; };
void GetScreenrect(RECT* rc);
//////////////////////////////////////////////////////////////////////
// 3D stuff
//////////////////////////////////////////////////////////////////////
void Goto3D();
void Leave3D();
//////////////////////////////////////////////////////////////////////
// 2D stuff
//////////////////////////////////////////////////////////////////////
void Goto2D();
void Leave2D();
int Init2DFont(HFONT hFont);
void Draw2DRect(RECT* rc, float fColor[4]);
void Draw2DText(int x, int y, float color[4], char* text, ...);
};
#endif