• Advertisement

Archived

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

How do you do text input?

This topic is 5936 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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

  • Advertisement