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
14reproduced, in whole or part, in any form, or by any means of electronic,
15mechanical, or otherwise, without the written permission of DiSTI. Said
16permission may be derived through the purchase of applicable DiSTI product
17licenses which detail the distribution rights of this content and any
18Derivative Works based on this or other copyrighted DiSTI Software.
19
20 NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26
27 LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34EXCEED FIVE DOLLARS (US$5.00).
35
36 The aforementioned terms and restrictions are governed by the laws of the
37State 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"
53#include "gls_font_base.h"
54#include "gls_state_manager.h"
55#include "image.h"
56#include "vertex.h"
57
58//===========================================================================
59// BEGIN NAMESPACE
60//===========================================================================
61namespace disti
62{
63//---------------------------------------------------------------------------
64// FORWARD REFERENCES
65//---------------------------------------------------------------------------
66class VertexNoColor;
67class GlsColor;
68class Image;
69
70typedef VertexNoColor Vector;
71
72//===========================================================================
73/**
74*
75* The GlsFontRenderer object can be used to render characters from a GlsFontBase in
76* Open GL at specific locations and with several different text effects.
77* Prior to rendering any characters, InitRendering must be invoked to set
78* up the proper drawing environment. Then call Render for each character
79* to be drawn.
80*
81* \sa GlsFontBase
82*
83*/
84//===========================================================================
86{
87public:
88 typedef GlsFontBase::Char_t Char_t; ///< Shorthand for GlsFontBase::Char_t.
89 typedef GlsFontBase::CharAttr_t CharAttr_t; ///< Shorthand for GlsFontBase::CharAttr_t.
90
91 //----------------------------------------
92 // Character rendering state variables
93 //----------------------------------------
94
95 /// \return The minification filter for this font.
96 unsigned char TextureMinFilter()
97 {
98 return _textureMinFilter;
99 }
100
101 /// Sets the minification filter for this font.
102 /// \param val The new minification to set.
103 void TextureMinFilter( unsigned char val )
104 {
105 _textureMinFilter = val;
106 }
107
108 /// \return The magnification filter for this font.
109 unsigned char TextureMagFilter()
110 {
111 return _textureMagFilter;
112 }
113
114 /// Sets the magnification filter for this font.
115 /// \param val The new magnification to set.
116 void TextureMagFilter( unsigned char val )
117 {
118 _textureMagFilter = val;
119 }
120
121 //----------------------------------------
122 // Setup and cleanup for rendering
123 //----------------------------------------
124
125 /// Set the font to use.
126 /// The font pointer must be set before calling any rendering methods.
127 /// \param font The new font to use.
128 void SetFont( const GlsFontBase* font )
129 {
130 _font = font;
131 }
132
133 /// \return A pointer to the font currently in use.
135 {
136 return _font;
137 }
138
139 /**
140 * Initializes the font to begin rendering characters. This will set up
141 * Open GL texture modes, bind the font's texture, set up minification
142 * and magnification filters, etc. This must be called once before
143 * invoking Render to draw characters. This version overwrites the
144 * texture minification and magnification filters before initializing.
145 * \param textureMinFilter Minification mode for the font texture
146 * \param textureMagFilter Magnification mode for the font texture
147 */
149 unsigned char textureMinFilter,
150 unsigned char textureMagFilter
151#ifdef GLES
152 ,
153 IGlsStateManager* stateManager
154#endif // GLES
155 )
156 {
157 _textureMinFilter = textureMinFilter;
158 _textureMagFilter = textureMagFilter;
160#ifdef GLES
161 stateManager
162#endif // GLES
163 );
164 }
165
166 /**
167 * Initializes the font to begin rendering characters. This will set up
168 * Open GL texture modes, bind the font's texture, set up minification
169 * and magnification filters, etc. This must be called before
170 * using any of the Render methods draw characters.
171 */
172
173#ifdef GLES
174
175 void InitRendering( IGlsStateManager* stateManager )
176 {
177 SetupTexture( _font->Texture(), stateManager );
178 }
179
180#else // !GLES
181
183 {
185 }
186
187 /**
188 * Restores the Open GL state as it was before the call to InitRendering.
189 * This should be called after all characters have been rendered using
190 * the Render methods.
191 */
193 {
194 glDisable( GL_TEXTURE_2D );
195 } // end GlsFontRenderer::TermRendering
196
197#endif // GLES
198
199 //----------------------------------------
200 // Rendering Methods
201 //----------------------------------------
202
203#ifdef GLES
204 /** Draw a character by adding it into the supplied QuadStorage object
205 * \deprecated inverse no longer has any effect, use the other overload instead.
206 * \param emphasize Whether to draw with emphasize or not
207 * \param emphasisOffset If drawing with emphasize, the offset in logical units
208 * \param inverse Deprecated, has no effect
209 * \param quadStorage The quad storage object to render the characters into
210 * \param x1 lower left corner x coordinate of the polygon
211 * \param y1 lower left corner y coordinate of the polygon
212 * \param x2 upper right corner x coordinate of the polygon
213 * \param y2 upper right corner y coordinate of the polygon
214 */
215 DISTI_DEPRECATED( "This overload is deprecated because the clear text effect has been superseded. Use the DrawCharacter() overload without the 'inverse' parameter." )
216 void DrawCharacter(
217 const bool emphasize,
218 const float emphasisOffset,
219 const bool inverse,
220 GlsQuadListVCT_2D& quadStorage,
221 const GLfloat x1,
222 const GLfloat y1,
223 const GLfloat x2,
224 const GLfloat y2 ) const
225 {
226 DrawCharacter( emphasize, emphasisOffset, quadStorage, x1, y1, x2, y2 );
227 }
228
229 /** Draw a character by adding it into the supplied QuadStorage object
230 * \param emphasize Whether to draw with emphasize or not
231 * \param emphasisOffset If drawing with emphasize, the offset in logical units
232 * \param quadStorage The quad storage object to render the characters into
233 * \param x1 lower left corner x coordinate of the polygon
234 * \param y1 lower left corner y coordinate of the polygon
235 * \param x2 upper right corner x coordinate of the polygon
236 * \param y2 upper right corner y coordinate of the polygon
237 */
238 void DrawCharacter(
239 const bool emphasize,
240 const float emphasisOffset,
241 GlsQuadListVCT_2D& quadStorage,
242 const GLfloat x1,
243 const GLfloat y1,
244 const GLfloat x2,
245 const GLfloat y2 ) const
246 {
247 // character color
248 quadStorage.AddQuad2D( x1, y1, x2, y2 );
249
250 // Character emphasis. Draw two more cells offset a little so
251 // character appears bolded.
252 if( emphasize )
253 {
254 GLfloat offsetY1( y1 + emphasisOffset );
255 GLfloat offsetY2( y2 + emphasisOffset );
256
257 quadStorage.AddQuad2D( x1 - emphasisOffset, offsetY1, x2 - emphasisOffset, offsetY2 );
258 quadStorage.AddQuad2D( x1 + emphasisOffset, offsetY1, x2 + emphasisOffset, offsetY2 );
259 }
260
261 } // end GlsFontRenderer::DrawCharacter
262
263 /**
264 * Draws a halo effect for the given character.
265 *
266 * \param c the character code to render
267 * \param haloOffset Controls the size of the halo
268 * GlsTextGrid uses: (emphasize ? 0.05f : 0.03f) * (character_width) (x2 - x1)
269 * \param _vertArray Pointer to the currently bound vertex array
270 * \param x1 lower left corner x coordinate of the polygon
271 * \param y1 lower left corner y coordinate of the polygon
272 * \param x2 upper right corner x coordinate of the polygon
273 * \param y2 upper right corner y coordinate of the polygon
274 */
275 void DrawHalo(
276 const float haloOffset,
277 const float diagonalOffset,
278 GlsQuadListVCT_2D& quadStorage,
279 const GLfloat x1,
280 const GLfloat y1,
281 const GLfloat x2,
282 const GLfloat y2 ) const
283 {
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 );
292
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 );
301 }
302
303#else // !GLES
304 /**
305 * Draws a character.
306 * \deprecated inverse no longer has any effect, use the other overload instead.
307 *
308 * \param emphasize true if the rendered character should be emphasized.
309 * This will essentially bold the character. If a bold
310 * font is being used, the character will appear even
311 * more bolded.
312 * \param emphasisOffset Magnitude of the emhpasis offset. A good value to try is (0.2 * character_width).
313 * \param inverse Deprecated, has no effect
314 * \param x1 lower left corner x coordinate of the polygon
315 * \param y1 lower left corner y coordinate of the polygon
316 * \param x2 upper right corner x coordinate of the polygon
317 * \param y2 upper right corner y coordinate of the polygon
318 * \param tx1 lower left corner x texture coordinate
319 * \param ty1 lower left corner y texture coordinate
320 * \param tx2 upper right corner x texture coordinate
321 * \param ty2 upper right corner y texture coordinate
322 */
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,
327 const bool inverse,
328 const GLfloat x1,
329 const GLfloat y1,
330 const GLfloat x2,
331 const GLfloat y2,
332 const GLfloat tx1,
333 const GLfloat ty1,
334 const GLfloat tx2,
335 const GLfloat ty2 ) const
336 {
337 DrawCharacter( emphasize, emphasisOffset, x1, y1, x2, y2, tx1, ty1, tx2, ty2 );
338 }
339
340 /**
341 * Draws a character.
342 *
343 * \param emphasize true if the rendered character should be emphasized.
344 * This will essentially bold the character. If a bold
345 * font is being used, the character will appear even
346 * more bolded.
347 * \param emphasisOffset Magnitude of the emhpasis offset. A good value to try is (0.2 * character_width).
348 * \param x1 lower left corner x coordinate of the polygon
349 * \param y1 lower left corner y coordinate of the polygon
350 * \param x2 upper right corner x coordinate of the polygon
351 * \param y2 upper right corner y coordinate of the polygon
352 * \param tx1 lower left corner x texture coordinate
353 * \param ty1 lower left corner y texture coordinate
354 * \param tx2 upper right corner x texture coordinate
355 * \param ty2 upper right corner y texture coordinate
356 */
358 const bool emphasize,
359 const float emphasisOffset,
360 const GLfloat x1,
361 const GLfloat y1,
362 const GLfloat x2,
363 const GLfloat y2,
364 const GLfloat tx1,
365 const GLfloat ty1,
366 const GLfloat tx2,
367 const GLfloat ty2 ) const
368 {
369 glBegin( GL_QUADS );
370
371 MapTexture( x1, y1, x2, y2, tx1, ty1, tx2, ty2 );
372 // Character emphasis. Draw two more cells offset a little so
373 // character appears bolded.
374 if( emphasize )
375 {
376 GLfloat offsetY1( y1 + emphasisOffset );
377 GLfloat offsetY2( y2 + emphasisOffset );
378
380 x1 - emphasisOffset, offsetY1, x2 - emphasisOffset, offsetY2,
381 tx1, ty1, tx2, ty2 );
382
384 x1 + emphasisOffset, offsetY1, x2 + emphasisOffset, offsetY2,
385 tx1, ty1, tx2, ty2 );
386 }
387
388 glEnd();
389
390 } // end GlsFontRenderer::DrawCharacter
391
392 /// Draws a halo effect for the given character.
393 /// \param haloOffset Controls the size of the halo
394 /// GlsTextGrid uses: (emphasize ? 0.05f : 0.03f) * (character_width) (x2 - x1)
395 /// \param diagonalOffset The offset to use for the four diagonal directions.
396 /// \param x1 The lower left corner x coordinate of the polygon.
397 /// \param y1 The lower left corner y coordinate of the polygon.
398 /// \param x2 The upper right corner x coordinate of the polygon.
399 /// \param y2 The upper right corner y coordinate of the polygon.
400 /// \param tx1 The lower left corner x texture coordinate.
401 /// \param ty1 The lower left corner y texture coordinate.
402 /// \param tx2 The upper right corner x texture coordinate.
403 /// \param ty2 The upper right corner y texture coordinate.
405 const float haloOffset,
406 const float diagonalOffset,
407 const GLfloat x1,
408 const GLfloat y1,
409 const GLfloat x2,
410 const GLfloat y2,
411 const GLfloat tx1,
412 const GLfloat ty1,
413 const GLfloat tx2,
414 const GLfloat ty2 ) const
415 {
416 // Halo effect.
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 );
425
426 glBegin( GL_QUADS );
427
428 // Shift left and up
430 x1left, y1up, x2left, y2up,
431 tx1, ty1, tx2, ty2 );
432
433 // Shift left and down
435 x1left, y1down, x2left, y2down,
436 tx1, ty1, tx2, ty2 );
437
438 // Shift right and up
440 x1right, y1up, x2right, y2up,
441 tx1, ty1, tx2, ty2 );
442
443 // Shift right and down
445 x1right, y1down, x2right, y2down,
446 tx1, ty1, tx2, ty2 );
447
448 // Shift left
450 x1 - haloOffset, y1, x2 - haloOffset, y2,
451 tx1, ty1, tx2, ty2 );
452
453 // Shift down
455 x1, y1 - haloOffset, x2, y2 - haloOffset,
456 tx1, ty1, tx2, ty2 );
457
458 // Shift right
460 x1 + haloOffset, y1, x2 + haloOffset, y2,
461 tx1, ty1, tx2, ty2 );
462
463 // Shift up
465 x1, y1 + haloOffset, x2, y2 + haloOffset,
466 tx1, ty1, tx2, ty2 );
467
468 glEnd();
469 } // end GlsFontRenderer::DrawHalo
470
471 /**
472 * Draws a drop shadow effect for a character.
473 * \param shadowOffset distance to offset the shadow from the character
474 * \param x1 lower left corner x coordinate of the polygon
475 * \param y1 lower left corner y coordinate of the polygon
476 * \param x2 upper right corner x coordinate of the polygon
477 * \param y2 upper right corner y coordinate of the polygon
478 * \param tx1 lower left corner x texture coordinate
479 * \param ty1 lower left corner y texture coordinate
480 * \param tx2 upper right corner x texture coordinate
481 * \param ty2 upper right corner y texture coordinate
482 */
484 const float shadowOffset,
485 const GLfloat x1,
486 const GLfloat y1,
487 const GLfloat x2,
488 const GLfloat y2,
489 const GLfloat tx1,
490 const GLfloat ty1,
491 const GLfloat tx2,
492 const GLfloat ty2 ) const
493 {
494 // Shadow effect.
495 glBegin( GL_QUADS );
496
497 // Shift right and down
499 x1 + shadowOffset,
500 y1 - shadowOffset,
501 x2 + shadowOffset,
502 y2 - shadowOffset,
503 tx1, ty1, tx2, ty2 );
504
505 glEnd();
506
507 } // end GlsFontRenderer::DrawShadow
508
509 /**
510 * Map a square piece of a texture onto a quad ( assumed to be called
511between glBegin(GL_QUADS)...glEnd() pair )
512 * \param x1 the lower left corner x of the quad
513 * \param y1 the lower left corner y of the quad
514 * \param x2 the upper right corner x of the quad
515 * \param y2 the upper right corner of the quad
516 * \param tx1 lower left corner x texture coordinate
517 * \param ty1 lower left corner y texture coordinate
518 * \param tx2 upper right corner x texture coordinate
519 * \param ty2 upper right corner y texture coordinate
520 */
521 static void MapTexture(
522 const GLfloat x1,
523 const GLfloat y1,
524 const GLfloat x2,
525 const GLfloat y2,
526 const GLfloat tx1,
527 const GLfloat ty1,
528 const GLfloat tx2,
529 const GLfloat ty2 )
530 {
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 );
539 }
540
541#endif // GLES
542
543 /**
544 * Create a GlsFontRenderer with the default settings.
545 * \param font The font to use for rendering. This may be NULL on creation, but it must be set before rendering.
546 */
548 : _font( font )
551 {
552 }
553
554protected:
555#ifndef GLES
556 /** Current drawing color is kept so we don't have to make an OpenGL call if the color is the same */
558#endif
559
560 /** Pointer to the font to use for rendering */
562
563 /** Minification mode for the font texture */
564 unsigned char _textureMinFilter;
565
566 /** Magnification mode for the font texture */
567 unsigned char _textureMagFilter;
568
569 /// Helper method to set up Open GL texture modes, bind the font's texture,
570 /// set up minification and magnification filters, etc.
571 /// \param texture The font texture to bind.
572
573#ifdef GLES
574
575 void SetupTexture( IFontImage* texture, IGlsStateManager* stateManager )
576 {
578 if( mipMap )
579 {
580 // This will force the image to create the mipmap images
581 texture->MipMap( true );
582 }
583
584 // Initialize the font texture
585 stateManager->Texture2DEnabled( true );
586 stateManager->BindTexture( texture );
587
588 // Set up mip mapping for magnification
590 {
591 stateManager->SetTextureMagFilter( GL_NEAREST );
592 }
594 {
595 stateManager->SetTextureMagFilter( GL_LINEAR );
596 }
597
598 // Set up mip mapping for minification
599 switch( _textureMinFilter )
600 {
602 stateManager->SetTextureMinFilter( GL_NEAREST );
603 break;
604
606 stateManager->SetTextureMinFilter( GL_LINEAR );
607 break;
608
610 stateManager->SetTextureMinFilter( GL_NEAREST_MIPMAP_NEAREST );
611 break;
612
614 stateManager->SetTextureMinFilter( GL_LINEAR_MIPMAP_LINEAR );
615 break;
616
618 stateManager->SetTextureMinFilter( GL_NEAREST_MIPMAP_LINEAR );
619 break;
620
622 stateManager->SetTextureMinFilter( GL_LINEAR_MIPMAP_NEAREST );
623 break;
624 }
625
626 stateManager->SetTextureEnvMode( IGlsStateManager::GLS_TEXTURE_MAP_MODE_MODULATE );
627
628 } // end GlsFontRenderer::SetupTexture
629
630#else // !GLES
631
632 void SetupTexture( IFontImage* texture )
633 {
635 if( mipMap )
636 {
637 // This will force the image to create the mipmap images
638 texture->MipMap( true );
639 }
640
641 // Initialize the drawing color
642 glColor4ubv( _currentColor.RGBA() );
643
644 // Initialize the font texture
645 glEnable( GL_TEXTURE_2D );
646 texture->BindTexture();
647
648 // Set up mip mapping for magnification
650 {
651 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
652 }
654 {
655 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
656 }
657
658 // Set up mip mapping for minification
659 switch( _textureMinFilter )
660 {
662 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
663 break;
665 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
666 break;
668 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST );
669 break;
671 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
672 break;
674 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR );
675 break;
677 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST );
678 break;
679 }
680
681 glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
682
683 } // end GlsFontRenderer::SetupTexture
684
685#endif // GLES
686
687}; // end class GlsFontRenderer
688
689} // end namespace disti
690
691#endif
IFontImage.
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 gls_gl.
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.