GL Studio C++ Runtime API
gls_font_renderer.h
Go to the documentation of this file.
1 /*! \file
2  \brief The disti::GlsFontRenderer class and related classes.
3 
4  \par Copyright Information
5 
6  Copyright (c) 2017 by The DiSTI Corporation.<br>
7  11301 Corporate Blvd; Suite 100<br>
8  Orlando, Florida 32817<br>
9  USA<br>
10  <br>
11  All rights reserved.<br>
12 
13  This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19 
20  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26 
27  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35 
36  The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38 
39 */
40 #ifndef _GLS_FONT_RENDERER_H
41 #define _GLS_FONT_RENDERER_H
42 
43 #include "gls_gl.h"
44 #include <string>
45 #include <vector>
46 #ifdef GLES
47 # include "gls_quad_storage.h"
48 # include "gls_state_manager.h"
49 #endif
50 #include "IFontImage.h"
51 #include "gls_color.h"
52 #include "gls_font_base.h"
53 #include "gls_state_manager.h"
54 #include "image.h"
55 #include "vertex.h"
56 
57 //===========================================================================
58 // BEGIN NAMESPACE
59 //===========================================================================
60 namespace disti
61 {
62 //---------------------------------------------------------------------------
63 // FORWARD REFERENCES
64 //---------------------------------------------------------------------------
65 class VertexNoColor;
66 class GlsColor;
67 class Image;
68 
69 typedef VertexNoColor Vector;
70 
71 //===========================================================================
72 /**
73 *
74 * The GlsFontRenderer object can be used to render characters from a GlsFontBase in
75 * Open GL at specific locations and with several different text effects.
76 * Prior to rendering any characters, InitRendering must be invoked to set
77 * up the proper drawing environment. Then call Render for each character
78 * to be drawn.
79 *
80 * \sa GlsFontBase
81 *
82 */
83 //===========================================================================
85 {
86 public:
87  typedef GlsFontBase::Char_t Char_t;
89 
90  //----------------------------------------
91  // Character rendering state variables
92  //----------------------------------------
93 
94  /** Returns the minification filter for this font */
95  unsigned char TextureMinFilter()
96  {
97  return _textureMinFilter;
98  }
99 
100  /** Sets the minification filter for this font */
101  void TextureMinFilter( unsigned char val )
102  {
103  _textureMinFilter = val;
104  }
105 
106  /** Returns the magnification filter for this font */
107  unsigned char TextureMagFilter()
108  {
109  return _textureMagFilter;
110  }
111 
112  /** Sets the magnification filter for this font */
113  void TextureMagFilter( unsigned char val )
114  {
115  _textureMagFilter = val;
116  }
117 
118  //----------------------------------------
119  // Setup and cleanup for rendering
120  //----------------------------------------
121 
122  /**
123  * Set the font to use.
124  * The font pointer must be set before calling
125  * any rendering methods
126  */
127  void SetFont( const GlsFontBase* font )
128  {
129  _font = font;
130  }
131  const GlsFontBase* GetFont( void )
132  {
133  return _font;
134  }
135 
136  /**
137  * Initializes the font to begin rendering characters. This will set up
138  * Open GL texture modes, bind the font's texture, set up minification
139  * and magnification filters, etc. This must be called once before
140  * invoking Render to draw characters. This version overwrites the
141  * texture minification and magnification filters before initializing.
142  * \param textureMinFilter Minification mode for the font texture
143  * \param textureMagFilter Magnification mode for the font texture
144  */
146  unsigned char textureMinFilter,
147  unsigned char textureMagFilter
148 #ifdef GLES
149  ,
150  IGlsStateManager* stateManager
151 #endif // GLES
152  )
153  {
154  _textureMinFilter = textureMinFilter;
155  _textureMagFilter = textureMagFilter;
157 #ifdef GLES
158  stateManager
159 #endif // GLES
160  );
161  }
162 
163  /**
164  * Initializes the font to begin rendering characters. This will set up
165  * Open GL texture modes, bind the font's texture, set up minification
166  * and magnification filters, etc. This must be called before
167  * using any of the Render methods draw characters.
168  */
169 
170 #ifdef GLES
171 
172  void InitRendering( IGlsStateManager* stateManager )
173  {
174  SetupTexture( _font->Texture(), stateManager );
175  }
176 
177 #else // !GLES
178 
180  {
181  SetupTexture( _font->Texture() );
182  }
183 
184  /**
185  * Restores the Open GL state as it was before the call to InitRendering.
186  * This should be called after all characters have been rendered using
187  * the Render methods.
188  */
190  {
191  glDisable( GL_TEXTURE_2D );
192  } // end GlsFontRenderer::TermRendering
193 
194 #endif // GLES
195 
196  //----------------------------------------
197  // Rendering Methods
198  //----------------------------------------
199 
200 #ifdef GLES
201 
202  /** Draw a character by adding it into the supplied QuadStorage object
203  * \param emphasize Whether to draw with emphasize or not
204  * \param emphasisOffset If drawing with emphasize, the offset in logical units
205  * \param inverse Whether to draw in inverse mode or not
206  * \param quadStorage The quad storage object to render the characters into
207  * \param x1 lower left corner x coordinate of the polygon
208  * \param y1 lower left corner y coordinate of the polygon
209  * \param x2 upper right corner x coordinate of the polygon
210  * \param y2 upper right corner y coordinate of the polygon
211  */
212  void DrawCharacter(
213  const bool emphasize,
214  const float emphasisOffset,
215  const bool inverse,
216  GlsQuadListVCT_2D& quadStorage,
217  const GLfloat x1,
218  const GLfloat y1,
219  const GLfloat x2,
220  const GLfloat y2 ) const
221  {
222  // character color
223  quadStorage.AddQuad2D( x1, y1, x2, y2 );
224 
225  // Character emphasis. Draw two more cells offset a little so
226  // character appears bolded.
227  if( emphasize && !inverse )
228  {
229  GLfloat offsetY1( y1 + emphasisOffset );
230  GLfloat offsetY2( y2 + emphasisOffset );
231 
232  quadStorage.AddQuad2D( x1 - emphasisOffset, offsetY1, x2 - emphasisOffset, offsetY2 );
233  quadStorage.AddQuad2D( x1 + emphasisOffset, offsetY1, x2 + emphasisOffset, offsetY2 );
234  }
235 
236  } // end GlsFontRenderer::DrawCharacter
237 
238  /**
239  * Draws a halo effect for the given character.
240  *
241  * \param c the character code to render
242  * \param haloOffset Controls the size of the halo
243  * GlsTextGrid uses: (emphasize ? 0.05f : 0.03f) * (character_width) (x2 - x1)
244  * \param _vertArray Pointer to the currently bound vertex array
245  * \param x1 lower left corner x coordinate of the polygon
246  * \param y1 lower left corner y coordinate of the polygon
247  * \param x2 upper right corner x coordinate of the polygon
248  * \param y2 upper right corner y coordinate of the polygon
249  */
250  void DrawHalo(
251  const float haloOffset,
252  const float diagonalOffset,
253  GlsQuadListVCT_2D& quadStorage,
254  const GLfloat x1,
255  const GLfloat y1,
256  const GLfloat x2,
257  const GLfloat y2 ) const
258  {
259  const GLfloat x1right( x1 + diagonalOffset );
260  const GLfloat x1left( x1 - diagonalOffset );
261  const GLfloat x2right( x2 + diagonalOffset );
262  const GLfloat x2left( x2 - diagonalOffset );
263  const GLfloat y1up( y1 + diagonalOffset );
264  const GLfloat y1down( y1 - diagonalOffset );
265  const GLfloat y2up( y2 + diagonalOffset );
266  const GLfloat y2down( y2 - diagonalOffset );
267 
268  quadStorage.AddQuad2D( x1left, y1up, x2left, y2up );
269  quadStorage.AddQuad2D( x1left, y1down, x2left, y2down );
270  quadStorage.AddQuad2D( x1right, y1up, x2right, y2up );
271  quadStorage.AddQuad2D( x1right, y1down, x2right, y2down );
272  quadStorage.AddQuad2D( x1 - haloOffset, y1, x2 - haloOffset, y2 );
273  quadStorage.AddQuad2D( x1, y1 - haloOffset, x2, y2 - haloOffset );
274  quadStorage.AddQuad2D( x1 + haloOffset, y1, x2 + haloOffset, y2 );
275  quadStorage.AddQuad2D( x1, y1 + haloOffset, x2, y2 + haloOffset );
276  }
277 
278 #else // !GLES
279 
280  /**
281  * Draws a character.
282  *
283  * \param emphasize true if the rendered character should be emphasized.
284  * This will essentially bold the character. If a bold
285  * font is being used, the character will appear even
286  * more bolded.
287  * \param emphasisOffset Magnitude of the emhpasis offset. A good value to try is (0.2 * character_width).
288  * \param inverse true if the rendered character should be inverse
289  * video. This makes the text see-through and it's
290  * background the text foreground color.
291  * \param x1 lower left corner x coordinate of the polygon
292  * \param y1 lower left corner y coordinate of the polygon
293  * \param x2 upper right corner x coordinate of the polygon
294  * \param y2 upper right corner y coordinate of the polygon
295  * \param tx1 lower left corner x texture coordinate
296  * \param ty1 lower left corner y texture coordinate
297  * \param tx2 upper right corner x texture coordinate
298  * \param ty2 upper right corner y texture coordinate
299  */
301  const bool emphasize,
302  const float emphasisOffset,
303  const bool inverse,
304  const GLfloat x1,
305  const GLfloat y1,
306  const GLfloat x2,
307  const GLfloat y2,
308  const GLfloat tx1,
309  const GLfloat ty1,
310  const GLfloat tx2,
311  const GLfloat ty2 ) const
312  {
313  if( inverse )
314  {
316  stateManager->PushAlphaBlendFunc();
317  stateManager->AlphaBlendFuncSeparate( GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE );
318  }
319 
320  glBegin( GL_QUADS );
321 
322  MapTexture( x1, y1, x2, y2, tx1, ty1, tx2, ty2 );
323  // Character emphasis. Draw two more cells offset a little so
324  // character appears bolded.
325  if( emphasize && !inverse )
326  {
327  GLfloat offsetY1( y1 + emphasisOffset );
328  GLfloat offsetY2( y2 + emphasisOffset );
329 
330  MapTexture(
331  x1 - emphasisOffset, offsetY1, x2 - emphasisOffset, offsetY2,
332  tx1, ty1, tx2, ty2 );
333 
334  MapTexture(
335  x1 + emphasisOffset, offsetY1, x2 + emphasisOffset, offsetY2,
336  tx1, ty1, tx2, ty2 );
337  }
338 
339  glEnd();
340 
341  if( inverse )
342  {
344  }
345 
346  } // end GlsFontRenderer::DrawCharacter
347 
348  /**
349  * Draws a halo effect for the given character.
350  *
351  * \param haloOffset Controls the size of the halo
352  * GlsTextGrid uses: (emphasize ? 0.05f : 0.03f) * (character_width) (x2 - x1)
353  * \param x1 lower left corner x coordinate of the polygon
354  * \param y1 lower left corner y coordinate of the polygon
355  * \param x2 upper right corner x coordinate of the polygon
356  * \param y2 upper right corner y coordinate of the polygon
357  * \param tx1 lower left corner x texture coordinate
358  * \param ty1 lower left corner y texture coordinate
359  * \param tx2 upper right corner x texture coordinate
360  * \param ty2 upper right corner y texture coordinate
361  */
362  void DrawHalo(
363  const float haloOffset,
364  const float diagonalOffset,
365  const GLfloat x1,
366  const GLfloat y1,
367  const GLfloat x2,
368  const GLfloat y2,
369  const GLfloat tx1,
370  const GLfloat ty1,
371  const GLfloat tx2,
372  const GLfloat ty2 ) const
373  {
374  // Halo effect.
375  GLfloat x1right( x1 + diagonalOffset );
376  GLfloat x1left( x1 - diagonalOffset );
377  GLfloat x2right( x2 + diagonalOffset );
378  GLfloat x2left( x2 - diagonalOffset );
379  GLfloat y1up( y1 + diagonalOffset );
380  GLfloat y1down( y1 - diagonalOffset );
381  GLfloat y2up( y2 + diagonalOffset );
382  GLfloat y2down( y2 - diagonalOffset );
383 
384  glBegin( GL_QUADS );
385 
386  // Shift left and up
387  MapTexture(
388  x1left, y1up, x2left, y2up,
389  tx1, ty1, tx2, ty2 );
390 
391  // Shift left and down
392  MapTexture(
393  x1left, y1down, x2left, y2down,
394  tx1, ty1, tx2, ty2 );
395 
396  // Shift right and up
397  MapTexture(
398  x1right, y1up, x2right, y2up,
399  tx1, ty1, tx2, ty2 );
400 
401  // Shift right and down
402  MapTexture(
403  x1right, y1down, x2right, y2down,
404  tx1, ty1, tx2, ty2 );
405 
406  // Shift left
407  MapTexture(
408  x1 - haloOffset, y1, x2 - haloOffset, y2,
409  tx1, ty1, tx2, ty2 );
410 
411  // Shift down
412  MapTexture(
413  x1, y1 - haloOffset, x2, y2 - haloOffset,
414  tx1, ty1, tx2, ty2 );
415 
416  // Shift right
417  MapTexture(
418  x1 + haloOffset, y1, x2 + haloOffset, y2,
419  tx1, ty1, tx2, ty2 );
420 
421  // Shift up
422  MapTexture(
423  x1, y1 + haloOffset, x2, y2 + haloOffset,
424  tx1, ty1, tx2, ty2 );
425 
426  glEnd();
427  } // end GlsFontRenderer::DrawHalo
428 
429  /**
430  * Draws a drop shadow effect for a character.
431  * \param shadowOffset distance to offset the shadow from the character
432  * \param x1 lower left corner x coordinate of the polygon
433  * \param y1 lower left corner y coordinate of the polygon
434  * \param x2 upper right corner x coordinate of the polygon
435  * \param y2 upper right corner y coordinate of the polygon
436  * \param tx1 lower left corner x texture coordinate
437  * \param ty1 lower left corner y texture coordinate
438  * \param tx2 upper right corner x texture coordinate
439  * \param ty2 upper right corner y texture coordinate
440  */
442  const float shadowOffset,
443  const GLfloat x1,
444  const GLfloat y1,
445  const GLfloat x2,
446  const GLfloat y2,
447  const GLfloat tx1,
448  const GLfloat ty1,
449  const GLfloat tx2,
450  const GLfloat ty2 ) const
451  {
452  // Shadow effect.
453  glBegin( GL_QUADS );
454 
455  // Shift right and down
456  MapTexture(
457  x1 + shadowOffset,
458  y1 - shadowOffset,
459  x2 + shadowOffset,
460  y2 - shadowOffset,
461  tx1, ty1, tx2, ty2 );
462 
463  glEnd();
464 
465  } // end GlsFontRenderer::DrawShadow
466 
467  /**
468  * Map a square piece of a texture onto a quad ( assumed to be called
469 between glBegin(GL_QUADS)...glEnd() pair )
470  * \param x1 the lower left corner x of the quad
471  * \param y1 the lower left corner y of the quad
472  * \param x2 the upper right corner x of the quad
473  * \param y2 the upper right corner of the quad
474  * \param tx1 lower left corner x texture coordinate
475  * \param ty1 lower left corner y texture coordinate
476  * \param tx2 upper right corner x texture coordinate
477  * \param ty2 upper right corner y texture coordinate
478  */
479  static void MapTexture(
480  const GLfloat x1,
481  const GLfloat y1,
482  const GLfloat x2,
483  const GLfloat y2,
484  const GLfloat tx1,
485  const GLfloat ty1,
486  const GLfloat tx2,
487  const GLfloat ty2 )
488  {
489  glTexCoord2f( tx1, ty1 );
490  glVertex2f( x1, y1 );
491  glTexCoord2f( tx2, ty1 );
492  glVertex2f( x2, y1 );
493  glTexCoord2f( tx2, ty2 );
494  glVertex2f( x2, y2 );
495  glTexCoord2f( tx1, ty2 );
496  glVertex2f( x1, y2 );
497  }
498 
499 #endif // GLES
500 
501  /**
502  * Create a GlsFontRenderer with the default settings.
503  * \param font The font to use for rendering. This may be NULL on creation, but it must be set before rendering.
504  */
506  : _font( font )
509  {
510  }
511 
512 protected:
513 #ifndef GLES
514  /** Current drawing color is kept so we don't have to make an OpenGL call if the color is the same */
516 #endif
517 
518  /** Pointer to the font to use for rendering */
520 
521  /** Minification mode for the font texture */
522  unsigned char _textureMinFilter;
523 
524  /** Magnification mode for the font texture */
525  unsigned char _textureMagFilter;
526 
527  /**
528  * Helper method to set up Open GL texture modes, bind the font's texture,
529  * set up minification and magnification filters, etc.
530  */
531 
532 #ifdef GLES
533 
534  void SetupTexture( IFontImage* texture, IGlsStateManager* stateManager )
535  {
537  if( mipMap )
538  {
539  // This will force the image to create the mipmap images
540  texture->MipMap( true );
541  }
542 
543  // Initialize the font texture
544  stateManager->Texture2DEnabled( true );
545  stateManager->BindTexture( texture );
546 
547  // Set up mip mapping for magnification
548  if( _textureMagFilter == TEXTURE_FILTER_NEAREST )
549  {
550  stateManager->SetTextureMagFilter( GL_NEAREST );
551  }
552  else if( _textureMagFilter == TEXTURE_FILTER_LINEAR )
553  {
554  stateManager->SetTextureMagFilter( GL_LINEAR );
555  }
556 
557  // Set up mip mapping for minification
558  switch( _textureMinFilter )
559  {
561  stateManager->SetTextureMinFilter( GL_NEAREST );
562  break;
563 
565  stateManager->SetTextureMinFilter( GL_LINEAR );
566  break;
567 
569  stateManager->SetTextureMinFilter( GL_NEAREST_MIPMAP_NEAREST );
570  break;
571 
573  stateManager->SetTextureMinFilter( GL_LINEAR_MIPMAP_LINEAR );
574  break;
575 
577  stateManager->SetTextureMinFilter( GL_NEAREST_MIPMAP_LINEAR );
578  break;
579 
581  stateManager->SetTextureMinFilter( GL_LINEAR_MIPMAP_NEAREST );
582  break;
583  }
584 
585  stateManager->SetTextureEnvMode( IGlsStateManager::GLS_TEXTURE_MAP_MODE_MODULATE );
586 
587  } // end GlsFontRenderer::SetupTexture
588 
589 #else // !GLES
590 
591  void SetupTexture( IFontImage* texture )
592  {
594  if( mipMap )
595  {
596  // This will force the image to create the mipmap images
597  texture->MipMap( true );
598  }
599 
600  // Initialize the drawing color
601  glColor4ubv( _currentColor.RGBA() );
602 
603  // Initialize the font texture
604  glEnable( GL_TEXTURE_2D );
605  texture->BindTexture();
606 
607  // Set up mip mapping for magnification
608  if( _textureMagFilter == TEXTURE_FILTER_NEAREST )
609  {
610  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
611  }
612  else if( _textureMagFilter == TEXTURE_FILTER_LINEAR )
613  {
614  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
615  }
616 
617  // Set up mip mapping for minification
618  switch( _textureMinFilter )
619  {
621  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
622  break;
624  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
625  break;
627  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST );
628  break;
630  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
631  break;
633  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR );
634  break;
636  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST );
637  break;
638  }
639 
640  glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
641 
642  } // end GlsFontRenderer::SetupTexture
643 
644 #endif // GLES
645 
646 }; // end class GlsFontRenderer
647 
648 } // end namespace disti
649 
650 #endif
Definition: display_types.h:75
Definition: display_types.h:73
static IGlsStateManager * Instance(void)
virtual void MipMap(bool mipMap)=0
unsigned char _textureMinFilter
Definition: gls_font_renderer.h:522
virtual void AlphaBlendFuncSeparate(GLenum srcColor, GLenum dstColor, GLenum srcAlpha, GLenum dstAlpha)=0
Definition: IFontImage.h:53
void SetupTexture(IFontImage *texture)
Definition: gls_font_renderer.h:591
void TextureMinFilter(unsigned char val)
Definition: gls_font_renderer.h:101
virtual void PopAlphaBlendFunc()=0
The disti::GlsFontBase class and related classes.
The disti::GlsQuadListVC_3D and GlsQuadListVCT_2D classes.
GlsColor _currentColor
Definition: gls_font_renderer.h:515
Image * Texture() const
Definition: gls_font_base.h:317
virtual void BindTexture()=0
unsigned char TextureMagFilter()
Definition: gls_font_renderer.h:107
Definition: gls_state_manager_interface.h:67
Definition: gls_quad_storage.h:156
unsigned char TextureMinFilter()
Definition: gls_font_renderer.h:95
The disti::GlsStateManager factory class. Creates an instance of a state manager that manages the GL ...
The Color class: Implements a 4 component RGBA color.
The Image class. All textures are converted internally into Images.
virtual void PushAlphaBlendFunc()=0
const GlsFontBase * _font
Definition: gls_font_renderer.h:519
VertexNoColor Vector
Definition: gls_font_base.h:66
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:362
Definition: gls_font_renderer.h:84
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:300
The disti::Vertex class. A class for manipulating 3D vertices.
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:441
void SetFont(const GlsFontBase *font)
Definition: gls_font_renderer.h:127
Definition: gls_color.h:53
unsigned char _textureMagFilter
Definition: gls_font_renderer.h:525
void InitRendering()
Definition: gls_font_renderer.h:179
void TermRendering()
Definition: gls_font_renderer.h:189
Definition: display_types.h:71
void TextureMagFilter(unsigned char val)
Definition: gls_font_renderer.h:113
Definition: display_types.h:74
Definition: display_types.h:70
Definition: display_types.h:72
void AddQuad2D(const float x1, const float y1, const float x2, const float y2)
Character attributes. One item for each character in the set.
Definition: gls_font_base.h:124
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:479
void InitRendering(unsigned char textureMinFilter, unsigned char textureMagFilter)
Definition: gls_font_renderer.h:145
Definition: bmpimage.h:46
GlsFontRenderer(const GlsFontBase *font)
Definition: gls_font_renderer.h:505
void RGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
Definition: gls_color.h:168
IFontImage.
Definition: gls_font_base.h:85
The gls_gl.