Google
Web alhem.net
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

gui::TTFont Class Reference

#include <TTFont.h>

List of all members.

Public Member Functions

 TTFont (const string &, int)
 ~TTFont ()
sge_TTFont * GetFont ()
int GetH ()
void SetH (int)
void GetRect (const string &, SDL_Rect &)

Private Attributes

sge_TTFont * m_font
int m_h

Static Private Attributes

bool m_init = false


Constructor & Destructor Documentation

gui::TTFont::TTFont const string &  ,
int 
 

Definition at line 52 of file TTFont.cpp.

References m_font, and m_init.

00052 : m_font(NULL) 00053 ,m_h(size) 00054 { 00055 /* Init TTF */ 00056 if (!m_init) 00057 { 00058 m_init = true; 00059 if (sge_TTF_Init()!=0) 00060 { 00061 fprintf(stderr,"TT error: %s\n", SDL_GetError()); 00062 // exit(1); 00063 } 00064 } 00065 00066 m_font = sge_TTF_OpenFont( (char *)filename.c_str(), size); 00067 if (m_font == NULL) 00068 { 00069 fprintf(stderr,"TT error: %s\n", SDL_GetError()); 00070 // exit(1); 00071 } 00072 00073 //sge_TTF_SetFontStyle(m_font, SGE_TTF_ITALIC); 00074 }

gui::TTFont::~TTFont  ) 
 

Definition at line 77 of file TTFont.cpp.

References m_font.

00078 { 00079 /* Clean up */ 00080 if (m_font) 00081 { 00082 sge_TTF_CloseFont(m_font); 00083 } 00084 }


Member Function Documentation

sge_TTFont * gui::TTFont::GetFont  ) 
 

Definition at line 87 of file TTFont.cpp.

References m_font.

00088 { 00089 return m_font; 00090 }

int gui::TTFont::GetH  ) 
 

Definition at line 93 of file TTFont.cpp.

References m_h.

00094 { 00095 return m_h; 00096 }

void gui::TTFont::GetRect const string &  ,
SDL_Rect & 
 

Definition at line 106 of file TTFont.cpp.

References m_font.

00107 { 00108 rect = sge_TTF_TextSize(m_font, (char *)str.c_str() ); 00109 }

void gui::TTFont::SetH int   ) 
 

Definition at line 99 of file TTFont.cpp.

References m_font, and m_h.

00100 { 00101 m_h = h; 00102 sge_TTF_SetFontSize(m_font, h); 00103 }


Member Data Documentation

sge_TTFont* gui::TTFont::m_font [private]
 

Definition at line 40 of file TTFont.h.

Referenced by GetFont(), GetRect(), SetH(), TTFont(), and ~TTFont().

int gui::TTFont::m_h [private]
 

Definition at line 41 of file TTFont.h.

Referenced by GetH(), and SetH().

bool gui::TTFont::m_init = false [static, private]
 

Definition at line 50 of file TTFont.cpp.

Referenced by TTFont().


The documentation for this class was generated from the following files:
Generated for My SDL C++ Gui by doxygen 1.3.6

www.TV-friendship.com
The matchmaking service with an all new twist.

Quantum 'Teleportation'
Some thoughts
Page, code, and content Copyright (C) 2004 by Anders Hedström