PDA

View Full Version : Numeric input



d98rolb
06-27-2000, 09:42 AM
I have created a simple OpenGL program that is not using Windows API. I have an
standard main() and are just calling the functions in OpenGL to performs the
tasks. It shows an object that I can rotate and zoom. Now I want the program to
take some numeric input from the user. What are my options here?

I maybe could open some sort of input-window in OpenGL and increase/decrease a
datavalue with '+' and '-', and avoid MFC.

Or I could use MFC and calling Windows API to let the user directly type a value.

As I understand it windows use winmain() instead of main(). Is it possible to
share my old OpenGL-code with some Windows-code to take input? I'm using VC++
6.0. I have looked at MFC wizard but I don't like it. I haven't a clue what's
happening behind all that code...

If I open 2 windows, one for the object and one for the input how can I choose what window
to draw in? There is no handle, I just call glutCreateWindow(windowName).

Is there some function in OpenGL that can show a StringBox for the input?

Regards Roland

06-27-2000, 11:51 AM
use glut keyboard function

glutKeyboardFunc(keyboard)

void key(unsigned char c, int x, int y)
{

select key
case '+'
do whatever
case '-'
do whatever
etc...