1 //////////////////////////////////////////////
\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
10 #include <d3d9.h> // See the note above
\r
12 // A structure for our custom vertex type
\r
15 FLOAT x, y, z; // The untransformed, 3D position for the vertex
\r
16 DWORD color; // The vertex color
\r
20 class CView : public CWnd, public CThread
\r
23 CView() : m_pD3D(NULL), m_pd3dDevice(NULL), m_pVB(NULL), m_pParent(NULL) {}
\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
32 // CThread member function overrides
\r
33 virtual void StartThread(CWnd* pParent);
\r
34 virtual BOOL InitInstance();
\r
35 virtual int MessageLoop();
\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
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