CPPGPGPU Library - Reference (Doxygen)

Main Page | General Use | Reference | Examples Info | Get/Download CPPGPGPU | SF.net Page

TextNode.h

Go to the documentation of this file.
00001 #ifndef _TEXT_NODE_H
00002 #define _TEXT_NODE_H
00003 
00004 #include "OGLParts.h"
00005 #include "Node.h"
00006 
00007 class TextNode : public NodeObject
00008 {
00009 public:
00010     TextNode( const string & sName ) : NodeObject( sName ), NewData(0) { CheckAndLoadFontData(); }
00011     virtual ~TextNode() { if( NewData) delete NewData; }
00012     CLASS_RTTI( TextNode, NodeObject );
00013 
00014     virtual void SetText( const string & sText );
00015 
00016     virtual void Render();
00017 
00018     inline void SetXY( float x, float y ) { m_x = x; m_y = y; }
00019 private:
00020     float m_x, m_y;
00021     static void CheckAndLoadFontData();
00022 
00023     unsigned char * NewData;    //In box for new data.
00024     int Width, RealWidth;
00025     int Height;
00026 
00027     Texture T;      //Final texture
00028 
00029     static unsigned int * FontMapData;
00030     static int FontHeight;
00031     static int FontWidth;
00032 };
00033 
00034 #endif

© 2005-2007 Charles Lohr, Joshua Allen, David Chapman, Andrew Lohr. All material including documentation under the MIT/X11 license.