libdrawtext

changeset 31:bc85a35d88d7 release 0.2

cleaned up the comments in examples/nofreetype
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 15 Apr 2014 06:00:16 +0300
parents 828e29b08493
children 007b82a58596
files examples/nofreetype/simple-noft.c
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/examples/nofreetype/simple-noft.c	Tue Apr 15 05:52:01 2014 +0300
     1.2 +++ b/examples/nofreetype/simple-noft.c	Tue Apr 15 06:00:16 2014 +0300
     1.3 @@ -1,4 +1,9 @@
     1.4 -/* Simple libdrawtext example without freetype.
     1.5 +/* The "simple" example, modified to use a pre-built glyphmap instead of using freetype.
     1.6 + * This can be used when using libdrawtext-noft (built without freetype support/dependency).
     1.7 + *
     1.8 + * There is only one difference between this, and the regular usage demonstrated in
     1.9 + * examples/simple, and it's marked with an XXX comment in the code. For the rest of
    1.10 + * the details of libdrawtext usage in this code, refer to examples/simple/simple.c.
    1.11   */
    1.12  #include <stdio.h>
    1.13  #include <stdlib.h>
    1.14 @@ -28,6 +33,10 @@
    1.15  	glutReshapeFunc(reshape);
    1.16  	glutKeyboardFunc(keyb);
    1.17  
    1.18 +	/* XXX: only difference is that we have to call dtx_open_font_glyphmap,
    1.19 +	 * instead of dtx_open_font, passing it the filename of a pre-built
    1.20 +	 * glyphmap (see tools/font2glyphmap).
    1.21 +	 */
    1.22  	if(!(font = dtx_open_font_glyphmap("serif_s24.glyphmap"))) {
    1.23  		fprintf(stderr, "failed to open font\n");
    1.24  		return 1;
    1.25 @@ -52,9 +61,6 @@
    1.26  	glPushMatrix();
    1.27  	glTranslatef(-200, 150, 0);
    1.28  	glColor3f(1, 1, 1);
    1.29 -	/* XXX call dtx_string to draw utf-8 text.
    1.30 -	 * any transformations and the current color apply
    1.31 -	 */
    1.32  	dtx_string(text);
    1.33  	glPopMatrix();
    1.34