Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: How works glutMainLoop ?

  1. #1
    Newbie Newbie
    Join Date
    May 2017
    Posts
    6

    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);
    glutCreateWindow("Test");
    glutDisplayFunc(show_results);
    glutReshapeFunc(update);
    glutIdleFunc(idle);

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

  2. #2
    Intern Contributor
    Join Date
    Dec 2016
    Location
    Ocean Shores, WA USA
    Posts
    69
    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:

    https://www.youtube.com/channel/UCzx...ELz5h1dfCdkdfg

    Thanks,

    Jeff

  3. #3
    Intern Contributor
    Join Date
    Dec 2016
    Location
    Ocean Shores, WA USA
    Posts
    69
    Just as a reference, here are the links that I used to find out info about those function calls:

    https://www.opengl.org/resources/lib...c3/node48.html

    https://www.opengl.org/resources/lib...c3/node63.html

    Hope that helps also,

    Jeff

  4. #4
    Newbie Newbie
    Join Date
    May 2017
    Posts
    6

    Hey

    Thank you for your help.
    Very nice doc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •