Input/Output

Started by
5 comments, last by Ali_B 17 years, 10 months ago
What is a good was to get numbers and words as input using opengl with windows? Thanks.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky
Advertisement
Opengl doesn't do input.

You could use the win32 API as you're on windows, or directinput, or SDL, or several other things.

In general input is provided by the OS interaction layer you use.
[size="1"]
I'm using the windows API, but I can only input single letters or numbers, how do I input strings or longer numbers?
Thanks.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky
Well if you can get each key the user presses then you can get strings by putting the characters together. E.g. keep adding keys the user presses to a string (you'll need to handle non-printable keys, like the arrow keys) until they hit enter or something.
I'd strongly suggest moving away from the Windows API and using a third party library like GLFW or FreeGLUT. Using these frameworks will not only make your life easier, but also let you port your applications to platforms other then Windows.
Rob Loach [Website] [Projects] [Contact]
I do not think that glut is available on every platform, for example I do not think that OpenGL ES support glut librairy.
Before talking about how to input characters, the question is: How do you want to display the characters?

This topic is closed to new replies.

Advertisement