Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Private Attributes | List of all members
CTextRenderer Class Reference

#include <TextRenderer.h>

Classes

struct  SBatch
 

Public Member Functions

 CTextRenderer (const CShaderProgramPtr &shader)
 
void ResetTransform ()
 Reset the text transform to the default, with (0,0) in the top-left of the screen. More...
 
CMatrix3D GetTransform ()
 
void SetTransform (const CMatrix3D &transform)
 
void Translate (float x, float y, float z)
 
void Color (const CColor &color)
 Set the color for subsequent print calls. More...
 
void Color (float r, float g, float b, float a=1.0)
 Set the color for subsequent print calls. More...
 
void Font (const CStrW &font)
 Set the font for subsequent print calls. More...
 
void PrintfAdvance (const wchar_t *fmt,...)
 Print formatted text at (0,0) under the current transform, and advance the transform by the width of the text. More...
 
void PrintfAt (float x, float y, const wchar_t *fmt,...)
 Print formatted text at (x,y) under the current transform. More...
 
void PutAdvance (const wchar_t *buf)
 Print text at (0,0) under the current transform, and advance the transform by the width of the text. More...
 
void Put (float x, float y, const wchar_t *buf)
 Print text at (x,y) under the current transform, and advance the transform by the width of the text. More...
 
void Render ()
 Render all of the previously printed text calls. More...
 

Private Attributes

CShaderProgramPtr m_Shader
 
CMatrix3D m_Transform
 
CColor m_Color
 
shared_ptr< CFontm_Font
 
std::map< CStrW, shared_ptr
< CFont > > 
m_Fonts
 
std::vector< SBatchm_Batches
 

Detailed Description

Definition at line 28 of file TextRenderer.h.

Constructor & Destructor Documentation

CTextRenderer::CTextRenderer ( const CShaderProgramPtr shader)

Definition at line 29 of file TextRenderer.cpp.

Member Function Documentation

void CTextRenderer::Color ( const CColor color)

Set the color for subsequent print calls.

Definition at line 65 of file TextRenderer.cpp.

void CTextRenderer::Color ( float  r,
float  g,
float  b,
float  a = 1.0 
)

Set the color for subsequent print calls.

Definition at line 70 of file TextRenderer.cpp.

void CTextRenderer::Font ( const CStrW &  font)

Set the font for subsequent print calls.

Definition at line 75 of file TextRenderer.cpp.

CMatrix3D CTextRenderer::GetTransform ( )

Definition at line 48 of file TextRenderer.cpp.

void CTextRenderer::PrintfAdvance ( const wchar_t fmt,
  ... 
)

Print formatted text at (0,0) under the current transform, and advance the transform by the width of the text.

Definition at line 83 of file TextRenderer.cpp.

void CTextRenderer::PrintfAt ( float  x,
float  y,
const wchar_t fmt,
  ... 
)

Print formatted text at (x,y) under the current transform.

Does not alter the current transform.

Definition at line 99 of file TextRenderer.cpp.

void CTextRenderer::Put ( float  x,
float  y,
const wchar_t buf 
)

Print text at (x,y) under the current transform, and advance the transform by the width of the text.

Definition at line 123 of file TextRenderer.cpp.

void CTextRenderer::PutAdvance ( const wchar_t buf)

Print text at (0,0) under the current transform, and advance the transform by the width of the text.

Definition at line 114 of file TextRenderer.cpp.

void CTextRenderer::Render ( )

Render all of the previously printed text calls.

Definition at line 146 of file TextRenderer.cpp.

void CTextRenderer::ResetTransform ( )

Reset the text transform to the default, with (0,0) in the top-left of the screen.

Definition at line 37 of file TextRenderer.cpp.

void CTextRenderer::SetTransform ( const CMatrix3D transform)

Definition at line 53 of file TextRenderer.cpp.

void CTextRenderer::Translate ( float  x,
float  y,
float  z 
)

Definition at line 58 of file TextRenderer.cpp.

Member Data Documentation

std::vector<SBatch> CTextRenderer::m_Batches
private

Definition at line 106 of file TextRenderer.h.

CColor CTextRenderer::m_Color
private

Definition at line 101 of file TextRenderer.h.

shared_ptr<CFont> CTextRenderer::m_Font
private

Definition at line 102 of file TextRenderer.h.

std::map<CStrW, shared_ptr<CFont> > CTextRenderer::m_Fonts
private

Definition at line 104 of file TextRenderer.h.

CShaderProgramPtr CTextRenderer::m_Shader
private

Definition at line 97 of file TextRenderer.h.

CMatrix3D CTextRenderer::m_Transform
private

Definition at line 99 of file TextRenderer.h.


The documentation for this class was generated from the following files: