39#ifndef DISTI_INCLUDED_GLS_FONT_RENDERER_H
40#define DISTI_INCLUDED_GLS_FONT_RENDERER_H
69typedef VertexNoColor
Vector;
148 unsigned char textureMinFilter,
149 unsigned char textureMagFilter,
174 stateManager->Texture2DEnabled(
false );
187 unsigned char textureMinFilter,
188 unsigned char textureMagFilter )
211 glDisable( GL_TEXTURE_2D );
232 DISTI_DEPRECATED(
"This overload is deprecated because the clear text effect has been superseded. Use the DrawCharacter() overload without the 'inverse' parameter." )
234 const
bool emphasize,
235 const
float emphasisOffset,
241 const GLfloat y2 )
const
243 DrawCharacter( emphasize, emphasisOffset, quadStorage, x1, y1, x2, y2 );
256 const bool emphasize,
257 const float emphasisOffset,
258 GlsQuadListVCT_2D& quadStorage,
262 const GLfloat y2 )
const
265 quadStorage.AddQuad2D( x1, y1, x2, y2 );
271 GLfloat offsetY1( y1 + emphasisOffset );
272 GLfloat offsetY2( y2 + emphasisOffset );
274 quadStorage.AddQuad2D( x1 - emphasisOffset, offsetY1, x2 - emphasisOffset, offsetY2 );
275 quadStorage.AddQuad2D( x1 + emphasisOffset, offsetY1, x2 + emphasisOffset, offsetY2 );
294 const float haloOffset,
295 const float diagonalOffset,
296 GlsQuadListVCT_2D& quadStorage,
300 const GLfloat y2 )
const
302 const GLfloat x1right( x1 + diagonalOffset );
303 const GLfloat x1left( x1 - diagonalOffset );
304 const GLfloat x2right( x2 + diagonalOffset );
305 const GLfloat x2left( x2 - diagonalOffset );
306 const GLfloat y1up( y1 + diagonalOffset );
307 const GLfloat y1down( y1 - diagonalOffset );
308 const GLfloat y2up( y2 + diagonalOffset );
309 const GLfloat y2down( y2 - diagonalOffset );
311 quadStorage.AddQuad2D( x1left, y1up, x2left, y2up );
312 quadStorage.AddQuad2D( x1left, y1down, x2left, y2down );
313 quadStorage.AddQuad2D( x1right, y1up, x2right, y2up );
314 quadStorage.AddQuad2D( x1right, y1down, x2right, y2down );
315 quadStorage.AddQuad2D( x1 - haloOffset, y1, x2 - haloOffset, y2 );
316 quadStorage.AddQuad2D( x1, y1 - haloOffset, x2, y2 - haloOffset );
317 quadStorage.AddQuad2D( x1 + haloOffset, y1, x2 + haloOffset, y2 );
318 quadStorage.AddQuad2D( x1, y1 + haloOffset, x2, y2 + haloOffset );
341 DISTI_DEPRECATED(
"This overload is deprecated because the clear text effect has been superseded. Use the DrawCharacter() overload without the 'inverse' parameter." )
343 const
bool emphasize,
344 const
float emphasisOffset,
353 const GLfloat ty2 )
const
355 DrawCharacter( emphasize, emphasisOffset, x1, y1, x2, y2, tx1, ty1, tx2, ty2 );
376 const bool emphasize,
377 const float emphasisOffset,
385 const GLfloat ty2 )
const
389 MapTexture( x1, y1, x2, y2, tx1, ty1, tx2, ty2 );
394 GLfloat offsetY1( y1 + emphasisOffset );
395 GLfloat offsetY2( y2 + emphasisOffset );
398 x1 - emphasisOffset, offsetY1, x2 - emphasisOffset, offsetY2,
399 tx1, ty1, tx2, ty2 );
402 x1 + emphasisOffset, offsetY1, x2 + emphasisOffset, offsetY2,
403 tx1, ty1, tx2, ty2 );
423 const float haloOffset,
424 const float diagonalOffset,
432 const GLfloat ty2 )
const
435 GLfloat x1right( x1 + diagonalOffset );
436 GLfloat x1left( x1 - diagonalOffset );
437 GLfloat x2right( x2 + diagonalOffset );
438 GLfloat x2left( x2 - diagonalOffset );
439 GLfloat y1up( y1 + diagonalOffset );
440 GLfloat y1down( y1 - diagonalOffset );
441 GLfloat y2up( y2 + diagonalOffset );
442 GLfloat y2down( y2 - diagonalOffset );
448 x1left, y1up, x2left, y2up,
449 tx1, ty1, tx2, ty2 );
453 x1left, y1down, x2left, y2down,
454 tx1, ty1, tx2, ty2 );
458 x1right, y1up, x2right, y2up,
459 tx1, ty1, tx2, ty2 );
463 x1right, y1down, x2right, y2down,
464 tx1, ty1, tx2, ty2 );
468 x1 - haloOffset, y1, x2 - haloOffset, y2,
469 tx1, ty1, tx2, ty2 );
473 x1, y1 - haloOffset, x2, y2 - haloOffset,
474 tx1, ty1, tx2, ty2 );
478 x1 + haloOffset, y1, x2 + haloOffset, y2,
479 tx1, ty1, tx2, ty2 );
483 x1, y1 + haloOffset, x2, y2 + haloOffset,
484 tx1, ty1, tx2, ty2 );
502 const float shadowOffset,
510 const GLfloat ty2 )
const
521 tx1, ty1, tx2, ty2 );
549 glTexCoord2f( tx1, ty1 );
550 glVertex2f( x1, y1 );
551 glTexCoord2f( tx2, ty1 );
552 glVertex2f( x2, y1 );
553 glTexCoord2f( tx2, ty2 );
554 glVertex2f( x2, y2 );
555 glTexCoord2f( tx1, ty2 );
556 glVertex2f( x1, y2 );
603 stateManager->Texture2DEnabled(
true );
604 stateManager->BindTexture( texture );
609 stateManager->SetTextureMagFilter( GL_NEAREST );
613 stateManager->SetTextureMagFilter( GL_LINEAR );
620 stateManager->SetTextureMinFilter( GL_NEAREST );
624 stateManager->SetTextureMinFilter( GL_LINEAR );
628 stateManager->SetTextureMinFilter( GL_NEAREST_MIPMAP_NEAREST );
632 stateManager->SetTextureMinFilter( GL_LINEAR_MIPMAP_LINEAR );
636 stateManager->SetTextureMinFilter( GL_NEAREST_MIPMAP_LINEAR );
640 stateManager->SetTextureMinFilter( GL_LINEAR_MIPMAP_NEAREST );
644 stateManager->SetTextureEnvMode( IGlsStateManager::GLS_TEXTURE_MAP_MODE_MODULATE );
666 glEnable( GL_TEXTURE_2D );
672 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
676 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
683 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
686 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
689 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST );
692 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
695 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR );
698 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST );
702 glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
Definition: gls_color.h:53
void RGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
Definition: gls_color.h:172
Definition: gls_font_base.h:86
Image * Texture() const
Definition: gls_font_base.h:330
GLuint Char_t
Define the character type to use.
Definition: gls_font_base.h:88
Definition: gls_font_renderer.h:85
void TermRendering()
Definition: gls_font_renderer.h:209
void TextureMagFilter(unsigned char val)
Definition: gls_font_renderer.h:115
void DrawHalo(const float haloOffset, const float diagonalOffset, const GLfloat x1, const GLfloat y1, const GLfloat x2, const GLfloat y2, const GLfloat tx1, const GLfloat ty1, const GLfloat tx2, const GLfloat ty2) const
Definition: gls_font_renderer.h:422
void DrawCharacter(const bool emphasize, const float emphasisOffset, const bool inverse, const GLfloat x1, const GLfloat y1, const GLfloat x2, const GLfloat y2, const GLfloat tx1, const GLfloat ty1, const GLfloat tx2, const GLfloat ty2) const
Definition: gls_font_renderer.h:342
GlsFontRenderer(const GlsFontBase *font)
Definition: gls_font_renderer.h:565
const GlsFontBase * _font
Definition: gls_font_renderer.h:579
const GlsFontBase * GetFont()
Definition: gls_font_renderer.h:133
void InitRendering()
Definition: gls_font_renderer.h:199
void TextureMinFilter(unsigned char val)
Definition: gls_font_renderer.h:102
void SetupTexture(IFontImage *texture)
Definition: gls_font_renderer.h:653
GlsFontBase::CharAttr_t CharAttr_t
Shorthand for GlsFontBase::CharAttr_t.
Definition: gls_font_renderer.h:88
unsigned char TextureMagFilter()
Definition: gls_font_renderer.h:108
unsigned char _textureMinFilter
Definition: gls_font_renderer.h:582
unsigned char TextureMinFilter()
Definition: gls_font_renderer.h:95
GlsColor _currentColor
Definition: gls_font_renderer.h:575
void DrawShadow(const float shadowOffset, const GLfloat x1, const GLfloat y1, const GLfloat x2, const GLfloat y2, const GLfloat tx1, const GLfloat ty1, const GLfloat tx2, const GLfloat ty2) const
Definition: gls_font_renderer.h:501
unsigned char _textureMagFilter
Definition: gls_font_renderer.h:585
static void MapTexture(const GLfloat x1, const GLfloat y1, const GLfloat x2, const GLfloat y2, const GLfloat tx1, const GLfloat ty1, const GLfloat tx2, const GLfloat ty2)
Definition: gls_font_renderer.h:539
GlsFontBase::Char_t Char_t
Shorthand for GlsFontBase::Char_t.
Definition: gls_font_renderer.h:87
void InitRendering(unsigned char textureMinFilter, unsigned char textureMagFilter)
Definition: gls_font_renderer.h:186
void SetFont(const GlsFontBase *font)
Definition: gls_font_renderer.h:127
void DrawCharacter(const bool emphasize, const float emphasisOffset, const GLfloat x1, const GLfloat y1, const GLfloat x2, const GLfloat y2, const GLfloat tx1, const GLfloat ty1, const GLfloat tx2, const GLfloat ty2) const
Definition: gls_font_renderer.h:375
Definition: gls_quad_storage.h:156
Definition: IFontImage.h:50
virtual void MipMap(bool mipMap)=0
virtual void BindTexture()=0
Definition: gls_state_manager_interface.h:65
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:487
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:46
@ TEXTURE_FILTER_NEAREST
Definition: display_types.h:62
@ TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR
Definition: display_types.h:65
@ TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST
Definition: display_types.h:64
@ TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST
Definition: display_types.h:67
@ TEXTURE_FILTER_LINEAR
Definition: display_types.h:63
@ TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR
Definition: display_types.h:66
VertexNoColor Vector
Definition: gls_font_base.h:68
Character attributes. One item for each character in the set.
Definition: gls_font_base.h:124
The disti::Vertex class. A class for manipulating 3D vertices.