18#ifndef INCLUDED_TEXTRENDERER
19#define INCLUDED_TEXTRENDERER
78 void PrintfAt(
float x,
float y,
const wchar_t* fmt, ...);
90 void Put(
float x,
float y,
const wchar_t* buf);
97 void Put(
float x,
float y,
const char* buf);
105 void Put(
float x,
float y,
const std::wstring* buf);
114 const bool debugFontBox,
const CColor& debugBoxColor);
164 using SBatchRunList = std::list<SBatchRun, PS::Memory::AllocatorAdapter<SBatchRun, PS::Memory::ScopedLinearAllocator>>;
170 void PutString(
float x,
float y,
const std::wstring* buf,
bool owned);
183 using SBatchList = std::list<SBatch, PS::Memory::AllocatorAdapter<SBatch, PS::Memory::ScopedLinearAllocator>>;
Storage for a bitmap font.
Definition: Font.h:50
Rectangle class used for screen rectangles.
Definition: Rect.h:31
Interned 8-bit strings.
Definition: CStrIntern.h:42
Definition: TextRenderer.h:38
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:97
void SetClippingRect(const CRect &rect)
Set clipping rectangle, in pre-transform coordinates (i.e.
Definition: TextRenderer.cpp:73
CVector2D m_Translate
Definition: TextRenderer.h:174
SBatchList m_Batches
Definition: TextRenderer.h:184
CRect m_Clipping
Definition: TextRenderer.h:175
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:128
const CVector2D & GetTranslate() const
Definition: TextRenderer.h:47
void Put(float x, float y, const wchar_t *buf)
Print text at (x,y) under the current transform.
Definition: TextRenderer.cpp:137
void SetCurrentColor(const CColor &color)
Set the color for subsequent print calls.
Definition: TextRenderer.cpp:78
void Render(Renderer::Backend::IDeviceCommandContext *deviceCommandContext, Renderer::Backend::IShaderProgram *shader, const CVector2D &transformScale, const CVector2D &translation, const bool debugFontBox, const CColor &debugBoxColor)
Render all of the previously printed text calls.
Definition: TextRenderer.cpp:207
CFont * m_Font
Definition: TextRenderer.h:179
PS::Memory::ScopedLinearAllocator m_ScopedLinearAllocator
Definition: TextRenderer.h:172
void SetCurrentFont(CStrIntern font, CStrIntern locale)
Set the font for subsequent print calls.
Definition: TextRenderer.cpp:87
void PrintfAt(float x, float y, const wchar_t *fmt,...)
Print formatted text at (x,y) under the current transform.
Definition: TextRenderer.cpp:113
CColor m_Color
Definition: TextRenderer.h:177
void PutString(float x, float y, const std::wstring *buf, bool owned)
Definition: TextRenderer.cpp:161
void Translate(float x, float y)
Definition: TextRenderer.cpp:67
void ResetTranslate(const CVector2D &translate=CVector2D{})
Reset the text transform to the default, with (0,0) in the top-left corner.
Definition: TextRenderer.cpp:61
CTextRenderer()
Definition: TextRenderer.cpp:53
std::list< SBatch, PS::Memory::AllocatorAdapter< SBatch, PS::Memory::ScopedLinearAllocator > > SBatchList
Definition: TextRenderer.h:183
bool m_Dirty
Definition: TextRenderer.h:181
CStrIntern m_FontName
Definition: TextRenderer.h:178
Definition: Vector2D.h:32
Definition: LinearAllocator.h:132
Definition: IDeviceCommandContext.h:46
IShaderProgram is a container for multiple shaders of different types.
Definition: IShaderProgram.h:85
Definition: Canvas2D.h:30
A string (optionally owned by this object, or else pointing to an externally-owned string) with a pos...
Definition: TextRenderer.h:124
~SBatchRun()
Definition: TextRenderer.h:142
float x
Definition: TextRenderer.h:148
bool owned
Definition: TextRenderer.h:151
const std::wstring * text
Definition: TextRenderer.h:150
SBatchRun()
Definition: TextRenderer.h:128
SBatchRun(const SBatchRun &str)
Definition: TextRenderer.h:133
float y
Definition: TextRenderer.h:148
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:159
std::list< SBatchRun, PS::Memory::AllocatorAdapter< SBatchRun, PS::Memory::ScopedLinearAllocator > > SBatchRunList
Definition: TextRenderer.h:164
CVector2D translate
Definition: TextRenderer.h:161
CColor color
Definition: TextRenderer.h:162
SBatchRunList runs
Definition: TextRenderer.h:165
SBatch(PS::Memory::ScopedLinearAllocator &allocator)
Definition: TextRenderer.h:167
size_t chars
Definition: TextRenderer.h:160
CFont * font
Definition: TextRenderer.h:163
Definition: TextRenderer.cpp:197