Archived

This topic is now archived and is closed to further replies.

Reverse_Gecko

How do you do text input?

Recommended Posts

Reverse_Gecko    122
Ive been programming in c++ since 5th grade, but im new to opengl and i was just wondering how to do text and stuff of that sort in opengl. Is the a glPrintf or glScanf or anything like that. Thanks.

Share this post


Link to post
Share on other sites
Jankey    122
i long time ago i had the same problems, i used a part of the Glut Sourcecode and manipulated it ... in a few hours ( when i am at home i will post you the Code .. )

J@n

Share this post


Link to post
Share on other sites
Herr_O    184
If youre using win32 you can use wm_char to read the keyboard input in your WndProc().

LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam){
switch(msg){
case WM_CHAR:{
label[charpos++]=(char)wparam;
return 0;
}
}
return DefWindowProc(hwnd,msg,wparam,lparam);
}

But you need some sort of print function to go with that. I suggest visiting http://nehe.gamedev.net, there are som great text/font tutorials for opengl.

Edited by - Herr_O on October 20, 2001 8:03:45 AM

Share this post


Link to post
Share on other sites