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


#ifndef	__NCACHEDRENDERERRESOURCEFACTORY__
#define	__NCACHEDRENDERERRESOURCEFACTORY__


		#include "core/renderer_resource_factory.h"
		#include "container/nlist.h"


namespace GS {
	namespace Render {

/*
	@short	Cached renderer resource factory.
	@author	Emmanuel Julien (ejulien@gsworks.fr)
*/
struct	CachedRendererResourceFactory : public RendererResourceFactory
{
		SharedList <Geometry *> geometries;
		SharedList <Material *> materials;
		SharedList <Texture *> textures;
		SharedList <Shader *> shaders;

virtual	Geometry	*LoadGeometry(const char *, bool bypass_cache = false, Geometry * = 0);
virtual	Material	*LoadMaterial(const char *, bool bypass_cache = false, Material * = 0);
virtual	Texture		*LoadTexture(const char *, bool bypass_cache = false, Texture * = 0);
virtual	Shader		*LoadShader(const char *, bool bypass_cache = false, Shader * = 0);

virtual	void		ListCachedResources();

virtual	uint		GetCachedResourceCount();
virtual	uint		PurgeCache();

		CachedRendererResourceFactory(Renderer &r) : RendererResourceFactory(r) {}
};

	} // Render
} // GS


#endif	// __NCACHEDRENDERERRESOURCEFACTORY__
