---
title: "canRender(withCGLContext:)"
framework: quartz
role: symbol
role_heading: Instance Method
path: "quartz/qcpluginoutputimageprovider/canrender(withcglcontext:)"
---

# canRender(withCGLContext:)

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

## Declaration

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

## Parameters

- `cgl_ctx`: The CGL context that your image will be rendered to.

## Return Value

Return Value true if the image can be rendered into this CGL context; otherwise false, in which case render(toBuffer:withBytesPerRow:pixelFormat:forBounds:) is called.

## Discussion

Discussion If your image can render using any OpenGL context, simply return 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.

## See Also

### Providing Information About the Rendering Destination

- [supportedBufferPixelFormats()](quartz/qcpluginoutputimageprovider/supportedbufferpixelformats().md)
- [supportedRenderedTexturePixelFormats()](quartz/qcpluginoutputimageprovider/supportedrenderedtexturepixelformats().md)
