#ifndef SPRITE
#define SPRITE

#include <stdio.h>
#include <d3dx9.h>

class Sprite
{
	public:
		Sprite();
		~Sprite();

		LPD3DXSPRITE			Object; // The interface to Direct3D Sprite.
		LPDIRECT3DTEXTURE9		Texture; // The sprite texture.

		D3DXCOLOR				Color; // The sprite display color.

		VOID					LoadFromResources(int id); // Loads a sprite from resources.
		VOID					LoadFromFile(LPCSTR file); // Loads a sprite from a specified path.
		VOID					Release(); // Releases all objects.

		VOID					Render(); // Render the sprite.

		VOID					Init(IDirect3DDevice9* device); // Initialise the sprite with the Direct3D Device.

		VOID					SetCenter(); // Sets the sprite to the center of the window.

		D3DSURFACE_DESC			Surface; // The sprite surface properties.
		D3DXVECTOR2				Center; // The sprite center point.
		D3DXVECTOR2				Position; // The sprite position in 2D space.
		D3DXVECTOR2				Scale; // The sprite scale factor. 
		float					Rotation; // The sprite rotation in 2D space.

		BOOL					Show; // If the sprite is visible.

	private:
		IDirect3DDevice9*		Device; // The interface to the Direct3D Device.
		VOID					SetProperties(); // Sets the sprite appearance properties.
};
#endif 
