You could use
glutBitmapCharacter
Combined with function you can make this :
void renderBitmapString(
float x,
float y,
float z,
void *font,
char *string) {
char *c;
glRasterPos3f(x, y,z);
for (c=string; *c != '\0'; c++) {
glutBitmapCharacter(font, *c);
}
} That is provided by lighthouse,
Their link
Now all you need is a little bit of logic.
For example :
string input = "";
void keyBoard(unsigned char key, int x, int y){
input += key;
void updateString();
}
and :
void updateString(){
glutBimapString(0,0,0, GLUT_BITMAP_9_BY_15, input.c_str());
}
You can then call this function also in you draw function.
void drawFunc()
{
glClear(someBITSGoesHerE);
glLoadIdentity();
updateString();
//blah blah
}
Reputation Points: 840
Solved Threads: 594
Senior Poster
Offline 3,865 posts
since Dec 2008