[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx: [276] branches/fusegl/fuse/fusepb
Brought to you by:
fredm
From: <fr...@us...> - 2007-01-01 07:53:05
|
Revision: 276 http://svn.sourceforge.net/fuse-for-macosx/?rev=276&view=rev Author: fredm Date: 2006-12-31 23:53:04 -0800 (Sun, 31 Dec 2006) Log Message: ----------- Make minimised appication have an screen image. Modified Paths: -------------- branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m Modified: branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m =================================================================== --- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-01 07:24:18 UTC (rev 275) +++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-01 07:53:04 UTC (rev 276) @@ -519,4 +519,49 @@ return YES; } +- (BOOL)isFlipped +{ + return YES; +} + +- (void)copyGLToBackingStore +{ + [[self openGLContext] makeCurrentContext]; + + NSSize size = [self bounds].size; + + void *buffer = malloc(size.width * size.height * 4); + + glReadPixels( 0, + 0, + size.width, + size.height, + GL_RGBA, + GL_UNSIGNED_BYTE, + buffer ); + + [self lockFocus]; + + NSDrawBitmap( [self bounds], + size.width, + size.height, + 8, + 4, + 32, + size.width * 4, + NO, + NO, + NSDeviceRGBColorSpace, + (unsigned char const **)&buffer ); + + [self unlockFocus]; + + free(buffer); +} + +-(void) windowWillMiniaturize:(NSNotification *)aNotification +{ + [self copyGLToBackingStore]; +} + @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |