Input/Output
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.
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.
I'm using the windows API, but I can only input single letters or numbers, how do I input strings or longer numbers?
Thanks.
Thanks.
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.
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
Popular Topics
Advertisement