PDA

View Full Version : GLUT fonts



kosta_m
04-02-2002, 04:26 AM
How can I change the GLUT font color?
(Using glutBitmapCharacter)
Could I change the init. position of
my string?

jmathies
04-02-2002, 12:35 PM
Originally posted by kosta_m:
How can I change the GLUT font color?
(Using glutBitmapCharacter)
Could I change the init. position of
my string?

I believe you just set the current OpenGL
color before calling the font routine.
Fromt he docs on glBitmap:
--
A bitmap is a binary image. When drawn, the bitmap is positioned relative to the current raster position, and frame buffer pixels corresponding to 1s in the bitmap are written using the current raster color or index. Frame-buffer pixels corresponding to zeros in the bitmap are not modified.
--

Questions Burner
04-11-2002, 11:25 PM
//Short answer,

//Change the position
glRasterPos(posX, posY);

//Change color
glColor3f(r, g, b);

JML
04-16-2002, 03:48 AM
Originally posted by Questions Burner:
//Short answer,

//Change the position
glRasterPos(posX, posY);

//Change color
glColor3f(r, g, b);

IIRC these two statements should be reversed: the bitmap color gets updated at the moment you modify the rasterpos (since that is when openGL decides which color to use for subsequent raster operations).

HTH

Jean-Marc