///////////////////////////////////////////////////////////////////////////////
/// @file deSurface_priv.hpp
///
/// @brief Surface attributes for rendering with
///
/// @author Assassin
///
/// This file is the intellectual property of Novus Delta, LLC.. Usage of the
/// contents of this file is subject to the Destiny3D Member License which
/// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
///
/// This file is distributed "AS IS" without warranty of any kind.  Novus
/// Delta, LLC. does not guarantee the fitness of the contents of this file
/// for any particular purpose.
///
/// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
///
/// <hr>
///                                 Change History
/// <hr>
///
/// @date June 2003
/// @author Assassin
/// @remarks Creation
///
///////////////////////////////////////////////////////////////////////////////

#ifndef DESURFACE_PRIV_HPP
#define DESURFACE_PRIV_HPP

#include "deSurface.hpp"
#include "deWorld_Helper.hpp"
#include "deFunctors.hpp"
#include "deHash.hpp"
#include "deString.hpp"

class deSurface : public deWorldObject, virtual public IdeSurface
{
protected:
	~deSurface();
public:
	deSurface();
	
	WorldObjectClassDef;
	void* GetWOInterface(long interface_id);
	deBoolean DeSerializeLoad();

	// begin <new>
/*
public:
	IdeShader* 

private:
	IdeShader* 
*/
	// end <new>

	// begin <deprecated>
public:
	void	SetRenderTexture(IdeRenderTexture* pRT);
	void	SetRenderMaterial(IdeRenderMaterial* pRM);
	IdeRenderTexture*	GetRenderTexture();
	IdeRenderMaterial*	GetRenderMaterial();
private:
	IdeRenderTexture*	m_RenderTexture;
	IdeRenderMaterial*	m_RenderMaterial;
	deIDPair m_TextureID, m_MaterialID;
	// end <deprecated>
};

class deTextureSet : virtual public IdeTextureSet, public deRefCountBase//, public deWorldObject
{
protected:
	~deTextureSet();
public:
	deTextureSet();
/*
	WorldObjectClassDef;
	void* GetWOInterface(long interface_id);
	deBoolean DeSerializeLoad();
	*/
	u32	GetNumTextures() const;
	const char* GetNameByIndex(s32 index) const;
	s32 GetIndexByName(const char* name) const;
	IdeBitmapProxy* GetTextureByIndex(s32 index) const;
	IdeBitmapProxy* GetTextureByName(const char* name) const;

	deBoolean AddTextureName(const char* name, s32* index);
	deBoolean SetTextureByIndex(s32 index, IdeBitmapProxy* tex);
	deBoolean SetTextureByName(const char* name, IdeBitmapProxy* tex);

	IdeTextureSet*	CloneTextureSet(const char** names);

	static void Test();

protected:
	deBoolean AddTextureName(deString2 str, s32* index);
	s32 GetIndexByName(deString2 str) const;

private:
	deTHashFunctor<s32, deString2>	m_NameIndices;
	deTArray<IdeBitmapProxy*>		m_Bitmaps;
	deTArray<deString2>				m_Names;
};

#endif
