<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSOpenGLCPSwapRectangleEnable",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@NSOpenGLCPSwapRectangleEnable"
  },
  "title" : "NSOpenGLCPSwapRectangleEnable"
}
-->

# NSOpenGLCPSwapRectangleEnable

Enables or disables the swap rectangle in the context’s drawable object.

```
static const NSOpenGLContextParameter NSOpenGLCPSwapRectangleEnable;
```

## Discussion

If enabled, the area that is affected by the [`flushBuffer()`](/documentation/AppKit/NSOpenGLContext/flushBuffer()) method is restricted to a rectangle specified by the values of `NSOpenGLCPSwapRectangle`. However, the portion of the drawable object that lies outside of the swap rectangle may still be flushed to the screen by a visibility change or other user interface action.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)