How works glutMainLoop ?

Hey guys,

Sorry for my question but i am new with OpenGl and i don’t understand how glutMainLoop works.
Let’s say i have an init function that look like this :

glutInit(argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
glutInitWindowSize(default_width, default_height);

That means glutMainLoop will call show_results,update and idle over and over without stop?
Thanks :slight_smile:

I just did a few Googles on these functions, and that looks correct, as long as your update() function takes width and height as parameters, yes.

What kind of a project are you working on? I’m going for a simple 2D game and/or 2D artist graphics demo, maybe a very simple 3D thing too.

I have a YouTube channel where I’ve posted quite a few beginning tutorials on OpenGL, so here’s my shameless plug below:



Just as a reference, here are the links that I used to find out info about those function calls:

Hope that helps also,


Thank you for your help.
Very nice doc.