Gorgon Game Engine
Gorgon::Graphics::internal Namespace Reference

Functions inside this namespace is designed for internal use, however, they might be used externally and will not have any impact on inner workings of the system. More...

Typedefs

using markvecit = std::vector< glyphmark >::iterator
 

Functions

void ActivateQuadVertices ()
 
void boundedlayout (const GlyphRenderer &renderer, std::string::const_iterator begin, std::string::const_iterator end, int width, std::function< bool(Glyph, markvecit, markvecit, int, int)> doline, std::function< int(Glyph, Glyph)> spacing, std::function< int(Glyph)> advance, std::function< void(int &)> dotab)
 
void boundedprint (const GlyphRenderer &renderer, std::string::const_iterator begin, std::string::const_iterator end, int width, std::function< void(Glyph, markvecit, markvecit, int)> doline, std::function< int(Glyph, Glyph)> spacing, std::function< int(Glyph)> advance, std::function< void(int &)> dotab)
 
int ceildiv (int v, float f)
 
Glyph decode (std::string::const_iterator &it, std::string::const_iterator end)
 Decodes a utf-8 character from the given iterator. More...
 
float defaultspace (Glyph g, const GlyphRenderer &renderer)
 
template<class T_ >
void dodefaulttab (T_ s, T_ &x, T_ w)
 
void DrawQuadVertices ()
 
bool isadjustablespace (Glyph g)
 
bool isbreaking (Glyph g)
 
bool isnewline (Glyph g)
 
bool isspace (Glyph g)
 
bool isspaced (Glyph g)
 
int rounddiv (int v, float f)
 
void simplelayout (const GlyphRenderer &renderer, std::string::const_iterator begin, std::string::const_iterator end, std::function< int(Glyph, Glyph)> spacing, std::function< int(Glyph)> advance, std::function< bool(Glyph, int, float)> process, std::function< void()> dotab, std::function< void(Glyph)> donewline)
 helps with the simple layouts, decodes and executes unicode instructions. More...
 
void simpleprint (const GlyphRenderer &renderer, std::string::const_iterator begin, std::string::const_iterator end, std::function< int(Glyph, Glyph)> spacing, std::function< int(Glyph)> advance, std::function< void(Glyph, int, float)> render, std::function< void()> dotab, std::function< void(Glyph)> donewline)
 helps with the simple layouts, decodes and executes unicode instructions. More...
 

Variables

GL::Texture LastTexture
 
GLuint quadvbo
 
int quadvertexindex []
 
std::map< decltype(WindowManager::CurrentContext()), GLuint > vaos
 

Detailed Description

Functions inside this namespace is designed for internal use, however, they might be used externally and will not have any impact on inner workings of the system.

Typedef Documentation

◆ markvecit

using markvecit = std::vector<glyphmark>::iterator

Function Documentation

◆ ActivateQuadVertices()

void ActivateQuadVertices ( )

◆ boundedlayout()

void Gorgon::Graphics::internal::boundedlayout ( const GlyphRenderer renderer,
std::string::const_iterator  begin,
std::string::const_iterator  end,
int  width,
std::function< bool(Glyph, markvecit, markvecit, int, int)>  doline,
std::function< int(Glyph, Glyph)>  spacing,
std::function< int(Glyph)>  advance,
std::function< void(int &)>  dotab 
)

◆ boundedprint()

void Gorgon::Graphics::internal::boundedprint ( const GlyphRenderer renderer,
std::string::const_iterator  begin,
std::string::const_iterator  end,
int  width,
std::function< void(Glyph, markvecit, markvecit, int)>  doline,
std::function< int(Glyph, Glyph)>  spacing,
std::function< int(Glyph)>  advance,
std::function< void(int &)>  dotab 
)

◆ ceildiv()

int Gorgon::Graphics::internal::ceildiv ( int  v,
float  f 
)

◆ decode()

Glyph decode ( std::string::const_iterator &  it,
std::string::const_iterator  end 
)

Decodes a utf-8 character from the given iterator.

If char is not valid 0xfffd is returned. \r\n is mapped to \n

References Gorgon::end().

◆ defaultspace()

float Gorgon::Graphics::internal::defaultspace ( Glyph  g,
const GlyphRenderer renderer 
)

◆ dodefaulttab()

void Gorgon::Graphics::internal::dodefaulttab ( T_  s,
T_ &  x,
T_  w 
)

◆ DrawQuadVertices()

void DrawQuadVertices ( )

◆ isadjustablespace()

bool isadjustablespace ( Glyph  g)

◆ isbreaking()

bool isbreaking ( Glyph  g)

◆ isnewline()

bool isnewline ( Glyph  g)

◆ isspace()

bool isspace ( Glyph  g)

◆ isspaced()

bool isspaced ( Glyph  g)

◆ rounddiv()

int Gorgon::Graphics::internal::rounddiv ( int  v,
float  f 
)

◆ simplelayout()

void Gorgon::Graphics::internal::simplelayout ( const GlyphRenderer renderer,
std::string::const_iterator  begin,
std::string::const_iterator  end,
std::function< int(Glyph, Glyph)>  spacing,
std::function< int(Glyph)>  advance,
std::function< bool(Glyph, int, float)>  process,
std::function< void()>  dotab,
std::function< void(Glyph)>  donewline 
)

helps with the simple layouts, decodes and executes unicode instructions.

Offset parameter in render function is the offset that must be used after rendering the character. If g is 0, only offset should be processed. This overload calls process function even for glyphs that are not normally rendered, and allows return value from the layout function to stop processing further.

References Gorgon::begin(), decode(), defaultspace(), Gorgon::end(), GlyphRenderer::Exists(), GlyphRenderer::GetCursorAdvance(), isnewline(), and isspace().

◆ simpleprint()

void Gorgon::Graphics::internal::simpleprint ( const GlyphRenderer renderer,
std::string::const_iterator  begin,
std::string::const_iterator  end,
std::function< int(Glyph, Glyph)>  spacing,
std::function< int(Glyph)>  advance,
std::function< void(Glyph, int, float)>  render,
std::function< void()>  dotab,
std::function< void(Glyph)>  donewline 
)

helps with the simple layouts, decodes and executes unicode instructions.

Offset parameter in render function is the offset that must be used after rendering the character. If g is 0, only offset should be processed

References Gorgon::begin(), decode(), defaultspace(), Gorgon::end(), GlyphRenderer::Exists(), GlyphRenderer::GetCursorAdvance(), isnewline(), and isspace().

Variable Documentation

◆ LastTexture

GL::Texture LastTexture

◆ quadvbo

GLuint quadvbo

◆ quadvertexindex

int quadvertexindex[]

◆ vaos

std::map<decltype(WindowManager::CurrentContext()), GLuint> vaos