home *** CD-ROM | disk | FTP | other *** search
/ Amiga Magazin: Amiga-CD 2000 April & May / AMIGA_2000_04.iso / patches / mesa3.1 / mesa-glut.lha / src-glut.aos / glutStroke.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-09-24  |  894 b   |  37 lines

  1.  
  2. /* Copyright (c) Mark J. Kilgard, 1994. */
  3.  
  4. /* This program is freely distributable without licensing fees
  5.    and is provided without guarantee or warrantee expressed or
  6.    implied. This program is -not- in the public domain. */
  7.  
  8. #include "glutstuff.h"
  9. #include "glutStroke.h"
  10.  
  11. void glutStrokeCharacter(GLUTstrokeFont font, int c)
  12. {
  13.   const StrokeCharRec *ch;
  14.   const StrokeRec *stroke;
  15.   const CoordRec *coord;
  16.   StrokeFontPtr fontinfo;
  17.   int i, j;
  18.  
  19.   fontinfo = (StrokeFontPtr) font;
  20.  
  21.   if (c < 0 || c >= fontinfo->num_chars)
  22.     return;
  23.   ch = &(fontinfo->ch[c]);
  24.   if (ch) {
  25.     for (i = ch->num_strokes, stroke = ch->stroke;
  26.       i > 0; i--, stroke++) {
  27.       glBegin(GL_LINE_STRIP);
  28.       for (j = stroke->num_coords, coord = stroke->coord;
  29.         j > 0; j--, coord++) {
  30.         glVertex2f(coord->x, coord->y);
  31.       }
  32.       glEnd();
  33.     }
  34.     glTranslatef(ch->right, 0.0, 0.0);
  35.   }
  36. }
  37.