DDraceNetwork Docs
CTextRender Class Reference
Inheritance diagram for CTextRender:
[legend]
Collaboration diagram for CTextRender:
[legend]

Public Member Functions

 CTextRender ()
 
void Init () override
 
void Shutdown () override
 
bool LoadFonts () override
 
void SetFontPreset (EFontPreset FontPreset) override
 
void SetFontLanguageVariant (const char *pLanguageFile) override
 
void SetCursor (CTextCursor *pCursor, float x, float y, float FontSize, int Flags) const override
 
void MoveCursor (CTextCursor *pCursor, float x, float y) const override
 
void SetCursorPosition (CTextCursor *pCursor, float x, float y) const override
 
void Text (float x, float y, float Size, const char *pText, float LineWidth=-1.0f) override
 
float TextWidth (float Size, const char *pText, int StrLength=-1, float LineWidth=-1.0f, int Flags=0, const STextSizeProperties &TextSizeProps={}) override
 
STextBoundingBox TextBoundingBox (float Size, const char *pText, int StrLength=-1, float LineWidth=-1.0f, float LineSpacing=0.0f, int Flags=0) override
 
void TextColor (float r, float g, float b, float a) override
 
void TextColor (ColorRGBA Color) override
 
void TextOutlineColor (float r, float g, float b, float a) override
 
void TextOutlineColor (ColorRGBA Color) override
 
void TextSelectionColor (float r, float g, float b, float a) override
 
void TextSelectionColor (ColorRGBA Color) override
 
ColorRGBA GetTextColor () const override
 
ColorRGBA GetTextOutlineColor () const override
 
ColorRGBA GetTextSelectionColor () const override
 
void TextEx (CTextCursor *pCursor, const char *pText, int Length=-1) override
 
bool CreateTextContainer (STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1) override
 
void AppendTextContainer (STextContainerIndex TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1) override
 
bool CreateOrAppendTextContainer (STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1) override
 
void RecreateTextContainer (STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1) override
 
void RecreateTextContainerSoft (STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1) override
 
void DeleteTextContainer (STextContainerIndex &TextContainerIndex) override
 
void UploadTextContainer (STextContainerIndex TextContainerIndex) override
 
void RenderTextContainer (STextContainerIndex TextContainerIndex, const ColorRGBA &TextColor, const ColorRGBA &TextOutlineColor) override
 
void RenderTextContainer (STextContainerIndex TextContainerIndex, const ColorRGBA &TextColor, const ColorRGBA &TextOutlineColor, float X, float Y) override
 
STextBoundingBox GetBoundingBoxTextContainer (STextContainerIndex TextContainerIndex) override
 
void UploadEntityLayerText (const CImageInfo &TextImage, int TexSubWidth, int TexSubHeight, const char *pText, int Length, float x, float y, int FontSize) override
 
int AdjustFontSize (const char *pText, int TextLength, int MaxSize, int MaxWidth) const override
 
float GetGlyphOffsetX (int FontSize, char TextCharacter) const override
 
int CalculateTextWidth (const char *pText, int TextLength, int FontWidth, int FontHeight) const override
 
void OnPreWindowResize () override
 
void OnWindowResize () override
 
virtual void Init ()=0
 
virtual void Shutdown () override=0
 
- Public Member Functions inherited from ITextRender
virtual void SetCursor (CTextCursor *pCursor, float x, float y, float FontSize, int Flags) const =0
 
virtual void MoveCursor (CTextCursor *pCursor, float x, float y) const =0
 
virtual void SetCursorPosition (CTextCursor *pCursor, float x, float y) const =0
 
virtual bool LoadFonts ()=0
 
virtual void SetFontPreset (EFontPreset FontPreset)=0
 
virtual void SetFontLanguageVariant (const char *pLanguageFile)=0
 
virtual void SetRenderFlags (unsigned Flags)=0
 
virtual unsigned GetRenderFlags () const =0
 
ColorRGBA DefaultTextColor () const
 
ColorRGBA DefaultTextOutlineColor () const
 
ColorRGBA DefaultTextSelectionColor () const
 
virtual void TextEx (CTextCursor *pCursor, const char *pText, int Length=-1)=0
 
virtual bool CreateTextContainer (STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1)=0
 
virtual void AppendTextContainer (STextContainerIndex TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1)=0
 
virtual bool CreateOrAppendTextContainer (STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1)=0
 
virtual void RecreateTextContainer (STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1)=0
 
virtual void RecreateTextContainerSoft (STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1)=0
 
virtual void DeleteTextContainer (STextContainerIndex &TextContainerIndex)=0
 
virtual void UploadTextContainer (STextContainerIndex TextContainerIndex)=0
 
virtual void RenderTextContainer (STextContainerIndex TextContainerIndex, const ColorRGBA &TextColor, const ColorRGBA &TextOutlineColor)=0
 
virtual void RenderTextContainer (STextContainerIndex TextContainerIndex, const ColorRGBA &TextColor, const ColorRGBA &TextOutlineColor, float X, float Y)=0
 
virtual STextBoundingBox GetBoundingBoxTextContainer (STextContainerIndex TextContainerIndex)=0
 
virtual void UploadEntityLayerText (const CImageInfo &TextImage, int TexSubWidth, int TexSubHeight, const char *pText, int Length, float x, float y, int FontSize)=0
 
virtual int AdjustFontSize (const char *pText, int TextLength, int MaxSize, int MaxWidth) const =0
 
virtual float GetGlyphOffsetX (int FontSize, char TextCharacter) const =0
 
virtual int CalculateTextWidth (const char *pText, int TextLength, int FontWidth, int FontSize) const =0
 
virtual void TextColor (float r, float g, float b, float a)=0
 
virtual void TextColor (ColorRGBA Color)=0
 
virtual void TextOutlineColor (float r, float g, float b, float a)=0
 
virtual void TextOutlineColor (ColorRGBA Color)=0
 
virtual void TextSelectionColor (float r, float g, float b, float a)=0
 
virtual void TextSelectionColor (ColorRGBA Color)=0
 
virtual void Text (float x, float y, float Size, const char *pText, float LineWidth=-1.0f)=0
 
virtual float TextWidth (float Size, const char *pText, int StrLength=-1, float LineWidth=-1.0f, int Flags=0, const STextSizeProperties &TextSizeProps={})=0
 
virtual STextBoundingBox TextBoundingBox (float Size, const char *pText, int StrLength=-1, float LineWidth=-1.0f, float LineSpacing=0.0f, int Flags=0)=0
 
virtual ColorRGBA GetTextColor () const =0
 
virtual ColorRGBA GetTextOutlineColor () const =0
 
virtual ColorRGBA GetTextSelectionColor () const =0
 
virtual void OnPreWindowResize ()=0
 
virtual void OnWindowResize ()=0
 
- Public Member Functions inherited from IInterface
 IInterface ()
 
virtual void Shutdown ()
 
virtual ~IInterface ()
 

Private Member Functions

IConsoleConsole ()
 
IGraphicsGraphics ()
 
IStorageStorage ()
 
int GetFreeTextContainerIndex ()
 
void FreeTextContainerIndex (STextContainerIndex &Index)
 
void FreeTextContainer (STextContainerIndex &Index)
 
STextContainerGetTextContainer (const STextContainerIndex &Index)
 
int WordLength (const char *pText) const
 
bool LoadFontCollection (const char *pFontName, const FT_Byte *pFontData, FT_Long FontDataSize)
 
void SetRenderFlags (unsigned Flags) override
 
unsigned GetRenderFlags () const override
 

Private Attributes

IConsolem_pConsole
 
IGraphicsm_pGraphics
 
IStoragem_pStorage
 
CGlyphMapm_pGlyphMap
 
std::vector< void * > m_vpFontData
 
std::vector< SFontLanguageVariantm_vVariants
 
unsigned m_RenderFlags
 
ColorRGBA m_Color
 
ColorRGBA m_OutlineColor
 
ColorRGBA m_SelectionColor
 
FT_Library m_FTLibrary
 
std::vector< STextContainer * > m_vpTextContainers
 
std::vector< int > m_vTextContainerIndices
 
int m_FirstFreeTextContainerIndex
 
SBufferContainerInfo m_DefaultTextContainerInfo
 
std::chrono::nanoseconds m_CursorRenderTime
 

Additional Inherited Members

- Static Public Member Functions inherited from IEngineTextRender
static const char * InterfaceName ()
 
- Static Public Member Functions inherited from ITextRender
static const char * InterfaceName ()
 
- Protected Member Functions inherited from IInterface
IKernelKernel ()
 

Constructor & Destructor Documentation

◆ CTextRender()

CTextRender::CTextRender ( )
inline

Member Function Documentation

◆ AdjustFontSize()

int CTextRender::AdjustFontSize ( const char *  pText,
int  TextLength,
int  MaxSize,
int  MaxWidth 
) const
inlineoverridevirtual

Implements ITextRender.

◆ AppendTextContainer()

void CTextRender::AppendTextContainer ( STextContainerIndex  TextContainerIndex,
CTextCursor pCursor,
const char *  pText,
int  Length = -1 
)
inlineoverridevirtual

Implements ITextRender.

◆ CalculateTextWidth()

int CTextRender::CalculateTextWidth ( const char *  pText,
int  TextLength,
int  FontWidth,
int  FontHeight 
) const
inlineoverridevirtual

Implements ITextRender.

◆ Console()

IConsole * CTextRender::Console ( )
inlineprivate

◆ CreateOrAppendTextContainer()

bool CTextRender::CreateOrAppendTextContainer ( STextContainerIndex TextContainerIndex,
CTextCursor pCursor,
const char *  pText,
int  Length = -1 
)
inlineoverridevirtual

Implements ITextRender.

◆ CreateTextContainer()

bool CTextRender::CreateTextContainer ( STextContainerIndex TextContainerIndex,
CTextCursor pCursor,
const char *  pText,
int  Length = -1 
)
inlineoverridevirtual

Implements ITextRender.

◆ DeleteTextContainer()

void CTextRender::DeleteTextContainer ( STextContainerIndex TextContainerIndex)
inlineoverridevirtual

Implements ITextRender.

◆ FreeTextContainer()

void CTextRender::FreeTextContainer ( STextContainerIndex Index)
inlineprivate

◆ FreeTextContainerIndex()

void CTextRender::FreeTextContainerIndex ( STextContainerIndex Index)
inlineprivate

◆ GetBoundingBoxTextContainer()

STextBoundingBox CTextRender::GetBoundingBoxTextContainer ( STextContainerIndex  TextContainerIndex)
inlineoverridevirtual

Implements ITextRender.

◆ GetFreeTextContainerIndex()

int CTextRender::GetFreeTextContainerIndex ( )
inlineprivate

◆ GetGlyphOffsetX()

float CTextRender::GetGlyphOffsetX ( int  FontSize,
char  TextCharacter 
) const
inlineoverridevirtual

Implements ITextRender.

◆ GetRenderFlags()

unsigned CTextRender::GetRenderFlags ( ) const
inlineoverrideprivatevirtual

Implements ITextRender.

◆ GetTextColor()

ColorRGBA CTextRender::GetTextColor ( ) const
inlineoverridevirtual

Implements ITextRender.

◆ GetTextContainer()

STextContainer & CTextRender::GetTextContainer ( const STextContainerIndex Index)
inlineprivate

◆ GetTextOutlineColor()

ColorRGBA CTextRender::GetTextOutlineColor ( ) const
inlineoverridevirtual

Implements ITextRender.

◆ GetTextSelectionColor()

ColorRGBA CTextRender::GetTextSelectionColor ( ) const
inlineoverridevirtual

Implements ITextRender.

◆ Graphics()

IGraphics * CTextRender::Graphics ( )
inlineprivate

◆ Init()

void CTextRender::Init ( )
inlineoverridevirtual

Implements IEngineTextRender.

◆ LoadFontCollection()

bool CTextRender::LoadFontCollection ( const char *  pFontName,
const FT_Byte *  pFontData,
FT_Long  FontDataSize 
)
inlineprivate

◆ LoadFonts()

bool CTextRender::LoadFonts ( )
inlineoverridevirtual

Implements ITextRender.

◆ MoveCursor()

void CTextRender::MoveCursor ( CTextCursor pCursor,
float  x,
float  y 
) const
inlineoverridevirtual

Implements ITextRender.

◆ OnPreWindowResize()

void CTextRender::OnPreWindowResize ( )
inlineoverridevirtual

Implements ITextRender.

◆ OnWindowResize()

void CTextRender::OnWindowResize ( )
inlineoverridevirtual

Implements ITextRender.

◆ RecreateTextContainer()

void CTextRender::RecreateTextContainer ( STextContainerIndex TextContainerIndex,
CTextCursor pCursor,
const char *  pText,
int  Length = -1 
)
inlineoverridevirtual

Implements ITextRender.

◆ RecreateTextContainerSoft()

void CTextRender::RecreateTextContainerSoft ( STextContainerIndex TextContainerIndex,
CTextCursor pCursor,
const char *  pText,
int  Length = -1 
)
inlineoverridevirtual

Implements ITextRender.

◆ RenderTextContainer() [1/2]

void CTextRender::RenderTextContainer ( STextContainerIndex  TextContainerIndex,
const ColorRGBA TextColor,
const ColorRGBA TextOutlineColor 
)
inlineoverridevirtual

Implements ITextRender.

◆ RenderTextContainer() [2/2]

void CTextRender::RenderTextContainer ( STextContainerIndex  TextContainerIndex,
const ColorRGBA TextColor,
const ColorRGBA TextOutlineColor,
float  X,
float  Y 
)
inlineoverridevirtual

Implements ITextRender.

◆ SetCursor()

void CTextRender::SetCursor ( CTextCursor pCursor,
float  x,
float  y,
float  FontSize,
int  Flags 
) const
inlineoverridevirtual

Implements ITextRender.

◆ SetCursorPosition()

void CTextRender::SetCursorPosition ( CTextCursor pCursor,
float  x,
float  y 
) const
inlineoverridevirtual

Implements ITextRender.

◆ SetFontLanguageVariant()

void CTextRender::SetFontLanguageVariant ( const char *  pLanguageFile)
inlineoverridevirtual

Implements ITextRender.

◆ SetFontPreset()

void CTextRender::SetFontPreset ( EFontPreset  FontPreset)
inlineoverridevirtual

Implements ITextRender.

◆ SetRenderFlags()

void CTextRender::SetRenderFlags ( unsigned  Flags)
inlineoverrideprivatevirtual

Implements ITextRender.

◆ Shutdown()

void CTextRender::Shutdown ( )
inlineoverridevirtual

Implements IEngineTextRender.

◆ Storage()

IStorage * CTextRender::Storage ( )
inlineprivate

◆ Text()

void CTextRender::Text ( float  x,
float  y,
float  Size,
const char *  pText,
float  LineWidth = -1.0f 
)
inlineoverridevirtual

Implements ITextRender.

◆ TextBoundingBox()

STextBoundingBox CTextRender::TextBoundingBox ( float  Size,
const char *  pText,
int  StrLength = -1,
float  LineWidth = -1.0f,
float  LineSpacing = 0.0f,
int  Flags = 0 
)
inlineoverridevirtual

Implements ITextRender.

◆ TextColor() [1/2]

void CTextRender::TextColor ( ColorRGBA  Color)
inlineoverridevirtual

Implements ITextRender.

◆ TextColor() [2/2]

void CTextRender::TextColor ( float  r,
float  g,
float  b,
float  a 
)
inlineoverridevirtual

Implements ITextRender.

◆ TextEx()

void CTextRender::TextEx ( CTextCursor pCursor,
const char *  pText,
int  Length = -1 
)
inlineoverridevirtual

Implements ITextRender.

◆ TextOutlineColor() [1/2]

void CTextRender::TextOutlineColor ( ColorRGBA  Color)
inlineoverridevirtual

Implements ITextRender.

◆ TextOutlineColor() [2/2]

void CTextRender::TextOutlineColor ( float  r,
float  g,
float  b,
float  a 
)
inlineoverridevirtual

Implements ITextRender.

◆ TextSelectionColor() [1/2]

void CTextRender::TextSelectionColor ( ColorRGBA  Color)
inlineoverridevirtual

Implements ITextRender.

◆ TextSelectionColor() [2/2]

void CTextRender::TextSelectionColor ( float  r,
float  g,
float  b,
float  a 
)
inlineoverridevirtual

Implements ITextRender.

◆ TextWidth()

float CTextRender::TextWidth ( float  Size,
const char *  pText,
int  StrLength = -1,
float  LineWidth = -1.0f,
int  Flags = 0,
const STextSizeProperties TextSizeProps = {} 
)
inlineoverridevirtual

Implements ITextRender.

◆ UploadEntityLayerText()

void CTextRender::UploadEntityLayerText ( const CImageInfo TextImage,
int  TexSubWidth,
int  TexSubHeight,
const char *  pText,
int  Length,
float  x,
float  y,
int  FontSize 
)
inlineoverridevirtual

Implements ITextRender.

◆ UploadTextContainer()

void CTextRender::UploadTextContainer ( STextContainerIndex  TextContainerIndex)
inlineoverridevirtual

Implements ITextRender.

◆ WordLength()

int CTextRender::WordLength ( const char *  pText) const
inlineprivate

Member Data Documentation

◆ m_Color

ColorRGBA CTextRender::m_Color
private

◆ m_CursorRenderTime

std::chrono::nanoseconds CTextRender::m_CursorRenderTime
private

◆ m_DefaultTextContainerInfo

SBufferContainerInfo CTextRender::m_DefaultTextContainerInfo
private

◆ m_FirstFreeTextContainerIndex

int CTextRender::m_FirstFreeTextContainerIndex
private

◆ m_FTLibrary

FT_Library CTextRender::m_FTLibrary
private

◆ m_OutlineColor

ColorRGBA CTextRender::m_OutlineColor
private

◆ m_pConsole

IConsole* CTextRender::m_pConsole
private

◆ m_pGlyphMap

CGlyphMap* CTextRender::m_pGlyphMap
private

◆ m_pGraphics

IGraphics* CTextRender::m_pGraphics
private

◆ m_pStorage

IStorage* CTextRender::m_pStorage
private

◆ m_RenderFlags

unsigned CTextRender::m_RenderFlags
private

◆ m_SelectionColor

ColorRGBA CTextRender::m_SelectionColor
private

◆ m_vpFontData

std::vector<void *> CTextRender::m_vpFontData
private

◆ m_vpTextContainers

std::vector<STextContainer *> CTextRender::m_vpTextContainers
private

◆ m_vTextContainerIndices

std::vector<int> CTextRender::m_vTextContainerIndices
private

◆ m_vVariants

std::vector<SFontLanguageVariant> CTextRender::m_vVariants
private

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