///////////////////////////////////////////////////////////////////////////////
/// @file deFont_Priv.hpp
///
/// @brief private class for text display
///
/// @author Lightning, 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 Jan 2002
/// @author Lightning
/// @remarks Creation
///
/// @date Feb 2002
/// @author Assassin
/// @remarks Cleanup and modifications
///
///////////////////////////////////////////////////////////////////////////////

#ifndef DEFONT_PRIV_HPP
#define DEFONT_PRIV_HPP

#include "deFont.hpp"
#include "de2D_priv.hpp"

class deFont : public IdeFont
{
protected:
	~deFont();
public:

	int Release();
	
	//constructors/destructor
	deFont();
	deFont(const char *Font, long Height, long FontFlags, long ForeColor);
	deFont(IdeBitmapProxy *Font, long Height, long *Widths);
	
	//functions to modify the font
	deBoolean SetFont(const char *Font, long Height, long FontFlags);
	deBoolean SetFont(IdeBitmapProxy *Font, long Height, long *Widths);
	
	//functions to change 1 font setting at a time
	deBoolean SetColor(deARGB Color);
	
	//allow scaling of a font so 1 font can be set but used for multiple sizes
	deBoolean SetScale(deDouble Scale);
	
	//print 2d text
	deFloat GetStringWidth(char * String);
	deFloat GetStringHeight(char * String);
//	deBoolean Print2D(deRect *Rect, deDouble X, deDouble Y, int DisplayFlags, char *Format, ...);
	Ide2DObject * Print2D(IdeDriver * Driver, deRect *ClipRect, deDouble X, deDouble Y, deDouble Depth, int *pStringWidth, int *pStringHeight, int DisplayFlags, const char *Format, ...);
	
	//print 3d text
	deBoolean Print3D(deVertex *Position, deVertex *Rotation, deDouble Depth, int DisplayFlags, const char *Format, ...);
	
private:
	//struct for holding renderstate values
	typedef struct RenderStateValue
	{
		IdeDriver::RenderState		State;
		long						Value;
	};

	void InitData();
	IdeVertexBuffer *deFont::CreateVertexBuffer(deDouble X, deDouble Y, deDouble Depth, int *pStringWidth, int *pStringHeight, int DisplayFlags, char *Buffer);
	IdeRenderTexture*	GetTextureState();
	
	deARGB				m_Color;			//fore color of the font
	IdeBitmapProxy *	m_FontTexture;		//the actual bitmap/texture that holds the font
	deDouble			m_Scale;			//scale of the font
	deDouble			m_InternalScale;	//internal scale for the height
	deFloatRect			m_Coords[224];		//points of where each letter sits, 224 letters
											//to allow for other languages (256 - 32)
	//void *				m_FontBitmapBits;	//pointer to the bitmap in memory
	IdeRenderTexture *	m_TextureState;		//the texture state used for rendering
};

#endif

