View Full Version : Function pointers

10-01-2001, 02:56 PM

Sorry this question is probably more of a general programming question, but I guess many people had the same problem like me when using glut callbacks:

I would like to create objects that wrap every single glut window. This means that I would like to create the glut window inside the constructor of an object and have separate callback-routines for every window.

How can I specify a callback routine which isn't static??

Please help me 'cause I'm on that problem for a few days already!!!?!

Thanks http://www.opengl.org/discussion_boards/ubb/smile.gif

10-01-2001, 04:51 PM
You could use arrays of pointers to the callbacks... that's how the scripting system was done in Descent 3. Kinda nifty, really http://www.opengl.org/discussion_boards/ubb/smile.gif

10-01-2001, 05:00 PM
You're right, but that's not really an elegant solution... Sure there's no other way??