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