#ifndef SDLBLENDMAPPING_H
#define SDLBLENDMAPPING_H

#include "IMapping.h"

namespace Salamander
{

/*
** Blend mode mappings, for geometry rendering. This mapping converts from Salamander codes
** back to SDL codes, which are passed into the renderer.
*/
class SDLBlendMapping : public IMapping<BlendMode::blendMode, unsigned long>
{
public:
	/*
	** Redeclaration of the constructor
	*/
	SDLBlendMapping(BlendMode::blendMode blendMode) : IMapping(blendMode) {};

private:

	/*
	** Add all SamanderBlendMode -> SDLBlendMode mappings to the table.
	*/
	virtual void initialiseMapping() const
	{
		SDLBlendMapping::addMapping(BlendMode::Zero,						GL_ZERO);
		SDLBlendMapping::addMapping(BlendMode::One,							GL_ONE);
		SDLBlendMapping::addMapping(BlendMode::SourceColour,				GL_SRC_COLOR);
		SDLBlendMapping::addMapping(BlendMode::OneMinusSourceColour,		GL_ONE_MINUS_SRC_COLOR);
		SDLBlendMapping::addMapping(BlendMode::DestinationColour,			GL_DST_COLOR);
		SDLBlendMapping::addMapping(BlendMode::OneMinusDestinationColour,	GL_ONE_MINUS_DST_COLOR);
		SDLBlendMapping::addMapping(BlendMode::SourceAlpha,					GL_SRC_ALPHA);
		SDLBlendMapping::addMapping(BlendMode::OneMinusSourceAlpha,			GL_ONE_MINUS_SRC_ALPHA);
		SDLBlendMapping::addMapping(BlendMode::DestinationAlpha,			GL_DST_ALPHA);
		SDLBlendMapping::addMapping(BlendMode::OneMinusDestinationAlpha,	GL_ONE_MINUS_DST_ALPHA);
	}
};

}

#endif // SDLBLENDMAPPING_H