Author: manolo
Date: 2013-01-10 01:17:58 -0800 (Thu, 10 Jan 2013)
New Revision: 9791
Log:
About the fix for a problem apparent with the "cube" test program:
if the cube window is moved around rapidly, the GL pixels leak away from where
they should be.
This problem no longer occurs with Mac OS 10.7 and above. The fix is thus made
effective
only when OS < 10.7.
Modified:
branches/branch-3.0/src/fltk3/cocoa.mm
Modified: branches/branch-3.0/src/fltk3/cocoa.mm
===================================================================
--- branches/branch-3.0/src/fltk3/cocoa.mm 2013-01-10 08:57:19 UTC (rev
9790)
+++ branches/branch-3.0/src/fltk3/cocoa.mm 2013-01-10 09:17:58 UTC (rev
9791)
@@ -626,8 +626,13 @@
contentRect:(NSRect)rect
styleMask:(NSUInteger)windowStyle;
- (fltk3::Window *)getFl_Window;
+/* These two functions allow to check if a window contains OpenGL-subwindows.
+ This is useful only for Mac OS < 10.7 to repair a problem apparent with the
"cube" test program:
+ if the cube window is moved around rapidly (with OS < 10.7), the GL pixels
leak away from where they should be.
+ The repair is performed by [FLWindowDelegate windowDidMove:], only if OS <
10.7.
+ */
- (BOOL)containsGLsubwindow;
-- (void)setContainsGLsubwindow:(BOOL)contains;
+- (void)containsGLsubwindow:(BOOL)contains;
@end
@implementation FLWindow
@@ -650,7 +655,7 @@
{
return containsGLsubwindow;
}
-- (void)setContainsGLsubwindow:(BOOL)contains
+- (void)containsGLsubwindow:(BOOL)contains
{
containsGLsubwindow = contains;
}
@@ -1009,8 +1014,8 @@
update_e_xy_and_e_xy_root(nsw);
resize_from_system = window;
window->position((int)pt2.x, (int)(main_screen_height - pt2.y));
- if ([nsw containsGLsubwindow] ) {
- [nsw display];// redraw window after moving if it contains OpenGL
subwindows
+ if ([nsw containsGLsubwindow] && fl_mac_os_version < 100700) {
+ [nsw display];// with OS < 10.7, redraw window after moving if it contains
OpenGL subwindows
}
fl_unlock_function();
}
@@ -2094,7 +2099,7 @@
}
if (w->as_gl_window()) { // if creating a sub-GL-window
while (win->window()) win = win->window();
- [Fl_X::i(win)->xid setContainsGLsubwindow:YES];
+ [Fl_X::i(win)->xid containsGLsubwindow:YES];
}
fl_show_iconic = 0;
}
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit