-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathD3D9.h
67 lines (52 loc) · 1.71 KB
/
D3D9.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
#ifndef __D3D9_H__
#define __D3D9_H__
#include <d3dx9.h>
#include <DxErr.h>
#include "Camera.h"
#include "Math.h"
class D3D9
{
public:
D3D9(void);
~D3D9(void);
public:
void InitD3D9(HWND hWnd);
LPDIRECT3DTEXTURE9 CreateTexture(int texWidth, int texHeight, D3DCOLOR color);
LPDIRECT3DTEXTURE9 CreateInnerTexture(int texWidth, int texHeight, D3DCOLOR color);
void ResizeD3DScene(int width, int height);
HRESULT ResetDevice();
void ToggleFullScreen();
void SetupLight();
void SetupMatrix();
void FrameMove();
Ray CalculatePickingRay(int x, int y);
D3DXVECTOR3 ScreenToVector3(int x, int y);
LRESULT HandleMessages(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
//HWND getWindowHandle() const;
LPDIRECT3D9 GetD3D9() const;
LPDIRECT3DDEVICE9 GetD3DDevice() const;
D3DPRESENT_PARAMETERS GetD3Dpp() const;
void SetBackBufferWidth(int width);
void SetBackBufferHeight(int height);
bool GetIsFullScreen() const;
void SetIsFullScreen(bool is_fullscreen);
int GetScreenWidth() const;
int GetScreenHeight() const;
int GetLastWindowWidth() const;
void SetLastWindowWidth(int windowWidth);
int GetLastWindowHeight() const;
void SetLastWindowHeight(int windowHeight);
private:
LPDIRECT3D9 d3d_; // Direct3D object
LPDIRECT3DDEVICE9 d3ddevice_; // D3D9 Device
D3DPRESENT_PARAMETERS d3dpp_; // D3D presentation parameters
bool is_fullscreen_; // Is Game in Full-Screen mode?
HWND hWnd; // Handle of game window
int last_window_width_; // Last window width
int last_window_height_; // Last window height
int screen_width_; // The maximum resolution width
int screen_height_; // The maximum resolution height
private:
Camera* camera; // Model-view camera
};
#endif // end __D3D9_H__