NAP
Public Member Functions | Protected Member Functions | List of all members
Renderable2DGlyph Class Reference

#include <renderableglyph.h>

Public Member Functions

 Renderable2DGlyph (nap::Core &core)
 
- Public Member Functions inherited from RenderableGlyph
 RenderableGlyph (nap::Core &core)
 
virtual ~RenderableGlyph () override
 
const glm::ivec2 & getSize () const
 
const glm::ivec2 & getBearing () const
 
int getWidth () const
 
int getHeight () const
 
int getOffsetLeft () const
 
int getOffsetTop () const
 
const Texture2D & getTexture () const
 
Texture2D & getTexture ()
 
int getHorizontalAdvance () const
 
int getVerticalAdvance () const
 
bool empty () const
 
- Public Member Functions inherited from IGlyphRepresentation
virtual ~IGlyphRepresentation ()
 
 IGlyphRepresentation (nap::Core &core)
 
 IGlyphRepresentation (const IGlyphRepresentation &other)=delete
 
IGlyphRepresentation & operator= (const IGlyphRepresentation &)=delete
 
 IGlyphRepresentation (IGlyphRepresentation &&other)=delete
 
IGlyphRepresentation & operator= (IGlyphRepresentation &&other)=delete
 

Protected Member Functions

virtual bool onInit (const Glyph &glyph, utility::ErrorState &errorCode) override
 
- Protected Member Functions inherited from RenderableGlyph
virtual bool setup (const Glyph &glyph, bool generateMipmaps, utility::ErrorState &errorCode)
 
- Protected Member Functions inherited from IGlyphRepresentation
bool init (const Glyph &glyph, utility::ErrorState &error)
 

Additional Inherited Members

- Protected Attributes inherited from IGlyphRepresentation
nap::Core * mCore
 Handle to core instance. More...
 

Description

Represents a symbol (character) in a font that can be rendered. The glyph is rendered to a 2DTexture and has no mipmaps. Use this glyph representation when the text does not scale.

Inheritance diagram for Renderable2DGlyph:
[legend]
Collaboration diagram for Renderable2DGlyph:
[legend]

Constructor & Destructor Documentation

◆ Renderable2DGlyph()

Member Function Documentation

◆ onInit()

virtual bool onInit ( const Glyph &  glyph,
utility::ErrorState &  errorCode 
)
overrideprotectedvirtual

Initializes the 2DTexture after construction of this glyph. First it converts the free-type glyph into a bitmap. This bitmap is uploaded to the GPU.

Returns
if the 2DTexture has been initialized correctly.

Implements IGlyphRepresentation.