40#ifndef _GLS_FONT_RENDERER_H
41#define _GLS_FONT_RENDERER_H
70typedef VertexNoColor
Vector;
149 unsigned char textureMinFilter,
150 unsigned char textureMagFilter,
178 unsigned char textureMinFilter,
179 unsigned char textureMagFilter )
202 glDisable( GL_TEXTURE_2D );
223 DISTI_DEPRECATED(
"This overload is deprecated because the clear text effect has been superseded. Use the DrawCharacter() overload without the 'inverse' parameter." )
225 const
bool emphasize,
226 const
float emphasisOffset,
232 const GLfloat y2 )
const
234 DrawCharacter( emphasize, emphasisOffset, quadStorage, x1, y1, x2, y2 );
247 const bool emphasize,
248 const float emphasisOffset,
253 const GLfloat y2 )
const
262 GLfloat offsetY1( y1 + emphasisOffset );
263 GLfloat offsetY2( y2 + emphasisOffset );
265 quadStorage.
AddQuad2D( x1 - emphasisOffset, offsetY1, x2 - emphasisOffset, offsetY2 );
266 quadStorage.
AddQuad2D( x1 + emphasisOffset, offsetY1, x2 + emphasisOffset, offsetY2 );
285 const float haloOffset,
286 const float diagonalOffset,
291 const GLfloat y2 )
const
293 const GLfloat x1right( x1 + diagonalOffset );
294 const GLfloat x1left( x1 - diagonalOffset );
295 const GLfloat x2right( x2 + diagonalOffset );
296 const GLfloat x2left( x2 - diagonalOffset );
297 const GLfloat y1up( y1 + diagonalOffset );
298 const GLfloat y1down( y1 - diagonalOffset );
299 const GLfloat y2up( y2 + diagonalOffset );
300 const GLfloat y2down( y2 - diagonalOffset );
302 quadStorage.
AddQuad2D( x1left, y1up, x2left, y2up );
303 quadStorage.
AddQuad2D( x1left, y1down, x2left, y2down );
304 quadStorage.
AddQuad2D( x1right, y1up, x2right, y2up );
305 quadStorage.
AddQuad2D( x1right, y1down, x2right, y2down );
306 quadStorage.
AddQuad2D( x1 - haloOffset, y1, x2 - haloOffset, y2 );
307 quadStorage.
AddQuad2D( x1, y1 - haloOffset, x2, y2 - haloOffset );
308 quadStorage.
AddQuad2D( x1 + haloOffset, y1, x2 + haloOffset, y2 );
309 quadStorage.
AddQuad2D( x1, y1 + haloOffset, x2, y2 + haloOffset );
332 DISTI_DEPRECATED(
"This overload is deprecated because the clear text effect has been superseded. Use the DrawCharacter() overload without the 'inverse' parameter." )
334 const
bool emphasize,
335 const
float emphasisOffset,
344 const GLfloat ty2 )
const
346 DrawCharacter( emphasize, emphasisOffset, x1, y1, x2, y2, tx1, ty1, tx2, ty2 );
367 const bool emphasize,
368 const float emphasisOffset,
376 const GLfloat ty2 )
const
380 MapTexture( x1, y1, x2, y2, tx1, ty1, tx2, ty2 );
385 GLfloat offsetY1( y1 + emphasisOffset );
386 GLfloat offsetY2( y2 + emphasisOffset );
389 x1 - emphasisOffset, offsetY1, x2 - emphasisOffset, offsetY2,
390 tx1, ty1, tx2, ty2 );
393 x1 + emphasisOffset, offsetY1, x2 + emphasisOffset, offsetY2,
394 tx1, ty1, tx2, ty2 );
414 const float haloOffset,
415 const float diagonalOffset,
423 const GLfloat ty2 )
const
426 GLfloat x1right( x1 + diagonalOffset );
427 GLfloat x1left( x1 - diagonalOffset );
428 GLfloat x2right( x2 + diagonalOffset );
429 GLfloat x2left( x2 - diagonalOffset );
430 GLfloat y1up( y1 + diagonalOffset );
431 GLfloat y1down( y1 - diagonalOffset );
432 GLfloat y2up( y2 + diagonalOffset );
433 GLfloat y2down( y2 - diagonalOffset );
439 x1left, y1up, x2left, y2up,
440 tx1, ty1, tx2, ty2 );
444 x1left, y1down, x2left, y2down,
445 tx1, ty1, tx2, ty2 );
449 x1right, y1up, x2right, y2up,
450 tx1, ty1, tx2, ty2 );
454 x1right, y1down, x2right, y2down,
455 tx1, ty1, tx2, ty2 );
459 x1 - haloOffset, y1, x2 - haloOffset, y2,
460 tx1, ty1, tx2, ty2 );
464 x1, y1 - haloOffset, x2, y2 - haloOffset,
465 tx1, ty1, tx2, ty2 );
469 x1 + haloOffset, y1, x2 + haloOffset, y2,
470 tx1, ty1, tx2, ty2 );
474 x1, y1 + haloOffset, x2, y2 + haloOffset,
475 tx1, ty1, tx2, ty2 );
493 const float shadowOffset,
501 const GLfloat ty2 )
const
512 tx1, ty1, tx2, ty2 );
530 static void MapTexture(
540 glTexCoord2f( tx1, ty1 );
541 glVertex2f( x1, y1 );
542 glTexCoord2f( tx2, ty1 );
543 glVertex2f( x2, y1 );
544 glTexCoord2f( tx2, ty2 );
545 glVertex2f( x2, y2 );
546 glTexCoord2f( tx1, ty2 );
547 glVertex2f( x1, y2 );
635 stateManager->
SetTextureEnvMode( IGlsStateManager::GLS_TEXTURE_MAP_MODE_MODULATE );
654 glColor4ubv( _currentColor.
RGBA() );
657 glEnable( GL_TEXTURE_2D );
663 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
667 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
674 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
677 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
680 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST );
683 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
686 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR );
689 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST );
693 glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
Definition: gls_color.h:54
void RGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
Definition: gls_color.h:169
Definition: gls_font_base.h:87
Image * Texture() const
Definition: gls_font_base.h:331
GLuint Char_t
Define the character type to use.
Definition: gls_font_base.h:89
Definition: gls_font_renderer.h:86
void DrawCharacter(const bool emphasize, const float emphasisOffset, GlsQuadListVCT_2D &quadStorage, const GLfloat x1, const GLfloat y1, const GLfloat x2, const GLfloat y2) const
Definition: gls_font_renderer.h:246
void SetupTexture(IFontImage *texture, IGlsStateManager *stateManager)
Definition: gls_font_renderer.h:584
void InitRendering(unsigned char textureMinFilter, unsigned char textureMagFilter, IGlsStateManager *stateManager)
Definition: gls_font_renderer.h:148
void TextureMagFilter(unsigned char val)
Definition: gls_font_renderer.h:116
GlsFontRenderer(const GlsFontBase *font)
Definition: gls_font_renderer.h:556
const GlsFontBase * _font
Definition: gls_font_renderer.h:570
const GlsFontBase * GetFont()
Definition: gls_font_renderer.h:134
void TextureMinFilter(unsigned char val)
Definition: gls_font_renderer.h:103
GlsFontBase::CharAttr_t CharAttr_t
Shorthand for GlsFontBase::CharAttr_t.
Definition: gls_font_renderer.h:89
unsigned char TextureMagFilter()
Definition: gls_font_renderer.h:109
unsigned char _textureMinFilter
Definition: gls_font_renderer.h:573
unsigned char TextureMinFilter()
Definition: gls_font_renderer.h:96
void DrawCharacter(const bool emphasize, const float emphasisOffset, const bool inverse, GlsQuadListVCT_2D &quadStorage, const GLfloat x1, const GLfloat y1, const GLfloat x2, const GLfloat y2) const
Definition: gls_font_renderer.h:224
unsigned char _textureMagFilter
Definition: gls_font_renderer.h:576
void InitRendering(IGlsStateManager *stateManager)
Definition: gls_font_renderer.h:163
GlsFontBase::Char_t Char_t
Shorthand for GlsFontBase::Char_t.
Definition: gls_font_renderer.h:88
void SetFont(const GlsFontBase *font)
Definition: gls_font_renderer.h:128
void DrawHalo(const float haloOffset, const float diagonalOffset, GlsQuadListVCT_2D &quadStorage, const GLfloat x1, const GLfloat y1, const GLfloat x2, const GLfloat y2) const
Definition: gls_font_renderer.h:284
Definition: gls_quad_storage.h:160
void AddQuad2D(const float x1, const float y1, const float x2, const float y2)
Definition: IFontImage.h:54
virtual void BindTexture()=0
Definition: gls_state_manager_interface.h:69
virtual void SetTextureMagFilter(GLenum mode)=0
virtual void BindTexture(IFontImage *texture)=0
virtual void SetTextureEnvMode(GLenum mode)=0
virtual void SetTextureMinFilter(GLenum mode)=0
virtual void Texture2DEnabled(bool val)=0
The Color class: Implements a 4 component RGBA color.
Macros and helper code to determine what subset of C++11/14/17 is available.
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:488
The disti::GlsFontBase class and related classes.
The disti::GlsQuadListVC_3D and GlsQuadListVCT_2D classes.
The disti::GlsStateManager factory class. Creates an instance of a state manager that manages the GL ...
The Image class. All textures are converted internally into Images.
Definition: bmpimage.h:47
@ TEXTURE_FILTER_NEAREST
Definition: display_types.h:63
@ TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR
Definition: display_types.h:66
@ TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST
Definition: display_types.h:65
@ TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST
Definition: display_types.h:68
@ TEXTURE_FILTER_LINEAR
Definition: display_types.h:64
@ TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR
Definition: display_types.h:67
VertexNoColor Vector
Definition: gls_font_base.h:69
Character attributes. One item for each character in the set.
Definition: gls_font_base.h:125
The disti::Vertex class. A class for manipulating 3D vertices.