GLUT has support for printing bitmap fonts. It would be pretty easy to output a letter when the user types it.
Printable View
GLUT has support for printing bitmap fonts. It would be pretty easy to output a letter when the user types it.
How far along in OpenGL are you again? :pQuote:
Originally Posted by Shamino
Coding up a textbox in OpenGL isn't that hard - heck I've done it in QBasic before!
Just create an algorithm that converts the value of a key into the X and Y location of a bitmap font letter and blit that. :D
Finally figured it out...
I know what you're saying frobozz, i was trying to get around writing code for every single key....
but... its already done in openGL, here is the code I used..
i'm sure theres another bit of code that implements it, but thats the sourceCode:int keys[256];
void type_text( char tekst[], int max ) {
int d = strlen( tekst );
for( int w = 32; w < 126; w++ )
if( keys[ w ] && d < max ) {
tekst[ d++ ] = w;
keys[ w ] = false;
}
if( keys[ 8 ] ) {
if( d > 0 )
tekst[ --d ] = 0;
keys[ 8 ] = false;
}
}
i've only been doing openGL for a couple months, 6-7