40#ifndef _GLS_FONT_RENDERER_H
41#define _GLS_FONT_RENDERER_H
70typedef VertexNoColor
Vector;
149 unsigned char textureMinFilter,
150 unsigned char textureMagFilter
194 glDisable( GL_TEXTURE_2D );
215 DISTI_DEPRECATED(
"This overload is deprecated because the clear text effect has been superseded. Use the DrawCharacter() overload without the 'inverse' parameter." )
217 const
bool emphasize,
218 const
float emphasisOffset,
224 const GLfloat y2 )
const
226 DrawCharacter( emphasize, emphasisOffset, quadStorage, x1, y1, x2, y2 );
239 const bool emphasize,
240 const float emphasisOffset,
241 GlsQuadListVCT_2D& quadStorage,
245 const GLfloat y2 )
const
248 quadStorage.AddQuad2D( x1, y1, x2, y2 );
254 GLfloat offsetY1( y1 + emphasisOffset );
255 GLfloat offsetY2( y2 + emphasisOffset );
257 quadStorage.AddQuad2D( x1 - emphasisOffset, offsetY1, x2 - emphasisOffset, offsetY2 );
258 quadStorage.AddQuad2D( x1 + emphasisOffset, offsetY1, x2 + emphasisOffset, offsetY2 );
276 const float haloOffset,
277 const float diagonalOffset,
278 GlsQuadListVCT_2D& quadStorage,
282 const GLfloat y2 )
const
284 const GLfloat x1right( x1 + diagonalOffset );
285 const GLfloat x1left( x1 - diagonalOffset );
286 const GLfloat x2right( x2 + diagonalOffset );
287 const GLfloat x2left( x2 - diagonalOffset );
288 const GLfloat y1up( y1 + diagonalOffset );
289 const GLfloat y1down( y1 - diagonalOffset );
290 const GLfloat y2up( y2 + diagonalOffset );
291 const GLfloat y2down( y2 - diagonalOffset );
293 quadStorage.AddQuad2D( x1left, y1up, x2left, y2up );
294 quadStorage.AddQuad2D( x1left, y1down, x2left, y2down );
295 quadStorage.AddQuad2D( x1right, y1up, x2right, y2up );
296 quadStorage.AddQuad2D( x1right, y1down, x2right, y2down );
297 quadStorage.AddQuad2D( x1 - haloOffset, y1, x2 - haloOffset, y2 );
298 quadStorage.AddQuad2D( x1, y1 - haloOffset, x2, y2 - haloOffset );
299 quadStorage.AddQuad2D( x1 + haloOffset, y1, x2 + haloOffset, y2 );
300 quadStorage.AddQuad2D( x1, y1 + haloOffset, x2, y2 + haloOffset );
323 DISTI_DEPRECATED(
"This overload is deprecated because the clear text effect has been superseded. Use the DrawCharacter() overload without the 'inverse' parameter." )
325 const
bool emphasize,
326 const
float emphasisOffset,
335 const GLfloat ty2 )
const
337 DrawCharacter( emphasize, emphasisOffset, x1, y1, x2, y2, tx1, ty1, tx2, ty2 );
358 const bool emphasize,
359 const float emphasisOffset,
367 const GLfloat ty2 )
const
371 MapTexture( x1, y1, x2, y2, tx1, ty1, tx2, ty2 );
376 GLfloat offsetY1( y1 + emphasisOffset );
377 GLfloat offsetY2( y2 + emphasisOffset );
380 x1 - emphasisOffset, offsetY1, x2 - emphasisOffset, offsetY2,
381 tx1, ty1, tx2, ty2 );
384 x1 + emphasisOffset, offsetY1, x2 + emphasisOffset, offsetY2,
385 tx1, ty1, tx2, ty2 );
405 const float haloOffset,
406 const float diagonalOffset,
414 const GLfloat ty2 )
const
417 GLfloat x1right( x1 + diagonalOffset );
418 GLfloat x1left( x1 - diagonalOffset );
419 GLfloat x2right( x2 + diagonalOffset );
420 GLfloat x2left( x2 - diagonalOffset );
421 GLfloat y1up( y1 + diagonalOffset );
422 GLfloat y1down( y1 - diagonalOffset );
423 GLfloat y2up( y2 + diagonalOffset );
424 GLfloat y2down( y2 - diagonalOffset );
430 x1left, y1up, x2left, y2up,
431 tx1, ty1, tx2, ty2 );
435 x1left, y1down, x2left, y2down,
436 tx1, ty1, tx2, ty2 );
440 x1right, y1up, x2right, y2up,
441 tx1, ty1, tx2, ty2 );
445 x1right, y1down, x2right, y2down,
446 tx1, ty1, tx2, ty2 );
450 x1 - haloOffset, y1, x2 - haloOffset, y2,
451 tx1, ty1, tx2, ty2 );
455 x1, y1 - haloOffset, x2, y2 - haloOffset,
456 tx1, ty1, tx2, ty2 );
460 x1 + haloOffset, y1, x2 + haloOffset, y2,
461 tx1, ty1, tx2, ty2 );
465 x1, y1 + haloOffset, x2, y2 + haloOffset,
466 tx1, ty1, tx2, ty2 );
484 const float shadowOffset,
492 const GLfloat ty2 )
const
503 tx1, ty1, tx2, ty2 );
531 glTexCoord2f( tx1, ty1 );
532 glVertex2f( x1, y1 );
533 glTexCoord2f( tx2, ty1 );
534 glVertex2f( x2, y1 );
535 glTexCoord2f( tx2, ty2 );
536 glVertex2f( x2, y2 );
537 glTexCoord2f( tx1, ty2 );
538 glVertex2f( x1, y2 );
585 stateManager->Texture2DEnabled(
true );
586 stateManager->BindTexture( texture );
591 stateManager->SetTextureMagFilter( GL_NEAREST );
595 stateManager->SetTextureMagFilter( GL_LINEAR );
602 stateManager->SetTextureMinFilter( GL_NEAREST );
606 stateManager->SetTextureMinFilter( GL_LINEAR );
610 stateManager->SetTextureMinFilter( GL_NEAREST_MIPMAP_NEAREST );
614 stateManager->SetTextureMinFilter( GL_LINEAR_MIPMAP_LINEAR );
618 stateManager->SetTextureMinFilter( GL_NEAREST_MIPMAP_LINEAR );
622 stateManager->SetTextureMinFilter( GL_LINEAR_MIPMAP_NEAREST );
626 stateManager->SetTextureEnvMode( IGlsStateManager::GLS_TEXTURE_MAP_MODE_MODULATE );
645 glEnable( GL_TEXTURE_2D );
651 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
655 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
662 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
665 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
668 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST );
671 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
674 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR );
677 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST );
681 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 TermRendering()
Definition: gls_font_renderer.h:192
void TextureMagFilter(unsigned char val)
Definition: gls_font_renderer.h:116
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:404
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:324
GlsFontRenderer(const GlsFontBase *font)
Definition: gls_font_renderer.h:547
const GlsFontBase * _font
Definition: gls_font_renderer.h:561
const GlsFontBase * GetFont()
Definition: gls_font_renderer.h:134
void InitRendering()
Definition: gls_font_renderer.h:182
void TextureMinFilter(unsigned char val)
Definition: gls_font_renderer.h:103
void SetupTexture(IFontImage *texture)
Definition: gls_font_renderer.h:632
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:564
unsigned char TextureMinFilter()
Definition: gls_font_renderer.h:96
GlsColor _currentColor
Definition: gls_font_renderer.h:557
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:483
unsigned char _textureMagFilter
Definition: gls_font_renderer.h:567
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:521
GlsFontBase::Char_t Char_t
Shorthand for GlsFontBase::Char_t.
Definition: gls_font_renderer.h:88
void InitRendering(unsigned char textureMinFilter, unsigned char textureMagFilter)
Definition: gls_font_renderer.h:148
void SetFont(const GlsFontBase *font)
Definition: gls_font_renderer.h:128
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:357
Definition: gls_quad_storage.h:160
Definition: IFontImage.h:54
virtual void MipMap(bool mipMap)=0
virtual void BindTexture()=0
Definition: gls_state_manager_interface.h:69
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:457
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.
Force inclusion of the DirectShow library.
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.