//------------------------------------------------------------
// Tony Hyun Kim
// Spring 2007
// 18.354 Project: Lattice gas
// DIRECT3D RESOURCES MANAGER HEADER
//------------------------------------------------------------

#ifndef D3D_RESOURCEMANAGER_H
#define D3D_RESOURCEMANAGER_H

#define ReleaseCOM(x) if(x){ x->Release(); x=0; }

#include <windows.h>
#include "Common.h"

struct D3D_ResourceManager
{
	D3D_ResourceManager();
	~D3D_ResourceManager();

	bool InitD3D(HWND hwnd, int w, int h);
	bool SetupResources();

	D3DMATERIAL9 InitMtrl(D3DXCOLOR a, D3DXCOLOR d, D3DXCOLOR s, D3DXCOLOR e, float p);

	// Data elements
	int cxWidth, cyHeight;

	IDirect3DDevice9* d3dDevice;

	// Simple drawing resources
	D3DXMATRIX	 CylinderMatrix;
	ID3DXMesh*	 CylinderMesh;
	ID3DXMesh*	 NodeMesh;
	D3DMATERIAL9 NetworkMaterial;
	
	D3DMATERIAL9 SelectedMaterial;
	D3DMATERIAL9 RedMaterial;
	D3DMATERIAL9 BlueMaterial;

	ID3DXMesh* ParticleMesh;
};

extern D3D_ResourceManager myD3D;

#endif