1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>AllegroGL: Text drawing and fonts.</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="alleggl.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">AllegroGL <span id="projectnumber">0.4.4</span></div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
initNavTree('group__Text.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<h1>Text drawing and fonts.</h1> </div>
</div>
<div class="contents">
<p>AllegroGL now provides mechanisms for converting Allegro FONTs to a format which is more usable in OpenGL.
<a href="#_details">More...</a></p>
<h2><a name="member-group"></a>
Text Drawing and Font conversion</h2>
<ul>
<li>int <a class="el" href="group__Text.html#ga84ecf6d5f5b363d7715e15eca8ebafeb">allegro_gl_printf</a> (AL_CONST FONT *f, float x, float y, float z, int color, AL_CONST char *format,...)
<dl class="el"><dd class="mdescRight">Equivalent to: <a href="#ga84ecf6d5f5b363d7715e15eca8ebafeb"></a><br/></dl><li>int <a class="el" href="group__Text.html#gab93317445f8a566f8b5632e04fbf8e5b">allegro_gl_printf_ex</a> (AL_CONST FONT *f, float x, float y, float z, AL_CONST char *format,...)
<dl class="el"><dd class="mdescRight">Prints a formatted string (printf style) on the screen. <a href="#gab93317445f8a566f8b5632e04fbf8e5b"></a><br/></dl><li>FONT * <a class="el" href="group__Text.html#gad01388c5188ae09628284aa2425acae9">allegro_gl_convert_allegro_font</a> (FONT *f, int type, float scale)
<dl class="el"><dd class="mdescRight">Equivalent to: <a href="#gad01388c5188ae09628284aa2425acae9"></a><br/></dl><li>FONT * <a class="el" href="group__Text.html#ga4986ec80f1a3362e47f7669461fef414">allegro_gl_convert_allegro_font_ex</a> (FONT *f, int type, float scale, GLint format)
<dl class="el"><dd class="mdescRight">Converts a regular Allegro FONT to the AGL format for 3D display. <a href="#ga4986ec80f1a3362e47f7669461fef414"></a><br/></dl><li>void <a class="el" href="group__Text.html#ga62e79ccec5062f1cdadbc225319e9b44">allegro_gl_set_font_generation_mode</a> (int mode)
<dl class="el"><dd class="mdescRight">Set the font generation mode for system fonts. <a href="#ga62e79ccec5062f1cdadbc225319e9b44"></a><br/></dl><li>FONT * <a class="el" href="group__Text.html#ga5bddcc6c1954665140083928117519de">allegro_gl_load_system_font</a> (char *name, int style, int w, int h)
<dl class="el"><dd class="mdescRight">Short hand for aglf_load_system_font_ex(name, <a class="el" href="group__Text.html#gaba7b8c941356029687ff4b4340e8b841" title="Indicates that you want fonts to be converted to an outline format.">AGL_FONT_TYPE_OUTLINE</a>, style, w, h, 0.0f, 32, 256) <a href="#ga5bddcc6c1954665140083928117519de"></a><br/></dl><li>FONT * <a class="el" href="group__Text.html#ga4ad68c54b0183c60cdbf2c7a02dc3157">allegro_gl_load_system_font_ex</a> (char *name, int type, int style, int w, int h, float depth, int start, int end)
<dl class="el"><dd class="mdescRight">Loads a system font. <a href="#ga4ad68c54b0183c60cdbf2c7a02dc3157"></a><br/></dl><li>void <a class="el" href="group__Text.html#gabcbdd9810f7254cdb105f987ae1e557f">allegro_gl_destroy_font</a> (FONT *f)
<dl class="el"><dd class="mdescRight">void <a class="el" href="group__Text.html#gabcbdd9810f7254cdb105f987ae1e557f" title="void allegro_gl_destroy_font(FONT *usefont)">allegro_gl_destroy_font(FONT *usefont)</a> <a href="#gabcbdd9810f7254cdb105f987ae1e557f"></a><br/></dl><li>size_t <a class="el" href="group__Text.html#ga70b78c3a523dc9977c222d466edc6a5a">allegro_gl_list_font_textures</a> (FONT *f, GLuint *ids, size_t max_num_id)
<dl class="el"><dd class="mdescRight">List the texture ID of all textures forming the specified font. <a href="#ga70b78c3a523dc9977c222d466edc6a5a"></a><br/></dl><li>#define <a class="el" href="group__Text.html#gad2ebae17d2548a5befb888f8618f2206">AGL_FONT_TYPE_DONT_CARE</a>   -1
<dl class="el"><dd class="mdescRight">Indicates that you don't really care how a font will be converted. <a href="#gad2ebae17d2548a5befb888f8618f2206"></a><br/></dl><li>#define <a class="el" href="group__Text.html#ga7ed8fdc1b0065d2fe584b15d69108b1a">AGL_FONT_TYPE_BITMAP</a>   0
<dl class="el"><dd class="mdescRight">Indicates that you want fonts to be converted to a bitmap format. <a href="#ga7ed8fdc1b0065d2fe584b15d69108b1a"></a><br/></dl><li>#define <a class="el" href="group__Text.html#gaba7b8c941356029687ff4b4340e8b841">AGL_FONT_TYPE_OUTLINE</a>   1
<dl class="el"><dd class="mdescRight">Indicates that you want fonts to be converted to an outline format. <a href="#gaba7b8c941356029687ff4b4340e8b841"></a><br/></dl><li>#define <a class="el" href="group__Text.html#ga92bf039bc7b06568273ee17f15cf6671">AGL_FONT_TYPE_TEXTURED</a>   2
<dl class="el"><dd class="mdescRight">Indicates that you want fonts to be converted to a texture format. <a href="#ga92bf039bc7b06568273ee17f15cf6671"></a><br/></dl><li>#define <a class="el" href="group__Text.html#gab77d7d2c6ec6d1786472943f7cd814ca">AGL_FONT_STYLE_BOLD</a>   1
<dl class="el"><dd class="mdescRight">Creates a font with bold characters. <a href="#gab77d7d2c6ec6d1786472943f7cd814ca"></a><br/></dl><li>#define <a class="el" href="group__Text.html#ga27874c1fb7fdc1e00115bd853c973fc3">AGL_FONT_STYLE_BLACK</a>   2
<dl class="el"><dd class="mdescRight">Creates a font with black (strong bold) characters. <a href="#ga27874c1fb7fdc1e00115bd853c973fc3"></a><br/></dl><li>#define <a class="el" href="group__Text.html#ga67c48bf08c2b6cd6cc1a08dec2c7c5ef">AGL_FONT_STYLE_ITALIC</a>   4
<dl class="el"><dd class="mdescRight">Creates a font with italicized characters. <a href="#ga67c48bf08c2b6cd6cc1a08dec2c7c5ef"></a><br/></dl><li>#define <a class="el" href="group__Text.html#gae9e4682339d264429ee601c632231c9f">AGL_FONT_STYLE_UNDERLINE</a>   8
<dl class="el"><dd class="mdescRight">Creates a font with underlined characters. <a href="#gae9e4682339d264429ee601c632231c9f"></a><br/></dl><li>#define <a class="el" href="group__Text.html#ga6ba31b9c7866d28b5494fad2577569db">AGL_FONT_STYLE_STRIKEOUT</a>   16
<dl class="el"><dd class="mdescRight">Creates a font with striked out characters. <a href="#ga6ba31b9c7866d28b5494fad2577569db"></a><br/></dl><li>#define <a class="el" href="group__Text.html#ga91cc859278878dd4bf200bed7eab4359">AGL_FONT_STYLE_ANTI_ALIASED</a>   32
<dl class="el"><dd class="mdescRight">Creates a font with anti-aliased characters. <a href="#ga91cc859278878dd4bf200bed7eab4359"></a><br/></dl><li>#define <a class="el" href="group__Text.html#ga4b45ef558e7934ceaaff146f450ab23f">AGL_FONT_POLYGONS</a>   1
<dl class="el"><dd class="mdescRight">Font generation mode. <a href="#ga4b45ef558e7934ceaaff146f450ab23f"></a><br/></dl><li>#define <a class="el" href="group__Text.html#ga0b426eb30e7203eb094a7adfbb04cb6d">AGL_FONT_LINES</a>   2
<dl class="el"><dd class="mdescRight">Font generation mode. <a href="#ga0b426eb30e7203eb094a7adfbb04cb6d"></a><br/></dl></ul>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>AllegroGL now provides mechanisms for converting Allegro FONTs to a format which is more usable in OpenGL. </p>
<p>You can also load system fonts (such as Arial and Courrier) and draw using those. Allegro FONTs should still work if you use textout, textprintf, etc on them. However, converted Allegro FONTs will not work with these functions. You will have to use AllegroGL functions to work with AllegroGL FONTs. </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="gad2ebae17d2548a5befb888f8618f2206"></a><!-- doxytag: member="alleggl.h::AGL_FONT_TYPE_DONT_CARE" ref="gad2ebae17d2548a5befb888f8618f2206" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_FONT_TYPE_DONT_CARE   -1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Indicates that you don't really care how a font will be converted. </p>
<p>AGL will pick the best format for you. </p>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00618">618</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
<p>Referenced by <a class="el" href="fontconv_8c_source.html#l00688">allegro_gl_convert_allegro_font_ex()</a>.</p>
</div>
</div>
<a class="anchor" id="ga7ed8fdc1b0065d2fe584b15d69108b1a"></a><!-- doxytag: member="alleggl.h::AGL_FONT_TYPE_BITMAP" ref="ga7ed8fdc1b0065d2fe584b15d69108b1a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_FONT_TYPE_BITMAP   0</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Indicates that you want fonts to be converted to a bitmap format. </p>
<p>Bitmaps are used to represent characters with one bit per pixel, and are usually very slow to draw, as they stall the 3D pipeline. Note that you can't scale, rotate or place text with a z coordinate if you use this style. A display list will be created.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Text.html#gad01388c5188ae09628284aa2425acae9" title="Equivalent to:">allegro_gl_convert_allegro_font()</a>, <a class="el" href="group__Text.html#ga84ecf6d5f5b363d7715e15eca8ebafeb" title="Equivalent to:">allegro_gl_printf()</a> </dd></dl>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00629">629</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
<p>Referenced by <a class="el" href="fontconv_8c_source.html#l00688">allegro_gl_convert_allegro_font_ex()</a>, <a class="el" href="aglf_8c_source.html#l00573">allegro_gl_destroy_font()</a>, and <a class="el" href="aglf_8c_source.html#l00169">allegro_gl_printf_ex()</a>.</p>
</div>
</div>
<a class="anchor" id="gaba7b8c941356029687ff4b4340e8b841"></a><!-- doxytag: member="alleggl.h::AGL_FONT_TYPE_OUTLINE" ref="gaba7b8c941356029687ff4b4340e8b841" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_FONT_TYPE_OUTLINE   1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Indicates that you want fonts to be converted to an outline format. </p>
<p>Outlined mode is a vector-style font. Characters are represented by a set of polygons and lines. This style of fonts is fast to draw, and can be scaled, rotated, etc, since they are just vectors. A display list will be created.</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>Non-textured fonts will be dropped from AllegroGL.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Text.html#gad01388c5188ae09628284aa2425acae9" title="Equivalent to:">allegro_gl_convert_allegro_font()</a>, <a class="el" href="group__Text.html#ga84ecf6d5f5b363d7715e15eca8ebafeb" title="Equivalent to:">allegro_gl_printf()</a> </dd></dl>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00641">641</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
<p>Referenced by <a class="el" href="fontconv_8c_source.html#l00688">allegro_gl_convert_allegro_font_ex()</a>, <a class="el" href="aglf_8c_source.html#l00573">allegro_gl_destroy_font()</a>, <a class="el" href="aglf_8c_source.html#l00485">allegro_gl_load_system_font()</a>, and <a class="el" href="aglf_8c_source.html#l00169">allegro_gl_printf_ex()</a>.</p>
</div>
</div>
<a class="anchor" id="ga92bf039bc7b06568273ee17f15cf6671"></a><!-- doxytag: member="alleggl.h::AGL_FONT_TYPE_TEXTURED" ref="ga92bf039bc7b06568273ee17f15cf6671" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_FONT_TYPE_TEXTURED   2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Indicates that you want fonts to be converted to a texture format. </p>
<p>Each character is represented by a textured quad. The texture is common for all characters of the same font, and it will automatically be uploaded to the video card when needed. Drawing text with this type of font is the fastest since only two triangles are needed per character. Textured text can also be scaled and rotated. A display list will be created.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Text.html#gad01388c5188ae09628284aa2425acae9" title="Equivalent to:">allegro_gl_convert_allegro_font()</a>, <a class="el" href="group__Text.html#ga84ecf6d5f5b363d7715e15eca8ebafeb" title="Equivalent to:">allegro_gl_printf()</a> </dd></dl>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00653">653</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
<p>Referenced by <a class="el" href="fontconv_8c_source.html#l00688">allegro_gl_convert_allegro_font_ex()</a>, <a class="el" href="aglf_8c_source.html#l00573">allegro_gl_destroy_font()</a>, and <a class="el" href="aglf_8c_source.html#l00169">allegro_gl_printf_ex()</a>.</p>
</div>
</div>
<a class="anchor" id="gab77d7d2c6ec6d1786472943f7cd814ca"></a><!-- doxytag: member="alleggl.h::AGL_FONT_STYLE_BOLD" ref="gab77d7d2c6ec6d1786472943f7cd814ca" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_FONT_STYLE_BOLD   1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates a font with bold characters. </p>
<p>System fonts only.</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000003">Deprecated:</a></b></dt><dd>Non-textured fonts will be dropped from AllegroGL </dd></dl>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00661">661</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga27874c1fb7fdc1e00115bd853c973fc3"></a><!-- doxytag: member="alleggl.h::AGL_FONT_STYLE_BLACK" ref="ga27874c1fb7fdc1e00115bd853c973fc3" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_FONT_STYLE_BLACK   2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates a font with black (strong bold) characters. </p>
<p>System fonts only. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000004">Deprecated:</a></b></dt><dd>Non-textured fonts will be dropped from AllegroGL. </dd></dl>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00666">666</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga67c48bf08c2b6cd6cc1a08dec2c7c5ef"></a><!-- doxytag: member="alleggl.h::AGL_FONT_STYLE_ITALIC" ref="ga67c48bf08c2b6cd6cc1a08dec2c7c5ef" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_FONT_STYLE_ITALIC   4</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates a font with italicized characters. </p>
<p>System fonts only. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000005">Deprecated:</a></b></dt><dd>Non-textured fonts will be dropped from AllegroGL. </dd></dl>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00671">671</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
</div>
</div>
<a class="anchor" id="gae9e4682339d264429ee601c632231c9f"></a><!-- doxytag: member="alleggl.h::AGL_FONT_STYLE_UNDERLINE" ref="gae9e4682339d264429ee601c632231c9f" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_FONT_STYLE_UNDERLINE   8</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates a font with underlined characters. </p>
<p>System fonts only. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000006">Deprecated:</a></b></dt><dd>Non-textured fonts will be dropped from AllegroGL. </dd></dl>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00676">676</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga6ba31b9c7866d28b5494fad2577569db"></a><!-- doxytag: member="alleggl.h::AGL_FONT_STYLE_STRIKEOUT" ref="ga6ba31b9c7866d28b5494fad2577569db" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_FONT_STYLE_STRIKEOUT   16</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates a font with striked out characters. </p>
<p>System fonts only. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000007">Deprecated:</a></b></dt><dd>Non-textured fonts will be dropped from AllegroGL. </dd></dl>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00681">681</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga91cc859278878dd4bf200bed7eab4359"></a><!-- doxytag: member="alleggl.h::AGL_FONT_STYLE_ANTI_ALIASED" ref="ga91cc859278878dd4bf200bed7eab4359" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_FONT_STYLE_ANTI_ALIASED   32</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates a font with anti-aliased characters. </p>
<p>System fonts only. Anti-aliasing may not be available, and no error will be reported if such is the case. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000008">Deprecated:</a></b></dt><dd>Non-textured fonts will be dropped from AllegroGL. </dd></dl>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00688">688</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga4b45ef558e7934ceaaff146f450ab23f"></a><!-- doxytag: member="alleggl.h::AGL_FONT_POLYGONS" ref="ga4b45ef558e7934ceaaff146f450ab23f" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_FONT_POLYGONS   1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Font generation mode. </p>
<p>System fonts only. Indicates that you want outline system fonts to be generated using polygons. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000009">Deprecated:</a></b></dt><dd>Non-textured fonts will be dropped from AllegroGL.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Text.html#ga5bddcc6c1954665140083928117519de" title="Short hand for aglf_load_system_font_ex(name, AGL_FONT_TYPE_OUTLINE, style, w, h, 0...">allegro_gl_load_system_font()</a>, <a class="el" href="group__Text.html#ga4ad68c54b0183c60cdbf2c7a02dc3157" title="Loads a system font.">allegro_gl_load_system_font_ex()</a> </dd></dl>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00696">696</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga0b426eb30e7203eb094a7adfbb04cb6d"></a><!-- doxytag: member="alleggl.h::AGL_FONT_LINES" ref="ga0b426eb30e7203eb094a7adfbb04cb6d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_FONT_LINES   2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Font generation mode. </p>
<p>System fonts only. Indicates that you want outline system fonts to be generated using lines. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000010">Deprecated:</a></b></dt><dd>Non-textured fonts will be dropped from AllegroGL.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Text.html#ga5bddcc6c1954665140083928117519de" title="Short hand for aglf_load_system_font_ex(name, AGL_FONT_TYPE_OUTLINE, style, w, h, 0...">allegro_gl_load_system_font()</a>, <a class="el" href="group__Text.html#ga4ad68c54b0183c60cdbf2c7a02dc3157" title="Loads a system font.">allegro_gl_load_system_font_ex()</a> </dd></dl>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00705">705</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga84ecf6d5f5b363d7715e15eca8ebafeb"></a><!-- doxytag: member="alleggl.h::allegro_gl_printf" ref="ga84ecf6d5f5b363d7715e15eca8ebafeb" args="(AL_CONST FONT *f, float x, float y, float z, int color, AL_CONST char *format,...)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int allegro_gl_printf </td>
<td>(</td>
<td class="paramtype">AL_CONST FONT * </td>
<td class="paramname"><em>f</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"><em>y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"><em>z</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>color</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">AL_CONST char * </td>
<td class="paramname"><em>format</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname"><em>...</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Equivalent to: </p>
<pre>
r = getr(color);
g = getg(color);
b = getb(color);
a = geta(color);
glColor4f(r, g, b, a);
allegro_gl_printf_ex(f, x, y, z,
format, ...);
</pre><p>Note that the current primary color is not preserved. </p>
<p>Definition at line <a class="el" href="aglf_8c_source.html#l00067">67</a> of file <a class="el" href="aglf_8c_source.html">aglf.c</a>.</p>
<p>References <a class="el" href="aglf_8c_source.html#l00169">allegro_gl_printf_ex()</a>.</p>
</div>
</div>
<a class="anchor" id="gab93317445f8a566f8b5632e04fbf8e5b"></a><!-- doxytag: member="alleggl.h::allegro_gl_printf_ex" ref="gab93317445f8a566f8b5632e04fbf8e5b" args="(AL_CONST FONT *f, float x, float y, float z, AL_CONST char *format,...)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int allegro_gl_printf_ex </td>
<td>(</td>
<td class="paramtype">AL_CONST FONT * </td>
<td class="paramname"><em>f</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"><em>y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"><em>z</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">AL_CONST char * </td>
<td class="paramname"><em>format</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname"><em>...</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Prints a formatted string (printf style) on the screen. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">f</td><td>Which font to use. </td></tr>
<tr><td class="paramname">x,y,z</td><td>Coordinates to print at. They specify the top-left corner of the text position. </td></tr>
<tr><td class="paramname">format</td><td>The format string (see printf() for details)</td></tr>
</table>
</dd>
</dl>
<p>For bitmap fonts, the raster position is set to (x,y), 'z' is ignored. The current modelview matrix applies to this code so you may want to use glLoadIdentity() beforehand. On the other hand, you can use the modelview matrix to apply transformations to the text. This will only work with textured or vector (outline) fonts. This function only accepts AllegroGL formated fonts, as converted by <a class="el" href="group__Text.html#gad01388c5188ae09628284aa2425acae9" title="Equivalent to:">allegro_gl_convert_allegro_font()</a>, or loaded by <a class="el" href="group__Text.html#ga5bddcc6c1954665140083928117519de" title="Short hand for aglf_load_system_font_ex(name, AGL_FONT_TYPE_OUTLINE, style, w, h, 0...">allegro_gl_load_system_font()</a> or <a class="el" href="group__Text.html#ga4ad68c54b0183c60cdbf2c7a02dc3157" title="Loads a system font.">allegro_gl_load_system_font_ex()</a>.</p>
<p>Texturing must be enabled for this function to work with <a class="el" href="group__Text.html#ga92bf039bc7b06568273ee17f15cf6671" title="Indicates that you want fonts to be converted to a texture format.">AGL_FONT_TYPE_TEXTURED</a> fonts.</p>
<p>Remember to use <code>glEnable(GL_TEXTURE_2D)</code> to enable texturing.</p>
<p>The resulting size may not be what you expect. For bitmaped fonts, there is nothing you can do about this appart changing the font itself. Textured and Vector fonts are more flexible, in that you can use glScale to adjust the size of the characters.</p>
<p>If you need to draw the text without the black backround, we suggest you set up a proper blending mode prior to drawing the text, such as: </p>
<pre>
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR);
</pre><p>If you want to emulate the Allegro drawing mode (no blending at all), then you should use the folowing code instead:</p>
<pre>
glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND);</pre><pre> glBlendFunc(GL_DST_COLOR, GL_ZERO);
<a class="el" href="group__Text.html#ga84ecf6d5f5b363d7715e15eca8ebafeb" title="Equivalent to:">allegro_gl_printf()</a>;</pre><pre> glBlendFunc(GL_ONE, GL_ONE);
<a class="el" href="group__Text.html#ga84ecf6d5f5b363d7715e15eca8ebafeb" title="Equivalent to:">allegro_gl_printf()</a>; // Same as the one above!</pre><pre> glEnable(GL_DEPTH_TEST);
</pre><p>Have a look at NeHe's Tutorial #20 for details on this technique. <a href="http://nehe.gamedev.net/">http://nehe.gamedev.net/</a></p>
<p>The most flexible way to use fonts, though, is to use alpha textures based on a greyscale font. Set the texture format to <code>GL_ALPHA4</code> or <code>GL_ALPHA8</code> before creating the (textured) font. Then you can set the colour and blend modes like so:</p>
<pre>
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
allegro_gl_printf_ex(my_font, x, y, z, "Hi!")
</pre><dl class="return"><dt><b>Returns:</b></dt><dd>The number of characters printed. </dd></dl>
<p>Definition at line <a class="el" href="aglf_8c_source.html#l00169">169</a> of file <a class="el" href="aglf_8c_source.html">aglf.c</a>.</p>
<p>References <a class="el" href="alleggl_8h_source.html#l00629">AGL_FONT_TYPE_BITMAP</a>, <a class="el" href="alleggl_8h_source.html#l00641">AGL_FONT_TYPE_OUTLINE</a>, and <a class="el" href="alleggl_8h_source.html#l00653">AGL_FONT_TYPE_TEXTURED</a>.</p>
<p>Referenced by <a class="el" href="aglf_8c_source.html#l00067">allegro_gl_printf()</a>.</p>
</div>
</div>
<a class="anchor" id="gad01388c5188ae09628284aa2425acae9"></a><!-- doxytag: member="alleggl.h::allegro_gl_convert_allegro_font" ref="gad01388c5188ae09628284aa2425acae9" args="(FONT *f, int type, float scale)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">FONT* allegro_gl_convert_allegro_font </td>
<td>(</td>
<td class="paramtype">FONT * </td>
<td class="paramname"><em>f</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>type</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"><em>scale</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Equivalent to: </p>
<pre>
allegro_gl_convert_allegro_font_ex(f, type, scale, format_state);
</pre><p>Where format_state is the last specified format to <a class="el" href="group__texture.html#ga5d535e8af776dd449cc4755b9e3585b1" title="Sets the color format you'd like OpenGL to use for its textures.">allegro_gl_set_texture_format()</a>. If <a class="el" href="group__texture.html#ga5d535e8af776dd449cc4755b9e3585b1" title="Sets the color format you'd like OpenGL to use for its textures.">allegro_gl_set_texture_format()</a> was not previously called, AllegroGL will try to determine the texture format automatically.</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000014">Deprecated:</a></b></dt><dd></dd></dl>
<p>Definition at line <a class="el" href="fontconv_8c_source.html#l00623">623</a> of file <a class="el" href="fontconv_8c_source.html">fontconv.c</a>.</p>
<p>References <a class="el" href="fontconv_8c_source.html#l00688">allegro_gl_convert_allegro_font_ex()</a>, and <a class="el" href="texture_8c_source.html#l00248">allegro_gl_get_texture_format()</a>.</p>
</div>
</div>
<a class="anchor" id="ga4986ec80f1a3362e47f7669461fef414"></a><!-- doxytag: member="alleggl.h::allegro_gl_convert_allegro_font_ex" ref="ga4986ec80f1a3362e47f7669461fef414" args="(FONT *f, int type, float scale, GLint format)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">FONT* allegro_gl_convert_allegro_font_ex </td>
<td>(</td>
<td class="paramtype">FONT * </td>
<td class="paramname"><em>f</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>type</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"><em>scale</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">GLint </td>
<td class="paramname"><em>format</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Converts a regular Allegro FONT to the AGL format for 3D display. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">f</td><td>The Allegro font to convert. </td></tr>
<tr><td class="paramname">type</td><td>The font type to convert to. (see <a class="el" href="group__Text.html#gad2ebae17d2548a5befb888f8618f2206" title="Indicates that you don't really care how a font will be converted.">AGL_FONT_TYPE_DONT_CARE</a>, <a class="el" href="group__Text.html#ga7ed8fdc1b0065d2fe584b15d69108b1a" title="Indicates that you want fonts to be converted to a bitmap format.">AGL_FONT_TYPE_BITMAP</a>, <a class="el" href="group__Text.html#ga92bf039bc7b06568273ee17f15cf6671" title="Indicates that you want fonts to be converted to a texture format.">AGL_FONT_TYPE_TEXTURED</a>) </td></tr>
<tr><td class="paramname">scale</td><td>The scaling factor (see below). </td></tr>
<tr><td class="paramname">format</td><td>The texture internal format to use.</td></tr>
</table>
</dd>
</dl>
<p>This function will build a texture map and/or a display list that will be automatically uploaded to the video card. You can only convert to bitmap or textured fonts.</p>
<p>You can't convert an Allegro font to a vector font (<a class="el" href="group__Text.html#gaba7b8c941356029687ff4b4340e8b841" title="Indicates that you want fonts to be converted to an outline format.">AGL_FONT_TYPE_OUTLINE</a>) as the logistics of such an operation are quite complex. The original font will NOT be modified.</p>
<p>A valid OpenGL rendering context is required, so you may only call this function after a successful call to set_gfx_mode() with a valid OpenGL mode.</p>
<p>You should destroy the font via <a class="el" href="group__Text.html#gabcbdd9810f7254cdb105f987ae1e557f" title="void allegro_gl_destroy_font(FONT *usefont)">allegro_gl_destroy_font()</a> when you are done with it.</p>
<p><b>Scaling</b></p>
<p>For <a class="el" href="group__Text.html#ga92bf039bc7b06568273ee17f15cf6671" title="Indicates that you want fonts to be converted to a texture format.">AGL_FONT_TYPE_TEXTURED</a> fonts, glyphs in the font need to be mapped to OpenGL coordinates. The scale factor ensures that you get the scaling you need. scale reprents the number of pixels to be mapped to 1.0 OpenGL units. For allegro_gl_convert_font() to behave like AllegroGL 0.0.24 and earlier, you'll need to pass 16.0 as the scale factor.</p>
<p>Alternativaly, you can make all your fonts be 1.0 units high by using: </p>
<pre>
allegro_gl_convert_allegro_font(f, <a class="el" href="group__Text.html#ga92bf039bc7b06568273ee17f15cf6671" title="Indicates that you want fonts to be converted to a texture format.">AGL_FONT_TYPE_TEXTURED</a>, 1.0/text_height(f));
</pre><p>Note that it is allowed for the scaling factor to be negative, in case your fonts appear upside down.</p>
<p>If you are planning to use your fonts on an orthographic projection where one unit maps to one pixel, then you should pass 1.0 as scale.</p>
<p>The scaling factor has no meaning for <a class="el" href="group__Text.html#ga7ed8fdc1b0065d2fe584b15d69108b1a" title="Indicates that you want fonts to be converted to a bitmap format.">AGL_FONT_TYPE_BITMAP</a> fonts, so it's ignored if the conversion will lead to a font of that type.</p>
<p><b>Format</b></p>
<p>The format specifies what internal format OpenGL should use for the texture, in the case of <a class="el" href="group__Text.html#ga92bf039bc7b06568273ee17f15cf6671" title="Indicates that you want fonts to be converted to a texture format.">AGL_FONT_TYPE_TEXTURED</a> fonts. It has the same semantics as the internalformat parameter of glTexImage2D(). If you would like for AllegroGL to pick a texture format for you, you may supply -1 as the texture format. The default format for monochrome fonts is GL_INTENSITY4. The default format for colored fonts is GL_RGB8.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The converted font, or NULL on error. </dd></dl>
<p>Definition at line <a class="el" href="fontconv_8c_source.html#l00688">688</a> of file <a class="el" href="fontconv_8c_source.html">fontconv.c</a>.</p>
<p>References <a class="el" href="alleggl_8h_source.html#l00629">AGL_FONT_TYPE_BITMAP</a>, <a class="el" href="alleggl_8h_source.html#l00618">AGL_FONT_TYPE_DONT_CARE</a>, <a class="el" href="alleggl_8h_source.html#l00641">AGL_FONT_TYPE_OUTLINE</a>, <a class="el" href="alleggl_8h_source.html#l00653">AGL_FONT_TYPE_TEXTURED</a>, <a class="el" href="alleggl_8h_source.html#l00545">AGL_TEXTURE_ALPHA_ONLY</a>, <a class="el" href="alleggl_8h_source.html#l00529">AGL_TEXTURE_FLIP</a>, <a class="el" href="alleggl_8h_source.html#l00523">AGL_TEXTURE_HAS_ALPHA</a>, <a class="el" href="alleggl_8h_source.html#l00534">AGL_TEXTURE_MASKED</a>, <a class="el" href="alleggl_8h_source.html#l00518">AGL_TEXTURE_MIPMAP</a>, <a class="el" href="texture_8c_source.html#l00495">allegro_gl_check_texture_ex()</a>, and <a class="el" href="texture_8c_source.html#l01165">allegro_gl_make_texture_ex()</a>.</p>
<p>Referenced by <a class="el" href="fontconv_8c_source.html#l00623">allegro_gl_convert_allegro_font()</a>.</p>
</div>
</div>
<a class="anchor" id="ga62e79ccec5062f1cdadbc225319e9b44"></a><!-- doxytag: member="alleggl.h::allegro_gl_set_font_generation_mode" ref="ga62e79ccec5062f1cdadbc225319e9b44" args="(int mode)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void allegro_gl_set_font_generation_mode </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>mode</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set the font generation mode for system fonts. </p>
<p><b>Note:</b> This function is deprecated and will be removed in a future version.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">mode</td><td>Can be either <a class="el" href="group__Text.html#ga4b45ef558e7934ceaaff146f450ab23f" title="Font generation mode.">AGL_FONT_POLYGONS</a> or <a class="el" href="group__Text.html#ga0b426eb30e7203eb094a7adfbb04cb6d" title="Font generation mode.">AGL_FONT_LINES</a>. for creating polygonal or line characters. Default is <a class="el" href="group__Text.html#ga4b45ef558e7934ceaaff146f450ab23f" title="Font generation mode.">AGL_FONT_POLYGONS</a>.</td></tr>
</table>
</dd>
</dl>
<p>Subsequent calls to <a class="el" href="group__Text.html#ga5bddcc6c1954665140083928117519de" title="Short hand for aglf_load_system_font_ex(name, AGL_FONT_TYPE_OUTLINE, style, w, h, 0...">allegro_gl_load_system_font()</a> and <a class="el" href="group__Text.html#ga4ad68c54b0183c60cdbf2c7a02dc3157" title="Loads a system font.">allegro_gl_load_system_font_ex()</a> may be affected by this function.</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000011">Deprecated:</a></b></dt><dd></dd></dl>
<p>Definition at line <a class="el" href="aglf_8c_source.html#l00469">469</a> of file <a class="el" href="aglf_8c_source.html">aglf.c</a>.</p>
</div>
</div>
<a class="anchor" id="ga5bddcc6c1954665140083928117519de"></a><!-- doxytag: member="alleggl.h::allegro_gl_load_system_font" ref="ga5bddcc6c1954665140083928117519de" args="(char *name, int style, int w, int h)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">FONT* allegro_gl_load_system_font </td>
<td>(</td>
<td class="paramtype">char * </td>
<td class="paramname"><em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>style</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>w</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>h</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Short hand for aglf_load_system_font_ex(name, <a class="el" href="group__Text.html#gaba7b8c941356029687ff4b4340e8b841" title="Indicates that you want fonts to be converted to an outline format.">AGL_FONT_TYPE_OUTLINE</a>, style, w, h, 0.0f, 32, 256) </p>
<p><b>Note:</b> This function is deprecated and will be removed in a future version.</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000012">Deprecated:</a></b></dt><dd></dd></dl>
<p>Definition at line <a class="el" href="aglf_8c_source.html#l00485">485</a> of file <a class="el" href="aglf_8c_source.html">aglf.c</a>.</p>
<p>References <a class="el" href="alleggl_8h_source.html#l00641">AGL_FONT_TYPE_OUTLINE</a>, and <a class="el" href="aglf_8c_source.html#l00526">allegro_gl_load_system_font_ex()</a>.</p>
</div>
</div>
<a class="anchor" id="ga4ad68c54b0183c60cdbf2c7a02dc3157"></a><!-- doxytag: member="alleggl.h::allegro_gl_load_system_font_ex" ref="ga4ad68c54b0183c60cdbf2c7a02dc3157" args="(char *name, int type, int style, int w, int h, float depth, int start, int end)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">FONT* allegro_gl_load_system_font_ex </td>
<td>(</td>
<td class="paramtype">char * </td>
<td class="paramname"><em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>type</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>style</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>w</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>h</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"><em>depth</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>start</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>end</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Loads a system font. </p>
<p><b>Note:</b> This function is deprecated and will be removed in a future version.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">name</td><td>The name of the system font ("Courrier" or "Arial" for example) </td></tr>
<tr><td class="paramname">type</td><td>The font type to generate (<a class="el" href="group__Text.html#gad2ebae17d2548a5befb888f8618f2206" title="Indicates that you don't really care how a font will be converted.">AGL_FONT_TYPE_DONT_CARE</a>, <a class="el" href="group__Text.html#ga7ed8fdc1b0065d2fe584b15d69108b1a" title="Indicates that you want fonts to be converted to a bitmap format.">AGL_FONT_TYPE_BITMAP</a>, <a class="el" href="group__Text.html#gaba7b8c941356029687ff4b4340e8b841" title="Indicates that you want fonts to be converted to an outline format.">AGL_FONT_TYPE_OUTLINE</a>) </td></tr>
<tr><td class="paramname">style</td><td>The text decorations of the font to create (<a class="el" href="group__Text.html#ga67c48bf08c2b6cd6cc1a08dec2c7c5ef" title="Creates a font with italicized characters.">AGL_FONT_STYLE_ITALIC</a>, etc - can be or'ed together) </td></tr>
<tr><td class="paramname">w,h</td><td>The size of the font characters that will be created. </td></tr>
<tr><td class="paramname">depth</td><td>The z-depth of the font. 0.0f is flat, 1.0f is very thick </td></tr>
<tr><td class="paramname">start,end</td><td>The range of characters to create from 'start' (included) to 'end' (excluded) in UTF-8 format (ANSI only on Windows).</td></tr>
</table>
</dd>
</dl>
<dl class="note"><dt><b>Note:</b></dt><dd><ul>
<li>In <a class="el" href="group__Text.html#gaba7b8c941356029687ff4b4340e8b841" title="Indicates that you want fonts to be converted to an outline format.">AGL_FONT_TYPE_OUTLINE</a> type, some system fonts seem to be unresponsive to the size paramaters (w and h). You cannot depend on either a system font being present, or the font being what you expect - it is possible to have two fonts with the same name but with different graphic data.</li>
<li>BITMAP fonts have no depth.</li>
<li>The width and height parameters are also system dependent, and may or may not work with the selected font.</li>
</ul>
</dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The loaded font, or NULL on error.</dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000013">Deprecated:</a></b></dt><dd></dd></dl>
<p>Definition at line <a class="el" href="aglf_8c_source.html#l00526">526</a> of file <a class="el" href="aglf_8c_source.html">aglf.c</a>.</p>
<p>Referenced by <a class="el" href="aglf_8c_source.html#l00485">allegro_gl_load_system_font()</a>.</p>
</div>
</div>
<a class="anchor" id="gabcbdd9810f7254cdb105f987ae1e557f"></a><!-- doxytag: member="alleggl.h::allegro_gl_destroy_font" ref="gabcbdd9810f7254cdb105f987ae1e557f" args="(FONT *f)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void allegro_gl_destroy_font </td>
<td>(</td>
<td class="paramtype">FONT * </td>
<td class="paramname"><em>f</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>void <a class="el" href="group__Text.html#gabcbdd9810f7254cdb105f987ae1e557f" title="void allegro_gl_destroy_font(FONT *usefont)">allegro_gl_destroy_font(FONT *usefont)</a> </p>
<p>Destroys the font.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">f</td><td>The AGL font to be destroyed.</td></tr>
</table>
</dd>
</dl>
<p>The allocated memory is freed, as well as any display list, or texture objects it uses.</p>
<p>You cannot use that font anymore after calling this function. It's safe to call this function with a NULL pointer; a note will be placed in allegro.log if DEBUGMODE was defined.</p>
<p>If NULL is passed as the font to destroy, then this function returns immediately. </p>
<p>Definition at line <a class="el" href="aglf_8c_source.html#l00573">573</a> of file <a class="el" href="aglf_8c_source.html">aglf.c</a>.</p>
<p>References <a class="el" href="alleggl_8h_source.html#l00629">AGL_FONT_TYPE_BITMAP</a>, <a class="el" href="alleggl_8h_source.html#l00641">AGL_FONT_TYPE_OUTLINE</a>, and <a class="el" href="alleggl_8h_source.html#l00653">AGL_FONT_TYPE_TEXTURED</a>.</p>
</div>
</div>
<a class="anchor" id="ga70b78c3a523dc9977c222d466edc6a5a"></a><!-- doxytag: member="alleggl.h::allegro_gl_list_font_textures" ref="ga70b78c3a523dc9977c222d466edc6a5a" args="(FONT *f, GLuint *ids, size_t max_num_id)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t allegro_gl_list_font_textures </td>
<td>(</td>
<td class="paramtype">FONT * </td>
<td class="paramname"><em>f</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">GLuint * </td>
<td class="paramname"><em>ids</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>max_num_id</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>List the texture ID of all textures forming the specified font. </p>
<p>The font specified must be an AllegroGL font.</p>
<p>If ids is not NULL, then the ID numbers of all textures used by the font are written to the GLuint array pointed by ids. The size of that array is specified by the max_num_id parameter. This function will never write more than 'max_num_id' values in the ids array.</p>
<p>If f is NULL, then zero is returned and the ids array is never touched.</p>
<p>If the font does not contain any textures (because it is a bitmap or outline font, for example), then zero is returned.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Number of texture IDs that make up this font.</dd></dl>
<p>Here are two examples of the use of this function:</p>
<pre>
int num_ids = allegro_gl_list_font_textures(font, NULL, 0);</pre><pre> GLuint *id = malloc(sizeof(GLuint) * num_ids);</pre><pre> if (!id) {
//handle error
}</pre><pre> allegro_gl_list_font_textures(font, id, num_ids);</pre><pre> for (i = 0; i < num_ids; i++) {
glBindTexture(GL_TEXTURE_2D, id[i]);
// Use this texture
}</pre><pre> free(id);
</pre><pre>
GLint id[10]; // Reserve a safe number
GLint num_ids = allegro_gl_list_font_textures(font, id, 10);
</pre>
<p>Definition at line <a class="el" href="aglf_8c_source.html#l00689">689</a> of file <a class="el" href="aglf_8c_source.html">aglf.c</a>.</p>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="footer">Generated on Thu May 19 2011 23:20:20 for AllegroGL by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li>
</ul>
</div>
</body>
</html>
|