#include "..\inc\myteapot.h"
#include "myDirect3D.h"
#include "main.h"


myTeapot::myTeapot(void)
{
	m_mesh = NULL;
}

myTeapot::~myTeapot(void)
{
	clean();
}
bool myTeapot::init()
{
	D3DXCreateTeapot(myDirect3D::getDevice(), &m_mesh, NULL);
	myDirect3D::getD3D()->registerModel(this);

	return true;
}
void myTeapot::draw()
{
	D3DXMATRIX t;
	D3DXMatrixScaling(&t,500,500,500);
	myDirect3D::getDevice()->SetTransform(D3DTS_WORLD,&t);
	m_mesh->DrawSubset(0);
}
void myTeapot::clean()
{
	if(m_mesh!=NULL)
	{
		m_mesh->Release();
		m_mesh=NULL;
	}
}