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

# NSOpenGLCPSwapInterval

Sets or gets the swap interval.

```
static const NSOpenGLContextParameter NSOpenGLCPSwapInterval;
```

## Discussion

The swap interval is represented as one `long`. If the swap interval is set to `0` (the default), the [`flushBuffer()`](/documentation/AppKit/NSOpenGLContext/flushBuffer()) method executes as soon as possible, without regard to the vertical refresh rate of the monitor. If the swap interval is set to `1`, the buffers are swapped only during the vertical retrace of the monitor.

---

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)