AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
IRenderer::IMultiStringCanvas Class Referenceabstract

Public Member Functions

void enableCachingForTextLayoutHelper () noexcept
 Notifies IMultiStringCanvas that getTextLayoutHelper() will be used.
 
void nextLine () noexcept
 When caching for text layout helper is enabled, a new line added.
 
virtual void addString (const glm::ivec2 &position, const AString &text) noexcept=0
 Bakes a string with some position. More...
 
virtual _< IRenderer::IPrerenderedStringfinalize () noexcept=0
 Bakes multi string canvas to IPrerenderedString which can be used for drawing text. More...
 
ATextLayoutHelper getTextLayoutHelper () noexcept
 Returns text layout helper. More...
 

Protected Member Functions

void notifySymbolAdded (const ATextLayoutHelper::Boundary &symbol) noexcept
 Notifies IMultiStringCanvas than a symbol was added used to construct a ATextLayoutHelper. More...
 

Member Function Documentation

◆ addString()

virtual void IRenderer::IMultiStringCanvas::addString ( const glm::ivec2 &  position,
const AString text 
)
pure virtualnoexcept

Bakes a string with some position.

Parameters
positionposition
texttext

Implemented in OpenGLMultiStringCanvas, and SoftwareMultiStringCanvas.

◆ finalize()

virtual _< IRenderer::IPrerenderedString > IRenderer::IMultiStringCanvas::finalize ( )
pure virtualnoexcept

Bakes multi string canvas to IPrerenderedString which can be used for drawing text.

Note
invalidates IMultiStringCanvas which speeds up some implementations of IMultiStringCanvas.
Returns
instance of _<IRenderer::IPrerenderedString> to drawElements with.

Implemented in OpenGLMultiStringCanvas, and SoftwareMultiStringCanvas.

◆ getTextLayoutHelper()

ATextLayoutHelper IRenderer::IMultiStringCanvas::getTextLayoutHelper ( )
inlinenoexcept

Returns text layout helper.

Returns
an instance of IRenderer::ITextLayoutHelper constructed from IMultiStringCanvas's cache to efficiently map cursor position to the string index.
Note
call enableCachingForTextLayoutHelper before adding strings.
can be called only once.

◆ notifySymbolAdded()

void IRenderer::IMultiStringCanvas::notifySymbolAdded ( const ATextLayoutHelper::Boundary symbol)
inlineprotectednoexcept

Notifies IMultiStringCanvas than a symbol was added used to construct a ATextLayoutHelper.

Note
should be called by the implementation of IMultiStringCanvas.
Parameters
symbolsymbol data to add
Note
at the end of line, implementation must add extra symbol to mark last position.

The documentation for this class was generated from the following file:
Inheritance diagram for IRenderer::IMultiStringCanvas: