libdrawtext

diff examples/unicode/unicode.c @ 7:10cfb642d0b8

added dtx_char_at_pt (not tested)
author John Tsiombikas <nuclear@mutantstargoat.com>
date Sun, 18 Sep 2011 01:30:30 +0300
parents 17fed026b24b
children 87798d469b81
line diff
     1.1 --- a/examples/unicode/unicode.c	Sat Sep 17 10:09:58 2011 +0300
     1.2 +++ b/examples/unicode/unicode.c	Sun Sep 18 01:30:30 2011 +0300
     1.3 @@ -58,12 +58,23 @@
     1.4  }
     1.5  
     1.6  /* various UTF-8 strings */
     1.7 -const char *english_text = "Hello world!";
     1.8 +const char *english_text = "Hello g p world!";
     1.9  const char *greek_text = "\xce\x9a\xce\xbf\xcf\x8d\xcf\x81\xce\xb1\xcf\x83\xce\xb7";
    1.10  const char *russian_text = "\xd0\xa0\xd0\xb0\xd1\x81\xd1\x86\xd0\xb2\xd0\xb5\xd1\x82\xd0\xb0\xd0\xbb\xd0\xb8 \xd1\x8f\xd0\xb1\xd0\xbb\xd0\xbe\xd0\xbd\xd0\xb8 \xd0\xb8 \xd0\xb3\xd1\x80\xd1\x83\xd1\x88\xd0\xb8";
    1.11  const char *kanji_text = "\xe4\xb9\x97\xe4\xba\xac";
    1.12  const char *klingon_text = "\xef\xa3\xa3\xef\xa3\x9d\xef\xa3\x93\xef\xa3\x98\xef\xa3\x9d\xef\xa3\xa2\xef\xa3\xa1\xef\xa3\x9d\xef\xa3\x99";
    1.13  
    1.14 +void draw_box(struct dtx_box *box)
    1.15 +{
    1.16 +	glBegin(GL_LINE_LOOP);
    1.17 +	glColor3f(0, 1, 0);
    1.18 +	glVertex2f(box->x, box->y);
    1.19 +	glVertex2f(box->x + box->width, box->y);
    1.20 +	glVertex2f(box->x + box->width, box->y + box->height);
    1.21 +	glVertex2f(box->x, box->y + box->height);
    1.22 +	glEnd();
    1.23 +	glColor3f(1, 1, 1);
    1.24 +}
    1.25  
    1.26  void disp(void)
    1.27  {