glutBitmapCharacter() and glutBitmapString()?

Posts: 281
Joined: 2009.04
Post: #1
I'm sort-of-new to OpenGL/GLUT in C. I'm using Xcode to make my first project, a game where you are a square who can shoot a laser at a blue box. It's nowhere near finished, and I wanted to add a title screen. First of all, some text?

I've tried glutBitmapCharacter() and glutBitmapString(), but I can't seem to get those to work. Here's a portion of my main.c: ( I used some code somebody had posted on the forums, if that's you: thanks! Smile )

drawGLString(GLfloat x, GLfloat y, char *textString)
    int le;
    int qs;
    glRasterPos2f(x, y);
    le = (int) strlen(textString);
    for (qs = 0; qs < le; qs++)
        glutBitmapCharacter(GLUT_BITMAP_8_BY_13, string[qs]);


~ Bring a Pen ~
Quote this message in a reply
Posts: 3,587
Joined: 2003.06
Post: #2
That should actually work, but you'll need to change the line:

glutBitmapCharacter(GLUT_BITMAP_8_BY_13, string[qs]);


glutBitmapCharacter(GLUT_BITMAP_8_BY_13, textString[qs]);

That should have shown up as a compiler error.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Is glutBitmapCharacter() as good as it gets? WhatMeWorry 2 4,986 Jul 6, 2005 07:28 AM
Last Post: TomorrowPlusX