Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# deFont_priv.hpp

Go to the documentation of this file.

    00001 ///////////////////////////////////////////////////////////////////////////////
    00002 /// @file deFont_Priv.hpp
    00003 ///
    00004 /// @brief private class for text display
    00005 ///
    00006 /// @author Lightning, Assassin
    00007 ///
    00008 /// This file is the intellectual property of Novus Delta, LLC.. Usage of the
    00009 /// contents of this file is subject to the Destiny3D Member License which
    00010 /// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
    00011 ///
    00012 /// This file is distributed "AS IS" without warranty of any kind.  Novus
    00013 /// Delta, LLC. does not guarantee the fitness of the contents of this file
    00014 /// for any particular purpose.
    00015 ///
    00016 /// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
    00017 ///
    00018 /// <hr>
    00019 ///                                 Change History
    00020 /// <hr>
    00021 ///
    00022 /// @date Jan 2002
    00023 /// @author Lightning
    00024 /// @remarks Creation
    00025 ///
    00026 /// @date Feb 2002
    00027 /// @author Assassin
    00028 /// @remarks Cleanup and modifications
    00029 ///
    00030 ///////////////////////////////////////////////////////////////////////////////
    00031
    00032 #ifndef DEFONT_PRIV_HPP
    00033 #define DEFONT_PRIV_HPP
    00034
    00035 #include "deFont.hpp"
    00036 #include "de2D_priv.hpp"
    00037
    00038 class deFont : public IdeFont
    00039 {
    00040 protected:
    00041     ~deFont();
    00042 public:
    00043
    00044     int Release();
    00045
    00046     //constructors/destructor
    00047     deFont();
    00048     deFont(const char *Font, long Height, long FontFlags, long ForeColor);
    00049     deFont(IdeBitmapProxy *Font, long Height, long *Widths);
    00050
    00051     //functions to modify the font
    00052     deBoolean SetFont(const char *Font, long Height, long FontFlags);
    00053     deBoolean SetFont(IdeBitmapProxy *Font, long Height, long *Widths);
    00054
    00055     //functions to change 1 font setting at a time
    00056     deBoolean SetColor(deARGB Color);
    00057
    00058     //allow scaling of a font so 1 font can be set but used for multiple sizes
    00059     deBoolean SetScale(deDouble Scale);
    00060
    00061     //print 2d text
    00062     deFloat GetStringWidth(char * String);
    00063     deFloat GetStringHeight(char * String);
    00064 //  deBoolean Print2D(deRect *Rect, deDouble X, deDouble Y, int DisplayFlags, char *Format, ...);
    00065     Ide2DObject * Print2D(IdeDriver * Driver, deRect *ClipRect, deDouble X, deDouble Y, deDouble Depth, int *pStringWidth, int *pStringHeight, int DisplayFlags, const char *Format, ...);
    00066
    00067     //print 3d text
    00068     deBoolean Print3D(deVertex *Position, deVertex *Rotation, deDouble Depth, int DisplayFlags, const char *Format, ...);
    00069
    00070 private:
    00071     //struct for holding renderstate values
    00072     typedef struct RenderStateValue
    00073     {
    00074         IdeDriver::RenderState      State;
    00075         long                        Value;
    00076     };
    00077
    00078     void InitData();
    00079     IdeVertexBuffer *deFont::CreateVertexBuffer(deDouble X, deDouble Y, deDouble Depth, int *pStringWidth, int *pStringHeight, int DisplayFlags, char *Buffer);
    00080     IdeRenderTexture*   GetTextureState();
    00081
    00082     deARGB              m_Color;            //fore color of the font
    00083     IdeBitmapProxy *    m_FontTexture;      //the actual bitmap/texture that holds the font
    00084     deDouble            m_Scale;            //scale of the font
    00085     deDouble            m_InternalScale;    //internal scale for the height
    00086     deFloatRect         m_Coords[224];      //points of where each letter sits, 224 letters
    00087                                             //to allow for other languages (256 - 32)
    00088     //void *                m_FontBitmapBits;   //pointer to the bitmap in memory
    00089     IdeRenderTexture *  m_TextureState;     //the texture state used for rendering
    00090 };
    00091
    00092 #endif
    00093