Author: spitzak
Date: 2007-06-08 14:15:37 -0400 (Fri, 08 Jun 2007)
New Revision: 5892
Log:
Fix it so you can hide an OpenGL window on OSX and fixed crash if you
closed the window.
Modified:
trunk/OpenGL/Fl_Gl_Window.cxx
trunk/fltk/GlWindow.h
Modified: trunk/OpenGL/Fl_Gl_Window.cxx
===================================================================
--- trunk/OpenGL/Fl_Gl_Window.cxx 2007-06-07 21:40:36 UTC (rev 5891)
+++ trunk/OpenGL/Fl_Gl_Window.cxx 2007-06-08 18:15:37 UTC (rev 5892)
@@ -29,6 +29,7 @@
#include <fltk/visual.h>
#include <fltk/layout.h>
#include <fltk/run.h>
+#include <fltk/events.h>
#include <stdlib.h>
#include <string.h>
using namespace fltk;
@@ -540,8 +541,20 @@
*/
void GlWindow::draw_overlay() {}
+int GlWindow::handle( int event )
+{
+#if USE_QUARTZ
+ switch ( event ) {
+ case HIDE:
+ aglSetDrawable( context(), NULL );
+ break;
+ }
#endif
+ return Window::handle( event );
+}
+#endif
+
//
// End of "$Id$".
//
Modified: trunk/fltk/GlWindow.h
===================================================================
--- trunk/fltk/GlWindow.h 2007-06-07 21:40:36 UTC (rev 5891)
+++ trunk/fltk/GlWindow.h 2007-06-08 18:15:37 UTC (rev 5892)
@@ -80,6 +80,8 @@
virtual void draw() = 0;
virtual void draw_overlay();
+ virtual int handle( int event );
+
private:
int mode_;
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit