vdr-plugin-softhddevice-drm-gles 1.6.4-d0291bb
cOglFontAtlas Class Reference

OpenGL OSD Texture Atlas for a Font. More...

#include <openglosd.h>

Public Member Functions

 cOglFontAtlas (FT_Face, int)
 
virtual ~cOglFontAtlas (void)
 
cOglAtlasGlyphGetGlyph (int) const
 
int Height (void) const
 
int Width (void) const
 
void BindTexture (void)
 

Private Attributes

GLuint m_texture = 0
 
int m_width = 0
 
int m_height = 0
 
cOglAtlasGlyphm_pGlyph [MAX_CHARCODE - MIN_CHARCODE+1]
 

Detailed Description

OpenGL OSD Texture Atlas for a Font.

Represents a texture atlas keeping a range of glyphs on one texture per font and size instead of having one texture per glyph. This technique makes dealing with huge amounts of glyphs faster, because the bottleneck (texture up-/download/binding) is reduced at a minimum. Its faster to deal with one single bigger texture than many smaller ones.

The font atlas is prepared once at the time the new font or sized is accessed for the first time. We may have a little delay at startup, which is negligible.

Definition at line 180 of file openglosd.h.

Constructor & Destructor Documentation

◆ cOglFontAtlas()

cOglFontAtlas::cOglFontAtlas ( FT_Face  face,
int  height 
)

◆ ~cOglFontAtlas()

cOglFontAtlas::~cOglFontAtlas ( void  )
virtual

Definition at line 449 of file openglosd.cpp.

References GL_CHECK, m_pGlyph, m_texture, MAX_CHARCODE, and MIN_CHARCODE.

Member Function Documentation

◆ BindTexture()

void cOglFontAtlas::BindTexture ( void  )

Definition at line 468 of file openglosd.cpp.

References GL_CHECK, and m_texture.

◆ GetGlyph()

cOglAtlasGlyph * cOglFontAtlas::GetGlyph ( int  sym) const

Definition at line 461 of file openglosd.cpp.

References m_pGlyph, MAX_CHARCODE, and MIN_CHARCODE.

◆ Height()

int cOglFontAtlas::Height ( void  ) const
inline

Definition at line 185 of file openglosd.h.

References m_height.

◆ Width()

int cOglFontAtlas::Width ( void  ) const
inline

Definition at line 186 of file openglosd.h.

References m_width.

Member Data Documentation

◆ m_height

int cOglFontAtlas::m_height = 0
private

Definition at line 191 of file openglosd.h.

Referenced by cOglFontAtlas(), and Height().

◆ m_pGlyph

cOglAtlasGlyph* cOglFontAtlas::m_pGlyph[MAX_CHARCODE - MIN_CHARCODE+1]
private

Definition at line 192 of file openglosd.h.

Referenced by cOglFontAtlas(), GetGlyph(), and ~cOglFontAtlas().

◆ m_texture

GLuint cOglFontAtlas::m_texture = 0
private

Definition at line 189 of file openglosd.h.

Referenced by BindTexture(), cOglFontAtlas(), and ~cOglFontAtlas().

◆ m_width

int cOglFontAtlas::m_width = 0
private

Definition at line 190 of file openglosd.h.

Referenced by cOglFontAtlas(), and Width().


The documentation for this class was generated from the following files: