f44ce328f9d5db84bec606f97564e6117fc6ebc0
[matches/honours.git] / research / transmission_spectroscopy / TOF / Win32++ / samples / DirectX / src / View.h
1 //////////////////////////////////////////////\r
2 // View.h\r
3 \r
4 #ifndef VIEW_H\r
5 #define VIEW_H\r
6 \r
7 // NOTE: for MS compilers you will need the DirectX SDK v9\r
8 //       for Dev-C++ you will need the DirecX v9.0c DevPak\r
9 \r
10 #include <d3d9.h>  // See the note above\r
11 \r
12 // A structure for our custom vertex type\r
13 struct CUSTOMVERTEX\r
14 {\r
15     FLOAT x, y, z;      // The untransformed, 3D position for the vertex\r
16     DWORD color;        // The vertex color\r
17 };\r
18 \r
19 \r
20 class CView : public CWnd, public CThread\r
21 {\r
22 public:\r
23         CView() : m_pD3D(NULL), m_pd3dDevice(NULL), m_pVB(NULL), m_pParent(NULL) {}\r
24         virtual ~CView();\r
25         virtual HRESULT InitD3D(HWND hWnd);\r
26         virtual HRESULT InitGeometry();\r
27         virtual void Render();\r
28         virtual void SetupDefaultRenderStates();\r
29         virtual void SetupMatrices();\r
30 \r
31 protected:\r
32         // CThread member function overrides\r
33         virtual void StartThread(CWnd* pParent);\r
34         virtual BOOL InitInstance();\r
35         virtual int MessageLoop();\r
36 \r
37         // CWnd member function overrides\r
38         virtual HWND Create(CWnd* pParent = 0);\r
39         virtual void OnCreate();\r
40         virtual void PreCreate(CREATESTRUCT &cs);\r
41         virtual LRESULT WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam);\r
42 \r
43 private:\r
44         LPDIRECT3D9       m_pD3D;                       // Used to create the D3DDevice\r
45         LPDIRECT3DDEVICE9 m_pd3dDevice;         // Our rendering device\r
46         LPDIRECT3DVERTEXBUFFER9 m_pVB;      // Buffer to hold vertices\r
47         D3DPRESENT_PARAMETERS m_d3dpp;\r
48         CWnd* m_pParent;\r
49 };\r
50 \r
51 \r
52 #endif\r

UCC git Repository :: git.ucc.asn.au