glutBitmapCharacter() and glutBitmapString()?
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!
)
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!
) Code:
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 ~
That should actually work, but you'll need to change the line:
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, string[qs]);
To:
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, textString[qs]);
That should have shown up as a compiler error.
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, string[qs]);
To:
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, textString[qs]);
That should have shown up as a compiler error.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Is glutBitmapCharacter() as good as it gets? | WhatMeWorry | 2 | 4,107 |
Jul 6, 2005 07:28 AM Last Post: TomorrowPlusX |
|

