Cocoa : fix 'Draw Overlap' method swap issues
authorDamien Plisson <damien.plisson@yahoo.fr>
Thu, 28 Jan 2010 10:56:35 +0000 (10:56 +0000)
committerDamien Plisson <damien.plisson@yahoo.fr>
Thu, 28 Jan 2010 10:56:35 +0000 (10:56 +0000)
intern/ghost/intern/GHOST_WindowCocoa.mm

index 9c35786c7912e6c58157c981e626a05db6b63d1c..c02c3f111677e1f1139306fc3346493100f34584 100644 (file)
@@ -336,6 +336,11 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
        // Pixel Format Attributes for the windowed NSOpenGLContext
        i=0;
        pixelFormatAttrsWindow[i++] = NSOpenGLPFADoubleBuffer;
+       
+       // Guarantees the back buffer contents to be valid after a call to NSOpenGLContext object’s flushBuffer
+       // needed for 'Draw Overlap' drawing method
+       pixelFormatAttrsWindow[i++] = NSOpenGLPFABackingStore; 
+       
        pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated;
        //pixelFormatAttrsWindow[i++] = NSOpenGLPFAAllowOfflineRenderers,;   // Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway
        
@@ -366,6 +371,11 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
        if (pixelFormat == nil) {
                i=0;
                pixelFormatAttrsWindow[i++] = NSOpenGLPFADoubleBuffer;
+               
+               // Guarantees the back buffer contents to be valid after a call to NSOpenGLContext object’s flushBuffer
+               // needed for 'Draw Overlap' drawing method
+               pixelFormatAttrsWindow[i++] = NSOpenGLPFABackingStore;
+               
                pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated;
                //pixelFormatAttrsWindow[i++] = NSOpenGLPFAAllowOfflineRenderers,;   // Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway