#ifndef _VISUALISATION_H_
#define _VISUALISATION_H_

#include "TSingleton.h"

#include <vector>
#include <string>

#include "Colour.h"

class Sprite;
struct SDL_Surface;
typedef unsigned int SpriteID;

class Visualisation : public TSingleton<Visualisation>
{
	public:
	Visualisation();
	~Visualisation();

	void Initialise(const int &w, const int &h, const int &bpp);
	void Shutdown();

	SpriteID CreateSpriteBox(const unsigned int &w, const unsigned int &h, const ColourRGB &borderColour, const ColourRGB &fillColour, unsigned int borderSize = 1);
	SpriteID CreateSpriteBall(const int &radius, const ColourRGB &centreColour, const ColourRGB &outerColour);
	SpriteID CreateSpriteFromFile(char* filename);
	SpriteID CreateSpriteStarryBackground(const unsigned int &w, const unsigned int &h, const unsigned int &numStars);
	SpriteID CreateSpriteText(const std::string &message, const ColourRGB &colour);

	void RemoveSprite(const SpriteID &id);

	void DrawSprite(SpriteID id, const unsigned int &x, const unsigned int &y, unsigned int frame = 0);
	void ClearScreen();

	unsigned int GetSpriteWidth(const SpriteID &id);
	unsigned int GetSpriteHeight(const SpriteID &id);
	
	SDL_Surface* GetScreen() { return m_pScreen; }
	ColourRGB GetTransparencyKey() { return m_transColourKey; }

	private:
	SDL_Surface* m_pScreen;
	ColourRGB m_transColourKey;
	std::vector<Sprite*> m_vSprites;
	SpriteID m_lastUniqueID;

	SpriteID m_clearBG;
};

#endif
