MAGE  v0.171.0
Matthias Advanced Game Engine
mage::rendering::Glyph Struct Reference

#include <glyph.hpp>

Public Member Functions

 Glyph () noexcept=default
 
 Glyph (const Glyph &glyph) noexcept=default
 
 Glyph (Glyph &&glyph) noexcept=default
 
 ~Glyph ()=default
 
Glyphoperator= (const Glyph &glyph) noexcept=default
 
Glyphoperator= (Glyph &&glyph) noexcept=default
 
U32 GetWidth () const noexcept
 
U32 GetHeight () const noexcept
 
bool operator< (const Glyph &rhs) const noexcept
 
bool operator< (wchar_t rhs) const noexcept
 

Public Attributes

U32 m_character
 
RECT m_sub_rectangle
 
F32x2 m_offset
 
F32 m_advance_x
 

Detailed Description

A struct of glyphs.

Constructor & Destructor Documentation

◆ Glyph() [1/3]

mage::rendering::Glyph::Glyph ( )
defaultnoexcept

Constructs a glyph.

◆ Glyph() [2/3]

mage::rendering::Glyph::Glyph ( const Glyph glyph)
defaultnoexcept

Constructs a glyph from the given glyph.

Parameters
[in]glyphA reference to the glyph to copy.

◆ Glyph() [3/3]

mage::rendering::Glyph::Glyph ( Glyph &&  glyph)
defaultnoexcept

Constructs a glyph by moving the given glyph.

Parameters
[in]glyphA reference to the glyph to move.

◆ ~Glyph()

mage::rendering::Glyph::~Glyph ( )
default

Destructs this glyph.

Member Function Documentation

◆ GetHeight()

U32 mage::rendering::Glyph::GetHeight ( ) const
noexcept

Returns the height of this glyph.

Returns
The height of this glyph.

◆ GetWidth()

U32 mage::rendering::Glyph::GetWidth ( ) const
noexcept

Returns the width of this glyph.

Returns
The width of this glyph.

◆ operator<() [1/2]

bool mage::rendering::Glyph::operator< ( const Glyph rhs) const
noexcept

Checks whether this glyph's character is smaller than the given glyph's character.

Parameters
[in]rhsA reference to the glyph to compare against.
Returns
true if the this glyph's character is smaller than the given glyph's character. false otherwise.

◆ operator<() [2/2]

bool mage::rendering::Glyph::operator< ( wchar_t  rhs) const
noexcept

Checks whether this glyph's character is smaller than the given character.

Parameters
[in]rhsThe character to compare against.
Returns
true if the this glyph's character is smaller than the given character. false otherwise.

◆ operator=() [1/2]

Glyph& mage::rendering::Glyph::operator= ( const Glyph glyph)
defaultnoexcept

Copies the given glyph to this glyph.

Parameters
[in]glyphA reference to the glyph to copy.
Returns
A reference to copy of the given glyph (i.e. this glyph).

◆ operator=() [2/2]

Glyph& mage::rendering::Glyph::operator= ( Glyph &&  glyph)
defaultnoexcept

Moves the given glyph to this glyph.

Parameters
[in]glyphA reference to the glyph to move.
Returns
A reference to the moved glyph (i.e. this glyph).

Member Data Documentation

◆ m_advance_x

F32 mage::rendering::Glyph::m_advance_x

The offset of this glyph to the right.

◆ m_character

U32 mage::rendering::Glyph::m_character

The character of this glyph.

◆ m_offset

F32x2 mage::rendering::Glyph::m_offset

The offset of this glyph [from the left, from the top].

◆ m_sub_rectangle

RECT mage::rendering::Glyph::m_sub_rectangle

The subrectangle of this glyph.