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 9 of 9

Thread: Glut Callbacks.....

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2013
    Posts
    23

    Glut Callbacks.....

    hello everyone....this may be a very basic question but I was wondering that whether the sequence in which we register our glut callbacks matter....when the program enters glut main loop which function is executed first....?
    thanx a lot...

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    720
    The order you register callbacks in has no influence on the order the callbacks are being called, the latter is determined by the order in which GLUT receives events from the window system. IIRC you usually get one or more calls to the reshape callback before the first invocation of the display callback. I'm not sure this is guaranteed though and I would not be surprised if it differs between platforms.

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2013
    Posts
    23
    Quote Originally Posted by carsten neumann View Post
    The order you register callbacks in has no influence on the order the callbacks are being called, the latter is determined by the order in which GLUT receives events from the window system. IIRC you usually get one or more calls to the reshape callback before the first invocation of the display callback. I'm not sure this is guaranteed though and I would not be surprised if it differs between platforms.
    So I guess the order is reshape function then display then the other physics functions... am i right?

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    720
    Uhm, I'm confused, what physics functions are you referring to?

  5. #5
    Junior Member Newbie
    Join Date
    Apr 2013
    Posts
    23
    Quote Originally Posted by carsten neumann View Post
    Uhm, I'm confused, what physics functions are you referring to?
    sorry ....the functions other than related to graphics.....

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    720
    Ok. Well, as mentioned before it really depends on the order of window system/OS events. About the only guarantee there is is that you get at least one call to reshape before the first call to display (see glutReshapeFunc), writing code that relies on anything more than that seems like asking for trouble. Why is the order of callback invocation important to you?

Posting Permissions

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