#ifndef ITEXTURE_H
#define ITEXTURE_H

#include "IAsset.h"

namespace Salamander
{

/*
** Abstract Base Class for texture implementations. Stores the pixel data, but does not store
** material data such as blend mode or colour. This is a type of IAsset so that textures can
** be internally managed by the AssetManager.
*/

class ITexture : public IAsset
{
	/*
	** Textures can only be loaded through the Asset Manager.
	*/
	friend class AssetManager;

public:
	/*
	** Clears up pixel data.
	*/
	registerAsset();
	virtual ~ITexture();

protected:
	/*
	** ITexture cannot be instantiated, because each drawing library uses its own storage method for
	** pixels and bindings. These should be implemented in the library-specific version of the class.
	*/
	ITexture();

	/*
	** Load attempts to load an image file from the given path.
	*/
	virtual bool load(const std::string& name) = 0;

protected:
	/*
	** This points to a location in memory where the raw pixel data is stored.
	*/
	unsigned char* pixels_;
	Vec2 size_;
	PixelFormat pixelFormat_;

};

}

#endif // ITEXTURE_H