>
> Probably the best thing to do is store the current idle function
> pointer in the Glut_Window class. Then it can do the add/remove
> for the window-specific idle function safely...
Ok, so in class Fl_Glut_Window we would add a private item, maybe called
"current_glut_idle" or similar, and when we create the Glut window,
current_glut_idle gets set explicitly to NULL.
Then, glutIdleFunc() becomes something like:
void glutIdleFunc(void (*f)())
{
// no change
if(current_glut_idle == f) return;
// remove current idle
if(current_glut_idle) Fl::remove_idle(current_glut_idle);
// install new idle func - if one was passed
if(f) Fl::add_idle(f);
// record new idle func - even if it is NULL
current_glut_idle = f;
} // glutIdleFunc
Is that the kind of thing you were suggesting? I guess that does the
right sort of thing - we can have one idle function associated with the
glut window, and it can be enabled/disabled without breaking any other
Fltk idle functions we may have added.
But... is "current_glut_idle" static, so it applies to all glut windows
in an app, or do we have a separate "current_glut_idle" value for each
glut window...? And if so, how does glutIdleFunc() find the right
instance? And... I really have no idea... I guess that "traditionally"
there would maybe only be one glut window, and therefore only one glut
idle function?
--
Ian
SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14
3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk