#ifndef CD3DIMAGE_H
#define CD3DIMAGE_H

#include "CImage.h"
#include "d3d8.h"
#include "Assert.h"


//----------------------------------------------------------------//
//	CD3DTexture
//----------------------------------------------------------------//

class CD3DTexture
{
public:

	CD3DTexture(){ fileName = STRINGC(); }
	~CD3DTexture(){  if(lpD3DTexture)lpD3DTexture->Release(); }


	void reloadTexture();
	

	STRINGC				fileName;
	LPDIRECT3DTEXTURE8	lpD3DTexture;
	int					m_width, m_height;

};

//----------------------------------------------------------------//
//	CD3DImage
//----------------------------------------------------------------//

class CD3DImage: public CImage
{

public:

	CD3DImage();
	virtual ~CD3DImage();

	virtual VOID* getScale();
	virtual VOID* getCenter();

	virtual void setScale(float s);
	virtual void setScale(float w, float h);
	
	virtual void mirror();	
	
	virtual float getRotation(){ return rotation; }
	virtual void rotate(int deg);
	
	virtual void setTransparency(int pct);	


	CD3DTexture		Texture;
	POINT			m_offSet;

protected:

	D3DXVECTOR2		scale, center;
	virtual void	setCenter(int x, int y);
	float			rotation;
	int				transparency;
	


};

#endif