#ifndef STREAMDATA_H
#define STREAMDATA_H

namespace Salamander
{

/*
** Stream Data are classes with members formatted in such a way that they can
** be passed directly to the renderer for fast drawing. All StreamData classes
** should call registerStreamData() before their constructor declaration, and
** defineUniqueId() before their constructor implementation.
*/

/*
** StreamData is an
** Abstract Base Class and should be subclassed to create uniquely identifiable
** stream types.
*/
class IStreamData
{
public:
	/*
	** TypeId should always be public
	*/
	registerInterfaceUniqueId();

	/*
	** Convert the stream data to an array of floats in memory. This simply returns the datastructure, but
	** advances the pointer past the Id and into the float values.
	*/
	operator float*() const;

protected:
	/*
	** Constructor
	*/
	IStreamData();

};

/*
** 3D Vertex Data.
*/
class StreamVertex : public IStreamData
{
public:
	/*
	** Constructor
	*/
	registerStreamData();
	StreamVertex(float x = 0.0f, 
				 float y = 0.0f, 
				 float z = 0.0f);

	/*
	** Location in space.
	*/
	float x_, y_, z_;
};

/*
** Texture Co-ordinates.
*/
class StreamCoordinates : public IStreamData
{
public:
	/*
	** Constructor
	*/
	registerStreamData();
	StreamCoordinates(float u = 0.0f, 
					  float v = 0.0f);

	/*
	** Texture UV coordinates.
	*/
	float u_, v_;
};

/*
** Base Colour.
*/
class StreamColour : public IStreamData
{
public:
	/*
	** Constructor
	*/
	registerStreamData();
	StreamColour(float r = 0.0f, 
				 float g = 0.0f,
				 float b = 0.0f,
				 float a = 0.0f);

	/*
	** Colour.
	*/
	float r_, g_, b_, a_;
};

}

#endif // STREAMDATA_H