
#ifndef SPECTRE_GRAPHICS_SPRITE_H
#define SPECTRE_GRAPHICS_SPRITE_H

#include <Spectre/Math/Color.h>
#include "Vertex2D.h"
#include "Renderable.h"

class Texture;

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

	Sprite(const vec2f& pos, const vec2f& size);

	void init();

	void setSize(vec2f size);

	void setColor(const Color& color);

	void setTexture(const Texture& texture);

	void setTextureCoords(const vec2u& pos, const vec2u& size);

	virtual const Texture* getTexture() const;

	virtual const std::vector<Vertex2D>& getVertices() const;

	virtual const std::vector<unsigned short>& getIndices() const;

	virtual const RenderType getRenderType() const { return RenderType_Scene; };

	virtual void render(Renderer2D& renderer) const;

protected :

	void updateGeometry();

	std::vector<unsigned short> m_indicies;

	std::vector<Vertex2D> m_vertices;

	const Texture* m_texture;
};

#endif /* SPECTRE_GRAPHICS_SPRITE_H */
