/* -----------------------------------------------------------------------------
	GSFramework
	Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */


#ifndef	__GPUMATERIAL__
#define __GPUMATERIAL__


		#include "gpu/gpu_material_shader.h"


namespace GS {
	namespace GPU {
		class Renderer;
		struct DrawContext;

//
struct	Material : public Render::Material
{
		Renderer	 &renderer;

enum	SpecularState
{
		SpecularNone		=	0,
		SpecularEnabled,

		SpecularStateCount
};

enum	FogState
{
		FogNone				=	0,
		FogLinear,

		FogStateCount
};

struct	State
{
		SpecularState specular;
		FogState	fog;

		State(FogState _f = FogNone, SpecularState _s = SpecularNone)
		{
			fog = _f;
			specular = _s;
		}
};

		sMaterialShader shader;

		bool		LoadTextureTable(Render::ResourceFactory &, const Core::Material &);

virtual	Render::MaterialShader *GetShader() const { return shader; }

virtual	bool		Create(Render::ResourceFactory &, const Core::Material &);

virtual	bool		ShouldReloadOnDependencyChange(const char *) const;

virtual	Render::Material *Clone() const;

		Material(Renderer &r, const char *name = 0) : Render::Material(name), renderer(r) {}
};

	} // GPU
} // GS


#endif	// __GPUMATERIAL__
