Author: manolo
Date: 2011-03-26 07:37:28 -0700 (Sat, 26 Mar 2011)
New Revision: 8536
Log:
Mac OS: Fixed bug where gl_draw() would fail after deletion of an Fl_GL_Window.
The fix invalidates the pile of string textures after each Fl_Gl_Window 
deletion.

Modified:
   branches/branch-1.3/src/Fl_Gl_Window.cxx
   branches/branch-1.3/src/gl_draw.cxx

Modified: branches/branch-1.3/src/Fl_Gl_Window.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Gl_Window.cxx    2011-03-26 07:37:57 UTC (rev 
8535)
+++ branches/branch-1.3/src/Fl_Gl_Window.cxx    2011-03-26 14:37:28 UTC (rev 
8536)
@@ -34,6 +34,9 @@
 
 #include <FL/Fl.H>
 #include <FL/x.H>
+#ifdef __APPLE__
+#include <FL/gl.H>
+#endif
 #include "Fl_Gl_Choice.H"
 #include <FL/Fl_Gl_Window.H>
 #include <stdlib.h>
@@ -469,6 +472,10 @@
 Fl_Gl_Window::~Fl_Gl_Window() {
   hide();
 //  delete overlay; this is done by ~Fl_Group
+#ifdef __APPLE__
+  // resets the pile of string textures used to draw strings
+  gl_texture_pile_height(gl_texture_pile_height());
+#endif
 }
 
 void Fl_Gl_Window::init() {

Modified: branches/branch-1.3/src/gl_draw.cxx
===================================================================
--- branches/branch-1.3/src/gl_draw.cxx 2011-03-26 07:37:57 UTC (rev 8535)
+++ branches/branch-1.3/src/gl_draw.cxx 2011-03-26 14:37:28 UTC (rev 8536)
@@ -559,6 +559,10 @@
 
 /** @} */
 
+#elif defined(__APPLE__)
+// used only if __ppc__
+int gl_texture_pile_height(void) {return 0;}
+void gl_texture_pile_height(int max) {}
 #endif // GL_DRAW_USES_TEXTURES
 
 #endif // HAVE_GL

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to