I'm not completely sure what the problem is but let me take a stab at it anyway.

The destroy callback is specific to the window; each window has its own destroy callback.  It is up to the application to determine which window is being destroyed when the callback is being called; probably the simplest way to do this (if it is necessary) is to have a separate destroy callback for each window.  If you have a bunch of windows with the same destroy callback, it is most likely that the exact identity of the window doesn't really matter.

Let me know if this doesn't answer your question.  Also if it becomes a real problem please bring it up again.

John F. Fay

-----Original Message-----
From: Kenny Tilton [mailto:ktilton@nyc.rr.com]
Sent: Friday, January 03, 2003 9:45 AM
To: freeglut-developer@lists.sourceforge.net
Subject: [Freeglut-developer] Destroy callback set-up OK?

fgCloseWindows walks down the to-be-destroyed list calling fgDestroyWindow.

FgDestroyWindow calls the Destroy callback with no arguments.

I might have missed it, but I do not see where fgSetWindow is being
called on the window being destroyed, so how can the callback know which
window is going down?

I did not stumble over this because I only have run so far with one
window, I just noticed it while exploring something else.