-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.h
executable file
·65 lines (50 loc) · 1.66 KB
/
Game.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
#pragma once
#include "background.h"
#include "HUD.h"
#include "gameentities.h"
#include "numbertosprite.h"
#define ZOOMING_OUT 0x01
#define ZOOMING_IN 0x10
#define ZOOMING_NO 0x00
using std::vector;
class CGame
{
private:
// --------------------------------
// Camera stuff
// --------------------------------
D3DXMATRIX m_mPersp, m_mIdentity;
D3DXVECTOR3 m_vEye, m_vAt, m_vUp;
UCHAR m_cZoom;
float m_CameraShiftX, m_CameraShiftY;
float m_ScreenWidth, m_ScreenHeight;
int nZoomDelta;
// mouse pos in object space
D3DXVECTOR3 m_MouseLoc;
// --------------------------------
// Background and hud items
// --------------------------------
CBackground m_bg, m_splash;
CHUD m_HUD;
CNumberToSprite m_n2sprite;
bool m_bSplash;
// --------------------------------
// The Game internals
// --------------------------------
HWND m_hWnd;
int m_nLevel; //! Determines # of enemies
CGameEntities m_GameEntities;
private:
VOID GetWorldMouse(D3DXVECTOR3& worldMouse, const D3DXMATRIX& mView, const D3DVIEWPORT9& viewport);
public:
CGame(IDirect3DDevice9* pd3dDevice, float screenWidth, float screenHeight);
~CGame(void);
VOID InitApp(HWND hWnd);
VOID CameraZoom(float fElapsedTime);
VOID OnFrameMove(float fElapsedTime);
HRESULT OnFrameRender(IDirect3DDevice9* pd3dDevice);
VOID MouseEvent(int xpos, int ypos, bool bLMB, bool bRMB, int nWheelDelta, bool bMouseMove = false);
VOID KeyboardEvent(UINT nChar, bool bKeyDown);
VOID OnLostDevice();
VOID OnResetDevice();
};