<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSOpenGLContext/clearDrawable()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSOpenGLContext(im)clearDrawable"
  },
  "title" : "clearDrawable()"
}
-->

# clearDrawable()

Disassociates the OpenGL context from its viewport.

```
func clearDrawable()
```

## Discussion

This method disassociates the receiver from any associated `NSView` object. If the receiver is in full-screen or offscreen mode, it exits that mode.

## See Also

[`setOffScreen:width:height:rowbytes:`](/documentation/AppKit/NSOpenGLContext/setOffScreen:width:height:rowbytes:)

Instructs the OpenGL context to render into an offscreen buffer with the specified attributes.

[`setFullScreen`](/documentation/AppKit/NSOpenGLContext/setFullScreen)

Sets the OpenGL context to full-screen mode.



---

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)