K3dFontBmp Class Reference

#include <K3dFontBmp.h>

Inheritance diagram for K3dFontBmp:

K3dMngGraphics K3dMngSystem K3dScene List of all members.

Public Member Functions

 K3dFontBmp (K3dGameData *_pGameData)
 Constructor.
 ~K3dFontBmp (void)
void LoadBmpFonts ()
 Load bmp font from map file.
void SetFrame (const bool _bFrame)
 Set if arrives new frame.
bool GetFrame ()
 Is arrives new frame?
void SetNumLines (const int _iNumLines)
 Set number of lines.
int GetNumLines ()
 Get number of lines.
void SetFirstLine (const float _fFirstLine)
 Set first line.
float GetFirstLine ()
 Get first line.
void SetSpace (const float _fSpace)
 Set space between lines.
float GetSpace ()
 Get space between lines.
void SetRow (const float _fRow)
 Set row position.
float GetRow ()
 Get row position.
void SetDrawFps (const bool _bDrawFps)
 Set draw FPS switch.
bool GetDrawFps ()
 Get draw FPS switch.
void SetCamera (K3dVector3 _kCamera)
 Set camera position.
void SetDrawCamPos (const bool _bDrawCamPos)
 Set draw camera position switch.
bool GetDrawCamPos ()
 Is draw camera position?
void SetDrawNumFaces (const bool _bDrawNumFaces)
 Set draw number of faces.
bool GetDrawNumFaces ()
 Is draw number of faces?
void InitFontBmp ()
 Init bmp font.
void Reset ()
 Reset bmp fonts.
void Destroy ()
 Delete OpenGL display lists for bmp fonts.
void DeleteFontBmp ()
 Delete OpenGL display lists.
void DrawFontBmp ()
void DrawValue (const char *_strComment)
 Draw string value to next lines.
void DrawValue (const char *_strComment, const K3dVector3 _kVec)
 Draw 3d vector value to next lines.
void DrawValue (const char *_strComment, const K3dVector4 _kVec)
 Draw 4d vector value to next lines.
void DrawValue (const char *_strComment, const float _fVal)
 Draw float value to next lines.
void DrawValue (const char *_strComment, const int _iVal)
 Draw int value to next lines.
void DrawValue (const K3dMatrix _kMat)
 Draw matrix value to next lines.
void ResetLines ()
 Reset number of lines.
void LoadTexture (const K3dString &_strFileName)
 Load font textures.
void CreateDisplayLists (bool _bItalic)
 Create font display lists and set normal or italic font.
void ResetValues ()
 Reset any values.

Private Member Functions

void Print (const char *_strIn, K3dVector3 _kColor)
 Print string.
void DrawFps ()
 Draw actual FPS.
void DrawCameraPosition ()
 Vykresl�aktu�n�pozici kamery.
void DrawNumFaces ()
 Draw number of drawing faces in view.

Private Attributes

K3dGameDatam_pGameData
 Global game data, data centered game system.
int m_iNumDraw
TDraw m_atDraw [64]
GLuint m_uiTextureId
 Texture index.
GLuint m_uiBase
 Texture display list base.
bool m_bNewFrame
 Check if arrives new frame.
int m_iNumLines
 Number of lines.
int m_iLine
 Index of line.
float m_fFirstLine
 First line position.
float m_afLine [64]
 Line array.
float m_fSpace
 Space between lines.
float m_fRow
 Row position.
bool m_bDraw
 Switch if draw function enabled.
bool m_bDrawFps
 Draw fps switch.
K3dVector3 m_kCamera
 Camera object.
bool m_bDrawCamPos
 Camera position switch.
bool m_bDrawNumFaces
 Number of faces switch.
int m_iFps
int m_iFpsTmp
int m_iFrame

Classes

struct  TDraw

Detailed Description

Definition at line 45 of file K3dFontBmp.h.


Constructor & Destructor Documentation

K3dFontBmp::K3dFontBmp ( K3dGameData _pGameData  ) 

Constructor.

Parameters:
_pGameData Pointer to global game data
See also:
K3dGameData

Definition at line 41 of file K3dFontBmp.cpp.

References m_iFps, m_iFpsTmp, m_iFrame, and m_pGameData.

K3dFontBmp::~K3dFontBmp ( void   ) 

Definition at line 49 of file K3dFontBmp.cpp.

References K_NUM_DISPLAY_LISTS.


Member Function Documentation

void K3dFontBmp::Print ( const char *  _str,
K3dVector3  _kColor 
) [private]

Print string.

Parameters:
_str String what is print to the screen
_kColor String color

Definition at line 217 of file K3dFontBmp.cpp.

References K3dOptionsData::GetGraphicOption(), K3dVector3::GetVectorArray(), TGraphicOption::iHeight, TGraphicOption::iWidth, K3dFontBmp::TDraw::kColor, m_afLine, m_atDraw, m_bDraw, m_bNewFrame, m_iLine, m_iNumDraw, m_iNumLines, m_pGameData, and m_uiTextureId.

Referenced by DrawCameraPosition(), DrawFontBmp(), DrawFps(), DrawNumFaces(), and DrawValue().

void K3dFontBmp::DrawFps (  )  [private]

Draw actual FPS.

Definition at line 326 of file K3dFontBmp.cpp.

References TTextureOption::bMultitexture, K3dTimer::GetFPS(), K3dOptionsData::GetTextureOption(), K3dSceneData::GetTimer(), m_iFps, m_iFpsTmp, m_iFrame, m_pGameData, Print(), and K3dVector3::Set().

Referenced by DrawFontBmp().

void K3dFontBmp::DrawCameraPosition (  )  [inline, private]

Vykresl�aktu�n�pozici kamery.

Definition at line 267 of file K3dFontBmp.h.

References TTextureOption::bMultitexture, K3dSafePointer< _T >::Get(), K3dCameraData::GetActiveCamId(), K3dGameData::GetCameraObjSP(), K3dCamera::GetCameraPos(), K3dOptionsData::GetTextureOption(), m_pGameData, Print(), and K3dVector3::Set().

Referenced by DrawFontBmp().

void K3dFontBmp::DrawNumFaces (  )  [inline, private]

Draw number of drawing faces in view.

Definition at line 312 of file K3dFontBmp.h.

References TTextureOption::bMultitexture, K3dOptionsData::GetTextureOption(), m_pGameData, K3dSceneData::NumDrawTriangles(), Print(), and K3dVector3::Set().

Referenced by DrawFontBmp().

void K3dFontBmp::LoadBmpFonts (  ) 

Load bmp font from map file.

Definition at line 56 of file K3dFontBmp.cpp.

References K3dString::AddNumber(), K3dTextureBuild::FindTextureId(), K3dSafePointer< _T >::Get(), K3dGameData::GetBmpFontObjSP(), K3dTexture::GetId(), K3dSceneData::GetLua(), K3dString::GetString(), K3dSceneData::GetTextureBuild(), K3dGameData::GetTextureObjSP(), InitFontBmp(), K_STR_BMPFONT, K_STR_NAME, K_STR_NUM_BMP_FONTS, K_STR_TEXTURE_TABLE, K3dLua::LuaError(), K3dLua::LuaGetFieldString(), K3dLua::LuaGetGlobal(), K3dLua::LuaIsNumber(), K3dLua::LuaIsTable(), K3dLua::LuaToNumber(), m_pGameData, and K3dSafePointer< _T >::New().

Referenced by K3dMngGraphics::InitMngGraphics().

void K3dFontBmp::SetFrame ( const bool  _bFrame  )  [inline]

Set if arrives new frame.

Parameters:
_bFrame Arrive new frame switch

Definition at line 93 of file K3dFontBmp.h.

References m_bNewFrame.

Referenced by K3dMngGraphics::DrawMngGraphics().

bool K3dFontBmp::GetFrame (  )  [inline]

Is arrives new frame?

Return values:
m_bNewFrame Arrives new frame switch

Definition at line 99 of file K3dFontBmp.h.

References m_bNewFrame.

void K3dFontBmp::SetNumLines ( const int  _iNumLines  )  [inline]

Set number of lines.

Parameters:
_iNumLines Number of lines

Definition at line 106 of file K3dFontBmp.h.

References m_iNumLines.

int K3dFontBmp::GetNumLines (  )  [inline]

Get number of lines.

Return values:
m_iNumLines Number of lines

Definition at line 112 of file K3dFontBmp.h.

References m_iNumLines.

void K3dFontBmp::SetFirstLine ( const float  _fFirstLine  )  [inline]

Set first line.

Parameters:
_fFirstLine First line position

Definition at line 119 of file K3dFontBmp.h.

References m_fFirstLine.

float K3dFontBmp::GetFirstLine (  )  [inline]

Get first line.

Return values:
m_fFirstLine First line position

Definition at line 125 of file K3dFontBmp.h.

References m_fFirstLine.

void K3dFontBmp::SetSpace ( const float  _fSpace  )  [inline]

Set space between lines.

Parameters:
_fSpace Space between lines

Definition at line 132 of file K3dFontBmp.h.

References m_fSpace.

float K3dFontBmp::GetSpace (  )  [inline]

Get space between lines.

Return values:
m_fSpace Space between lines

Definition at line 138 of file K3dFontBmp.h.

References m_fSpace.

void K3dFontBmp::SetRow ( const float  _fRow  )  [inline]

Set row position.

Parameters:
_fRow Row position

Definition at line 145 of file K3dFontBmp.h.

References m_fRow.

float K3dFontBmp::GetRow (  )  [inline]

Get row position.

Return values:
m_fRow Row position

Definition at line 151 of file K3dFontBmp.h.

References m_fRow.

void K3dFontBmp::SetDrawFps ( const bool  _bDrawFps  )  [inline]

Set draw FPS switch.

Parameters:
_bDrawFps FPS switch

Definition at line 158 of file K3dFontBmp.h.

References m_bDrawFps.

Referenced by Reset().

bool K3dFontBmp::GetDrawFps (  )  [inline]

Get draw FPS switch.

Return values:
m_bDrawFps Is draw FPS?

Definition at line 165 of file K3dFontBmp.h.

References m_bDrawFps.

void K3dFontBmp::SetCamera ( K3dVector3  _kCamera  )  [inline]

Set camera position.

Parameters:
_kCamera Camera position
See also:
K3dVector3

Definition at line 173 of file K3dFontBmp.h.

References m_kCamera.

void K3dFontBmp::SetDrawCamPos ( const bool  _bDrawCamPos  )  [inline]

Set draw camera position switch.

Parameters:
_bDrawCamPos Draw camera position switch

Definition at line 180 of file K3dFontBmp.h.

References m_bDrawCamPos.

Referenced by Reset().

bool K3dFontBmp::GetDrawCamPos (  )  [inline]

Is draw camera position?

Return values:
m_bDrawCamPos Draw camera position switch

Definition at line 187 of file K3dFontBmp.h.

References m_bDrawCamPos.

void K3dFontBmp::SetDrawNumFaces ( const bool  _bDrawNumFaces  )  [inline]

Set draw number of faces.

Parameters:
_bDrawNumFaces Number of faces switch

Definition at line 194 of file K3dFontBmp.h.

References m_bDrawNumFaces.

Referenced by Reset().

bool K3dFontBmp::GetDrawNumFaces (  )  [inline]

Is draw number of faces?

Definition at line 200 of file K3dFontBmp.h.

References m_bDrawNumFaces.

void K3dFontBmp::InitFontBmp (  ) 

Init bmp font.

Definition at line 108 of file K3dFontBmp.cpp.

References Reset().

Referenced by LoadBmpFonts().

void K3dFontBmp::Reset (  ) 

Reset bmp fonts.

Definition at line 135 of file K3dFontBmp.cpp.

References TFontBmpOption::bDrawCamPos, TFontBmpOption::bDrawFps, TFontBmpOption::bDrawNumFaces, TFontBmpOption::bItalic, CreateDisplayLists(), K3dOptionsData::GetFontBmpOption(), K3dOptionsData::GetGraphicOption(), K3dSceneData::GetPath(), TGraphicOption::iHeight, K_FONT_SPACE, K_PATH_APP, LoadTexture(), m_afLine, m_bDraw, m_bDrawCamPos, m_bDrawFps, m_bDrawNumFaces, m_bNewFrame, m_fFirstLine, m_fRow, m_fSpace, m_iLine, m_iNumDraw, m_iNumLines, m_pGameData, m_uiBase, m_uiTextureId, SetDrawCamPos(), SetDrawFps(), SetDrawNumFaces(), and TFontBmpOption::strFont.

Referenced by Destroy(), and InitFontBmp().

void K3dFontBmp::Destroy (  ) 

Delete OpenGL display lists for bmp fonts.

Definition at line 127 of file K3dFontBmp.cpp.

References K_NUM_DISPLAY_LISTS, m_uiBase, and Reset().

void K3dFontBmp::DeleteFontBmp (  ) 

Delete OpenGL display lists.

Definition at line 115 of file K3dFontBmp.cpp.

References K3dSafePointer< _T >::Delete(), K3dSafePointer< _T >::Get(), K3dGameData::GetBmpFontObjSP(), K3dSafePointer< _T >::GetNum(), K_NUM_DISPLAY_LISTS, and m_pGameData.

Referenced by K3dMngGraphics::DeleteMngGraphics().

void K3dFontBmp::DrawFontBmp (  ) 

Definition at line 371 of file K3dFontBmp.cpp.

References DrawCameraPosition(), DrawFps(), DrawNumFaces(), K3dSafePointer< _T >::Get(), K3dGameData::GetBmpFontObjSP(), K3dSafePointer< _T >::GetNum(), m_atDraw, m_bDraw, m_bDrawCamPos, m_bDrawFps, m_bDrawNumFaces, m_iNumDraw, m_pGameData, m_uiTextureId, and Print().

Referenced by K3dMngGraphics::DrawMngGraphics().

void K3dFontBmp::DrawValue ( const char *  _strComment  ) 

Draw string value to next lines.

Parameters:
_strComment Value string

Definition at line 297 of file K3dFontBmp.cpp.

References TTextureOption::bMultitexture, K3dOptionsData::GetTextureOption(), m_pGameData, Print(), and K3dVector3::Set().

Referenced by K3dVM::Print(), and K3dVM::PrintValue().

void K3dFontBmp::DrawValue ( const char *  _strComment,
const K3dVector3  _kVec 
) [inline]

Draw 3d vector value to next lines.

Parameters:
_strComment Comment string
_kVec 3d vector value to draw

Definition at line 343 of file K3dFontBmp.h.

References TTextureOption::bMultitexture, K3dOptionsData::GetTextureOption(), K3dVector3::GetX(), K3dVector3::GetY(), K3dVector3::GetZ(), m_pGameData, Print(), and K3dVector3::Set().

void K3dFontBmp::DrawValue ( const char *  _strComment,
const K3dVector4  _kVec 
) [inline]

Draw 4d vector value to next lines.

Parameters:
_strComment Comment string
_kVec 4d vector value to draw

Definition at line 371 of file K3dFontBmp.h.

References TTextureOption::bMultitexture, K3dOptionsData::GetTextureOption(), K3dVector4::GetVector(), m_pGameData, Print(), and K3dVector3::Set().

void K3dFontBmp::DrawValue ( const char *  _strComment,
const float  _fVal 
) [inline]

Draw float value to next lines.

Definition at line 405 of file K3dFontBmp.h.

References TTextureOption::bMultitexture, K3dOptionsData::GetTextureOption(), m_pGameData, Print(), and K3dVector3::Set().

void K3dFontBmp::DrawValue ( const char *  _strComment,
const int  _iVal 
) [inline]

Draw int value to next lines.

Definition at line 433 of file K3dFontBmp.h.

References TTextureOption::bMultitexture, K3dOptionsData::GetTextureOption(), m_pGameData, Print(), and K3dVector3::Set().

void K3dFontBmp::DrawValue ( const K3dMatrix  _kMat  )  [inline]

Draw matrix value to next lines.

Definition at line 461 of file K3dFontBmp.h.

References TTextureOption::bMultitexture, K3dMatrix::GetMatrix(), K3dOptionsData::GetTextureOption(), m_pGameData, Print(), and K3dVector3::Set().

void K3dFontBmp::ResetLines (  )  [inline]

Reset number of lines.

Definition at line 227 of file K3dFontBmp.h.

References m_iLine, and m_iNumLines.

Referenced by ResetValues().

void K3dFontBmp::LoadTexture ( const K3dString _strFileName  )  [inline]

Load font textures.

Definition at line 257 of file K3dFontBmp.h.

Referenced by Reset().

void K3dFontBmp::CreateDisplayLists ( bool  _bItalic  ) 

Create font display lists and set normal or italic font.

Definition at line 179 of file K3dFontBmp.cpp.

References K_NUM_DISPLAY_LISTS, and m_uiBase.

Referenced by Reset().

void K3dFontBmp::ResetValues (  )  [inline]

Reset any values.

Definition at line 239 of file K3dFontBmp.h.

References m_bNewFrame, and ResetLines().

Referenced by K3dMngGraphics::DrawMngGraphics().


Member Data Documentation

K3dGameData* K3dFontBmp::m_pGameData [private]

Global game data, data centered game system.

Reimplemented in K3dScene, K3dMngGraphics, and K3dMngSystem.

Definition at line 47 of file K3dFontBmp.h.

Referenced by DeleteFontBmp(), DrawCameraPosition(), DrawFontBmp(), DrawFps(), DrawNumFaces(), DrawValue(), K3dFontBmp(), LoadBmpFonts(), Print(), and Reset().

int K3dFontBmp::m_iNumDraw [private]

Definition at line 54 of file K3dFontBmp.h.

Referenced by DrawFontBmp(), Print(), and Reset().

TDraw K3dFontBmp::m_atDraw[64] [private]

Definition at line 55 of file K3dFontBmp.h.

Referenced by DrawFontBmp(), and Print().

GLuint K3dFontBmp::m_uiTextureId [private]

Texture index.

Definition at line 58 of file K3dFontBmp.h.

Referenced by DrawFontBmp(), Print(), and Reset().

GLuint K3dFontBmp::m_uiBase [private]

Texture display list base.

Definition at line 59 of file K3dFontBmp.h.

Referenced by CreateDisplayLists(), Destroy(), and Reset().

bool K3dFontBmp::m_bNewFrame [private]

Check if arrives new frame.

Definition at line 60 of file K3dFontBmp.h.

Referenced by GetFrame(), Print(), Reset(), ResetValues(), and SetFrame().

int K3dFontBmp::m_iNumLines [private]

Number of lines.

Definition at line 61 of file K3dFontBmp.h.

Referenced by GetNumLines(), Print(), Reset(), ResetLines(), and SetNumLines().

int K3dFontBmp::m_iLine [private]

Index of line.

Definition at line 62 of file K3dFontBmp.h.

Referenced by Print(), Reset(), and ResetLines().

float K3dFontBmp::m_fFirstLine [private]

First line position.

Definition at line 63 of file K3dFontBmp.h.

Referenced by GetFirstLine(), Reset(), and SetFirstLine().

float K3dFontBmp::m_afLine[64] [private]

Line array.

Definition at line 64 of file K3dFontBmp.h.

Referenced by Print(), and Reset().

float K3dFontBmp::m_fSpace [private]

Space between lines.

Definition at line 65 of file K3dFontBmp.h.

Referenced by GetSpace(), Reset(), and SetSpace().

float K3dFontBmp::m_fRow [private]

Row position.

Definition at line 66 of file K3dFontBmp.h.

Referenced by GetRow(), Reset(), and SetRow().

bool K3dFontBmp::m_bDraw [private]

Switch if draw function enabled.

Definition at line 67 of file K3dFontBmp.h.

Referenced by DrawFontBmp(), Print(), and Reset().

bool K3dFontBmp::m_bDrawFps [private]

Draw fps switch.

Definition at line 68 of file K3dFontBmp.h.

Referenced by DrawFontBmp(), GetDrawFps(), Reset(), and SetDrawFps().

K3dVector3 K3dFontBmp::m_kCamera [private]

Camera object.

Definition at line 69 of file K3dFontBmp.h.

Referenced by SetCamera().

bool K3dFontBmp::m_bDrawCamPos [private]

Camera position switch.

Definition at line 70 of file K3dFontBmp.h.

Referenced by DrawFontBmp(), GetDrawCamPos(), Reset(), and SetDrawCamPos().

bool K3dFontBmp::m_bDrawNumFaces [private]

Number of faces switch.

Definition at line 71 of file K3dFontBmp.h.

Referenced by DrawFontBmp(), GetDrawNumFaces(), Reset(), and SetDrawNumFaces().

int K3dFontBmp::m_iFps [private]

Definition at line 72 of file K3dFontBmp.h.

Referenced by DrawFps(), and K3dFontBmp().

int K3dFontBmp::m_iFpsTmp [private]

Definition at line 73 of file K3dFontBmp.h.

Referenced by DrawFps(), and K3dFontBmp().

int K3dFontBmp::m_iFrame [private]

Definition at line 74 of file K3dFontBmp.h.

Referenced by DrawFps(), and K3dFontBmp().


The documentation for this class was generated from the following files:
Generated on Thu Aug 16 23:53:31 2007 for K3dEngine by  doxygen 1.5.0