#ifdef USE_D3D9
D3D9PersistentMesh::D3D9PersistentMesh()
{
_Device = NULL;
}
D3D9PersistentMesh::~D3D9PersistentMesh()
{
FreeMemory();
}
void D3D9PersistentMesh::FreeMemory()
{
_Mesh.FreeMemory();
_D3DMesh.FreeMemory();
_Device = NULL;
}
void D3D9PersistentMesh::ReleaseMemory()
{
_D3DMesh.FreeMemory();
_Device = NULL;
}
void D3D9PersistentMesh::Reset(GraphicsDevice &graphics)
{
ReleaseMemory();
_D3DMesh = _Mesh;
_Device = graphics.CastD3D9().GetDevice();
}
void D3D9PersistentMesh::Init(GraphicsDevice &graphics, const BaseMesh &M)
{
_Mesh = M;
Reset(graphics);
}
void D3D9PersistentMesh::Render()
{
_D3DMesh.Render();
}
#endif