I am beginner at openGL. In all simple examples main function has arguments and glutinit func uses those. But I don't understand why they are necessary. I write nothing in command arguments and the programs still works. What are they used for? Can you give an example?
glutInit(&argc, argv)
They're used so that GLUT can process command line arguments. It has a number of arguments that it always uses. If you don't want GLUT to process arguments, just pass something like this:
{
int argc = 1;
char *argv[1] = {(char*)"Something"};
glutInit(&argc, argv);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With