2 * FxGLUT version 0.12 - GLUT for Voodoo 1 and 2 under Linux
3 * Copyright (C) 1999 Christopher John Purnell
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 glutStrokeCharacter (void *font
, int c
)
27 const GLUTStrokeFont
*sfp
= (GLUTStrokeFont
*) _glut_font(font
);
28 const GLUTStrokeChar
*scp
;
29 const GLUTStrokeStrip
*ssp
;
30 const GLUTStrokeVertex
*svp
;
33 if (((unsigned)c
) >= sfp
->num
|| !(scp
= sfp
->table
[c
]))
38 for (i
= 0; i
< scp
->num
; i
++, ssp
++) {
41 glBegin(GL_LINE_STRIP
);
42 for (j
= 0; j
< ssp
->num
; j
++, svp
++) {
43 glVertex2f(svp
->x
, svp
->y
);
48 glTranslatef(scp
->right
, 0.0, 0.0);
53 glutStrokeString (void *font
, const unsigned char *string
)
55 const GLUTStrokeFont
*sfp
= _glut_font(font
);
56 const GLUTStrokeChar
*scp
;
57 const GLUTStrokeStrip
*ssp
;
58 const GLUTStrokeVertex
*svp
;
62 while ((c
= *(string
++))) {
63 if (c
< sfp
->num
&& (scp
= sfp
->table
[c
])) {
66 for (i
= 0; i
< scp
->num
; i
++, ssp
++) {
69 glBegin(GL_LINE_STRIP
);
70 for (j
= 0; j
< ssp
->num
; j
++, svp
++) {
71 glVertex2f(svp
->x
, svp
->y
);
76 glTranslatef(scp
->right
, 0.0, 0.0);
83 glutStrokeWidth (void *font
, int c
)
85 const GLUTStrokeFont
*sfp
= _glut_font(font
);
86 const GLUTStrokeChar
*scp
;
88 if (((unsigned)c
) >= sfp
->num
|| !(scp
= sfp
->table
[c
]))
96 glutStrokeLength (void *font
, const unsigned char *string
)
98 const GLUTStrokeFont
*sfp
= _glut_font(font
);
99 const GLUTStrokeChar
*scp
;
103 while ((c
= *(string
++))) {
104 if (c
< sfp
->num
&& (scp
= sfp
->table
[c
]))
105 length
+= scp
->right
;
113 glutStrokeHeight (void *font
)
115 const GLUTStrokeFont
*sfp
= _glut_font(font
);