18#ifndef INCLUDED_TEXTRENDERER
19#define INCLUDED_TEXTRENDERER
74 void PrintfAt(
float x,
float y,
const wchar_t* fmt, ...);
86 void Put(
float x,
float y,
const wchar_t* buf);
93 void Put(
float x,
float y,
const char* buf);
101 void Put(
float x,
float y,
const std::wstring* buf);
162 void PutString(
float x,
float y,
const std::wstring* buf,
bool owned);
Storage for a bitmap font.
Definition: Font.h:27
Definition: Matrix3D.h:34
Rectangle class used for screen rectangles.
Definition: Rect.h:31
Interned 8-bit strings.
Definition: CStrIntern.h:38
Definition: TextRenderer.h:34
void PrintfAdvance(const wchar_t *fmt,...)
Print formatted text at (0,0) under the current transform, and advance the transform by the width of ...
Definition: TextRenderer.cpp:84
void Render(Renderer::Backend::IDeviceCommandContext *deviceCommandContext, Renderer::Backend::IShaderProgram *shader, const CVector2D &transformScale, const CVector2D &translation)
Render all of the previously printed text calls.
Definition: TextRenderer.cpp:196
void SetClippingRect(const CRect &rect)
Set clipping rectangle, in pre-transform coordinates (i.e.
Definition: TextRenderer.cpp:60
CVector2D m_Translate
Definition: TextRenderer.h:164
CRect m_Clipping
Definition: TextRenderer.h:165
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.
Definition: TextRenderer.cpp:115
const CVector2D & GetTranslate() const
Definition: TextRenderer.h:43
void Put(float x, float y, const wchar_t *buf)
Print text at (x,y) under the current transform.
Definition: TextRenderer.cpp:124
void SetCurrentColor(const CColor &color)
Set the color for subsequent print calls.
Definition: TextRenderer.cpp:65
void SetCurrentFont(CStrIntern font)
Set the font for subsequent print calls.
Definition: TextRenderer.cpp:74
std::shared_ptr< CFont > m_Font
Definition: TextRenderer.h:169
void PrintfAt(float x, float y, const wchar_t *fmt,...)
Print formatted text at (x,y) under the current transform.
Definition: TextRenderer.cpp:100
CColor m_Color
Definition: TextRenderer.h:167
void PutString(float x, float y, const std::wstring *buf, bool owned)
Definition: TextRenderer.cpp:148
void Translate(float x, float y)
Definition: TextRenderer.cpp:54
void ResetTranslate(const CVector2D &translate=CVector2D{})
Reset the text transform to the default, with (0,0) in the top-left corner.
Definition: TextRenderer.cpp:48
CTextRenderer()
Definition: TextRenderer.cpp:41
std::list< SBatch > m_Batches
Definition: TextRenderer.h:173
bool m_Dirty
Definition: TextRenderer.h:171
CStrIntern m_FontName
Definition: TextRenderer.h:168
Definition: Vector2D.h:32
Definition: IDeviceCommandContext.h:42
IShaderProgram is a container for multiple shaders of different types.
Definition: IShaderProgram.h:81
A string (optionally owned by this object, or else pointing to an externally-owned string) with a pos...
Definition: TextRenderer.h:119
~SBatchRun()
Definition: TextRenderer.h:137
float x
Definition: TextRenderer.h:143
bool owned
Definition: TextRenderer.h:146
const std::wstring * text
Definition: TextRenderer.h:145
SBatchRun()
Definition: TextRenderer.h:123
SBatchRun(const SBatchRun &str)
Definition: TextRenderer.h:128
float y
Definition: TextRenderer.h:143
SBatchRun & operator=(const SBatchRun &)
A list of SBatchRuns, with a single font/color/transform, to be rendered in a single GL call.
Definition: TextRenderer.h:154
CVector2D translate
Definition: TextRenderer.h:156
std::list< SBatchRun > runs
Definition: TextRenderer.h:159
CColor color
Definition: TextRenderer.h:157
size_t chars
Definition: TextRenderer.h:155
std::shared_ptr< CFont > font
Definition: TextRenderer.h:158
Definition: TextRenderer.cpp:186