tags:

views:

38

answers:

2

can somebody explain please, what exactly glutMainLoop does? and is the order of the functions in main important or not?

int main(int argc, char *argv[])
    {
      glutInit(&argc, argv);
      glutInitWindowSize(400, 300);
      glutInitWindowPosition(100, 100);

      glutInitDisplayMode(GLUT_RGB);
      glutCreateWindow("First Game");

      glutReshapeFunc(Reshape);
      glutDisplayFunc(Draw);
      glClearColor(0, 0, 0, 0);

      glutMainLoop();
      return 0;
    }
A: 

Mostly accenting ItzWarty's comment: glutMainLoop

Essentially it's how your GLUT application is able to process events.

Robb
A: 

glutMainLoop has been explained Yes order matters, but its nothing great. Very logical

First you initialize display mode Next u set the properties of the window,size position\ Now you create a window

Now comes the main part, you register all your callbacks i.e display fn etc THats it! Now you call your event processor!

Ram Bhat