#43 GLUT_ACTION_CONTINUE_EXECUTION under GLX

open
nobody
moderate (59)
5
2004-04-29
2004-04-29
Leon Bottou
No

Also I am experimenting with
glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,
GLUT_ACTION_CONTINUE_EXECUTION);
It does not work when multiple windows are invoved
because,
when one clicks the close button in the menubar
- glutMainLoopEvent() exits immediately
without processing messages for other windows.
- next time glutMainLoopEvent() is called, it tries
to post redisplay messages to the dead window.
and the assertion fails in freeglut_display.c:44.

Discussion

  • Richard Rauch
    Richard Rauch
    2004-05-03

    Logged In: YES
    user_id=854844

    Hi.

    Can you say which version of freeglut you are using? And exactly
    what you are doing to provoke this failed assert()? I cannot
    cause this bug to surface with current OpenGLUT, and doubt
    that OpenGLUT's work on window-close events would have
    affected a bug such as you describe.

    This bug should have been fixed in freeglut some time back when
    I modified the window-close operation to clear all callbacks on a
    window (except for the window-close callback).

    My suspicion is that you are using an old version of freeglut.

    (As a general rule, please always try to test bugs against the
    very latest version ("current.tgz") rather than just a formal
    release. Formal releases often trail the current version by
    months.)

     
  • Leon Bottou
    Leon Bottou
    2004-05-03

    Logged In: YES
    user_id=42774

    That was freeglut-2.2.0 as packaged by http://kde-redhat.sf.net.
    I will try with cvs. Thanks.

     
  • Richard Rauch
    Richard Rauch
    2004-05-03

    Logged In: YES
    user_id=854844

    Thanks. I'll look forward to your results.

    I'm pretty sure that this was fixed, but I also thought that it
    was fixed before 2.2.0 was cut.

     
  • Leon Bottou
    Leon Bottou
    2004-05-03

    Logged In: YES
    user_id=42774

    I checked the code in CVS (freeglut_main.c, rev 1.100).

    Upon receiving a WM_DELETE_WINDOW client message,
    function glutMainLoopEvent(void) around line 577 sets
    GLUT_EXEC_STATE_STOP and returns immediately
    without processing further events possibly
    directed to other glut windows.

    Somehow, my expectations regarding
    GLUT_ACTION_ON_WINDOW_CLOSE
    were set by the comment in file
    freeglut_ext.h:

    /*
    * GLUT API Extension macro definitions --
    behaviour when the user clicks on an
    "x" to close a window
    */
    #define GLUT_ACTION_EXIT 0
    #define GLUT_ACTION_GLUTMAINLOOP_RETURNS 1
    #define GLUT_ACTION_CONTINUE_EXECUTION 2

    So I thought that, when GLUT_ACTION_CONTINUE_EXECUTION
    is set, clicking the close box should neither exit the process
    or leave the main loop. It should simply consider that the
    window has been deleted as if glutDestroyWindow()
    had been called...

    - L.

     
  • Richard Rauch
    Richard Rauch
    2004-05-03

    Logged In: YES
    user_id=854844

    (Hrm. The WM_DELETE_WINDOW reference looks like a
    transplant from the WIN32 code. Not sure how that happened.)

    Anyway, I think that your interpretation is correct, the program
    should continue executing.

    I thought that this second problem you are seeing was fixed a
    few weeks ago. I'm pretty sure that we fixed it in OpenGLUT.
    I'd recommend trying OpenGLUT, but we are not at the stage of
    having a formal release, yet. I guess with freeglut, the key is to
    be patient.

     
  • Richard Rauch
    Richard Rauch
    2004-08-27

    Logged In: YES
    user_id=854844

    Hi.

    I think that calling glutLeaveMainLoop() is a NOP in
    OpenGLUT. We fixed this months ago. freeglut fixed it
    sometime after that, but not in a release. The freeglut fix
    took a different approach, so I'm not 100% sure that they
    fixed your issue, but there were some old freeglut problems
    with getting out of glutMainLoop().