Command-line arguments and glutDisplayFunc

I am writing a ‘simple’ program that uses command line arguments as parameters to draw various shapes in my program.

Consequently, different pictures will be drawn according to the command line arguments the user enters.

I am asking, is there a way to send arguments to the function you have registered with glutDisplayFunc? I have tried to do this but it will not compile.

Thanks for any help.

Simplest thing to do, chuck the arguments into a global field and access them from the display callback. Nice and easy!

When you say command line arguments, do you mean like dos line.

MyGLprogram.exe -D cube

or like have a command line that the user can type on while the program is running to add an object?