Doxygen Source Code Documentation
glut_stroke.c File Reference
#include <GL/glut.h>
#include "glutint.h"
#include "glutstroke.h"
Go to the source code of this file.
Functions | |
void | glutStrokeCharacter (GLUTstrokeFont font, int c) |
Function Documentation
|
Definition at line 13 of file glut_stroke.c. References c, CoordPtr, GLUTstrokeFont, i, StrokeCharPtr, StrokeFontPtr, and StrokePtr.
00014 { 00015 StrokeCharPtr ch; 00016 StrokePtr stroke; 00017 CoordPtr coord; 00018 StrokeFontPtr fontinfo = (StrokeFontPtr) font; 00019 int i, j; 00020 00021 if (c < 0 || c >= fontinfo->num_chars) 00022 return; 00023 ch = &(fontinfo->ch[c]); 00024 if (ch) { 00025 for (i = ch->num_strokes, stroke = ch->stroke; 00026 i > 0; i--, stroke++) { 00027 glBegin(GL_LINE_STRIP); 00028 for (j = stroke->num_coords, coord = stroke->coord; 00029 j > 0; j--, coord++) { 00030 glVertex2f(coord->x, coord->y); 00031 } 00032 glEnd(); 00033 } 00034 glTranslatef(ch->right, 0.0, 0.0); 00035 } 00036 } |