// Mesh.h: interface for the Mesh class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MESH_H__EF6BAAFB_5CB6_436B_9DCA_54DAD86997B5__INCLUDED_)
#define AFX_MESH_H__EF6BAAFB_5CB6_436B_9DCA_54DAD86997B5__INCLUDED_
#include "windows.h"
#include "d3d8.h"
#include "d3dx8.h"
#include "3dutils.h"

class Mesh  
{
public:
	void draw();
	HRESULT loadFromX(char *filename);
	void cleanup();
	Mesh();
	virtual ~Mesh();
	LPD3DXMESH GetD3DXMesh();
	void SetD3DXMesh(LPD3DXMESH NewMesh);

	void nil() {return;}
	
	//Creates a new mesh; it uses the FVF format of XYZ, normal, diffuse, 
	HRESULT CreateMesh(int NumFaces, int NumVertices);
	//Sets the materials for this mesh to those specified in the array
	HRESULT SetMaterials(DWORD NewNumMaterials, D3DMATERIAL8* NewMaterials);

private:
	DWORD dwNumMaterials;
	LPDIRECT3DTEXTURE8*	pMeshTextures;
	D3DMATERIAL8*		pMeshMaterials;
	LPD3DXMESH			pd3dxMesh;
};

#endif // !defined(AFX_MESH_H__EF6BAAFB_5CB6_436B_9DCA_54DAD86997B5__INCLUDED_)
