How can I draw text in a glut window with the keyboard;
I have tried doing cin with
void TextBox::Keys(unsigned char key,int x,int y){
switch(key){
case 13://enter key
cin >> String;
DrawString = true;
break;
case 27:
exit(0);
break;
}
and then in the draw function
fontx = tx + 3;
fonty = ty + (th+8)/2;
if(DrawString == true){
glColor3f(0.0,0.0,0.0);
Font(GLUT_BITMAP_HELVETICA_12,(char*)String,fontx,fonty);
}
the intention here was to get the string from cin and put it in the string variable and then draw it to the screen. I know how to get
input with cin and put it in a variable with a console program, but i don't know how to do it with the glut keyboard. I also know how to draw text to the screen with glut. I have other questions but I will post them in seperate threads. Much thanks, Jody Bush