summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-03-26 14:37:28 +0000
committerManolo Gouy <Manolo>2011-03-26 14:37:28 +0000
commita58a2ed9fb724ec54053f4ca5b22d2b7db523ada (patch)
tree0feb84b4301482e5badbac203642b4c14f8a448f /src
parent3b7ff83e0475da627233321f1f926f40bccbec87 (diff)
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. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8536 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Gl_Window.cxx7
-rw-r--r--src/gl_draw.cxx4
2 files changed, 11 insertions, 0 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index 52bf72bad..2730787d2 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -34,6 +34,9 @@ static int temp = fl_gl_load_plugin;
#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 @@ void Fl_Gl_Window::hide() {
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() {
diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx
index a15a15123..da2acff4c 100644
--- a/src/gl_draw.cxx
+++ b/src/gl_draw.cxx
@@ -559,6 +559,10 @@ void gl_texture_pile_height(int max)
/** @} */
+#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