Thread: glut text rendering in wrong color

  1. #1
    GA ichijoji's Avatar
    Join Date
    Nov 2002
    Posts
    179

    glut text rendering in wrong color

    I'm working on a project for school where I need to be able to render colored glut_bitmap fonts. I have a text object that contains a color class to control its color. The color class just contains rgb floats and has a function bind() that calls glColor3f(r,g,b). The business part of the text class's render function is:
    Code:
            glRasterPos2i(x,y);
            color.bind();
            for (i = 0; i < str.size(); ++i)
                glutBitmapCharacter(font,str[i]);
    This renders the font ok, but in the color that the last thing rendered used. Is there some trick with rendering to the raster position that requires setting the color seperately or something?

    Edit: I know that the values in the color class are set correctly.
    Last edited by ichijoji; 10-27-2005 at 01:22 PM.
    Illusion and reality become impartiality and confidence.

  2. #2
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    glDisable(GL_TEXTURE_2D); ?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Change text color in C
    By IndioDoido in forum C Programming
    Replies: 9
    Last Post: 04-15-2007, 05:54 AM
  2. Having a problem with glut rendering from an object.
    By indigo0086 in forum Game Programming
    Replies: 4
    Last Post: 04-06-2007, 10:58 AM
  3. Critique my lighting model.
    By psychopath in forum Game Programming
    Replies: 4
    Last Post: 08-12-2006, 06:23 PM
  4. Individual color of a text field
    By PierreB in forum Windows Programming
    Replies: 3
    Last Post: 03-21-2004, 11:45 AM
  5. Outputting String arrays in windows
    By Xterria in forum Game Programming
    Replies: 11
    Last Post: 11-13-2001, 07:35 PM