--- /dev/null
+//////////////////////////////////////////////\r
+// View.h\r
+\r
+#ifndef VIEW_H\r
+#define VIEW_H\r
+\r
+// NOTE: for MS compilers you will need the DirectX SDK v9\r
+// for Dev-C++ you will need the DirecX v9.0c DevPak\r
+\r
+#include <d3d9.h> // See the note above\r
+\r
+// A structure for our custom vertex type\r
+struct CUSTOMVERTEX\r
+{\r
+ FLOAT x, y, z; // The untransformed, 3D position for the vertex\r
+ DWORD color; // The vertex color\r
+};\r
+\r
+\r
+class CView : public CWnd, public CThread\r
+{\r
+public:\r
+ CView() : m_pD3D(NULL), m_pd3dDevice(NULL), m_pVB(NULL), m_pParent(NULL) {}\r
+ virtual ~CView();\r
+ virtual HRESULT InitD3D(HWND hWnd);\r
+ virtual HRESULT InitGeometry();\r
+ virtual void Render();\r
+ virtual void SetupDefaultRenderStates();\r
+ virtual void SetupMatrices();\r
+\r
+protected:\r
+ // CThread member function overrides\r
+ virtual void StartThread(CWnd* pParent);\r
+ virtual BOOL InitInstance();\r
+ virtual int MessageLoop();\r
+\r
+ // CWnd member function overrides\r
+ virtual HWND Create(CWnd* pParent = 0);\r
+ virtual void OnCreate();\r
+ virtual void PreCreate(CREATESTRUCT &cs);\r
+ virtual LRESULT WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam);\r
+\r
+private:\r
+ LPDIRECT3D9 m_pD3D; // Used to create the D3DDevice\r
+ LPDIRECT3DDEVICE9 m_pd3dDevice; // Our rendering device\r
+ LPDIRECT3DVERTEXBUFFER9 m_pVB; // Buffer to hold vertices\r
+ D3DPRESENT_PARAMETERS m_d3dpp;\r
+ CWnd* m_pParent;\r
+};\r
+\r
+\r
+#endif\r