Jump to content

  • Log In with Google      Sign In   
  • Create Account


How do you do text input?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Reverse_Gecko   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 October 2001 - 11:37 AM

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.

Sponsor:

#2 Jankey   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 October 2001 - 10:06 PM

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

#3 Herr_O   Members   -  Reputation: 184

Like
Likes
Like

Posted 20 October 2001 - 12:57 AM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS