Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: GLUT fonts

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2002
    Location
    Israel
    Posts
    8

    GLUT fonts

    How can I change the GLUT font color?
    (Using glutBitmapCharacter)
    Could I change the init. position of
    my string?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    133

    Re: GLUT fonts

    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.
    --
    --
    Jim Mathies http://www.mathies.com/

    \"The best way to predict the future is to invent it."

  3. #3
    Junior Member Regular Contributor
    Join Date
    Nov 2001
    Location
    Malaysia
    Posts
    112

    Re: GLUT fonts

    //Short answer,

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

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

  4. #4
    Junior Member Regular Contributor
    Join Date
    Oct 2001
    Location
    Holland
    Posts
    184

    Re: GLUT fonts

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •