<!--
{
  "availability" : [
    "macOS: 10.5.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "Quartz",
  "identifier" : "/documentation/Quartz/QCPlugInOutputImageProvider/canRender(withCGLContext:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Quartz"
    ],
    "preciseIdentifier" : "c:objc(pl)QCPlugInOutputImageProvider(im)canRenderWithCGLContext:"
  },
  "title" : "canRender(withCGLContext:)"
}
-->

# canRender(withCGLContext:)

Returns whether the image data can be rendered into the provided CGL context.

```
optional func canRender(withCGLContext cgl_ctx: CGLContextObj!) -> Bool
```

## Parameters

`cgl_ctx`

The CGL context that your image will be rendered to.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the image can be rendered into this CGL context; otherwise <doc://com.apple.documentation/documentation/Swift/false>, in which case [`render(toBuffer:withBytesPerRow:pixelFormat:forBounds:)`](/documentation/Quartz/QCPlugInOutputImageProvider/render(toBuffer:withBytesPerRow:pixelFormat:forBounds:)) is called.

## Discussion

If your image can render using any OpenGL context, simply return <doc://com.apple.documentation/documentation/Swift/true>. If your code requires special extensions, you’ll need to check for them and then provide the appropriate return value. For more information on checking for OpenGL capabilities supported by the hardware, see [OpenGL Programming Guide for Mac](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_intro/opengl_intro.html#//apple_ref/doc/uid/TP40001987).

---

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)