DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L1948
Version: 1.3-current
Link: http://www.fltk.org/str.php?L1948
Version: 1.3-current
--- fltk-1.3/src/glut_compatability.cxx Tue Sep 16 12:15:33 2008
+++ TE-fltk-1.3/src/glut_compatability.cxx Wed Nov 12 17:02:26 2008
@@ -49,6 +49,8 @@
# define MAXWINDOWS 32
static Fl_Glut_Window *windows[MAXWINDOWS+1];
+static void (*glut_idle_func)() = 0; // global glut idle function
+
Fl_Glut_Window *glut_window;
int glut_menu;
void (*glut_menustate_function)(int);
@@ -498,6 +500,20 @@
extensions = p + len;
}
}
+
+// Add a mechanism to handle adding/removing the glut idle function
+// without depending on the (deprecated) set_idle method.
+void glutIdleFunc(void (*f)())
+{
+ // no change
+ if(glut_idle_func == f) return;
+ // remove current idle
+ if(glut_idle_func) Fl::remove_idle((void (*)(void *))glut_idle_func);
+ // install new idle func - if one was passed
+ if(f) Fl::add_idle((void (*)(void *))f);
+ // record new idle func - even if it is NULL
+ glut_idle_func = f;
+} // glutIdleFunc
#endif // HAVE_GL
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs