AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
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.
 
virtual _< IRenderer::IPrerenderedStringfinalize () noexcept=0
 Bakes multi string canvas to IPrerenderedString which can be used for drawing text.
 
ATextLayoutHelper getTextLayoutHelper () noexcept
 Returns text layout helper.
 

Protected Member Functions#

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

Member Function Documentation#

◆ addString()#

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

◆ finalize()#

virtual _< IRenderer::IPrerenderedString > IRenderer::IMultiStringCanvas::finalize ( )
pure virtualnoexcept
Note
invalidates IMultiStringCanvas which speeds up some implementations of IMultiStringCanvas.
Returns
instance of _<IRenderer::IPrerenderedString> to drawElements with.

◆ getTextLayoutHelper()#

ATextLayoutHelper IRenderer::IMultiStringCanvas::getTextLayoutHelper ( )
inlinenoexcept
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
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.