0001:
0002:
0003:
0004:
0005:
0006:
0007:
0008:
0009: #ifndef _LOAD_H
0010: #define _LOAD_H
0011:
0012: #include <d3d8.h>
0013: #include <d3dx8.h>
0014:
0015:
0016:
0017:
0018: typedef struct {
0019: D3DXVECTOR4 position;
0020: D3DXVECTOR4 weight;
0021: D3DXVECTOR4 normal;
0022: D3DXVECTOR2 texcoord0;
0023: }D3D_CUSTOMVERTEX;
0024:
0025: #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ | D3DFVF_XYZB4 | D3DFVF_NORMAL | D3DFVF_TEX1)
0026:
0027: extern DWORD dwDecl[];
0028:
0029:
0030:
0031:
0032:
0033: class CMyMesh{
0034: public:
0035: CMyMesh(){
0036: bActive = false;
0037: pVB = NULL;
0038: pIndex = NULL;
0039: pSubsetTable = NULL;
0040: pTextures = NULL;
0041: pMaterials = NULL;
0042: nFaces = nVertices = dwNumMaterials = 0;
0043: rot.x = rot.y = rot.z = 0;
0044: }
0045: bool bActive;
0046: float radius;
0047: D3DXVECTOR3 center;
0048: D3DXVECTOR3 rot;
0049:
0050: LPDIRECT3DVERTEXBUFFER8 pVB;
0051: LPDIRECT3DINDEXBUFFER8 pIndex;
0052: D3DXATTRIBUTERANGE *pSubsetTable;
0053: DWORD nFaces;
0054: DWORD nVertices;
0055: D3DMATERIAL8 *pMaterials;
0056: LPDIRECT3DTEXTURE8 *pTextures;
0057: DWORD dwNumMaterials;
0058:
0059: HRESULT Load(LPDIRECT3DDEVICE8 lpD3DDev, char *filename);
0060: void Release();
0061: };
0062:
0063:
0064:
0065: class CTextureMgr{
0066: public:
0067: static HRESULT Load(LPDIRECT3DDEVICE8 lpD3DDev, const char *filename, LPDIRECT3DTEXTURE8 *ppTexture);
0068: static void Release(LPDIRECT3DTEXTURE8 pTexture);
0069: };
0070:
0071:
0072: #endif
0073: