canRender(withCGLContext:)
Returns whether the image data can be rendered into the provided CGL context.
Declaration
optional func canRender(withCGLContext cgl_ctx: CGLContextObj!) -> BoolParameters
- cgl_ctx:
The CGL context that your image will be rendered to.
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
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.