---
title: "canDraw(inCGLContext:pixelFormat:forLayerTime:displayTime:)"
framework: quartzcore
role: symbol
role_heading: Instance Method
path: "quartzcore/caopengllayer/candraw(incglcontext:pixelformat:forlayertime:displaytime:)"
---

# canDraw(inCGLContext:pixelFormat:forLayerTime:displayTime:)

Returns whether the receiver should draw OpenGL content for the specified time.

## Declaration

```swift
func canDraw(inCGLContext ctx: CGLContextObj, pixelFormat pf: CGLPixelFormatObj, forLayerTime t: CFTimeInterval, displayTime ts: UnsafePointer<CVTimeStamp>?) -> Bool
```

## Parameters

- `ctx`: The CGLContextObj in to which the OpenGL content would be drawn.
- `pf`: The pixel format used when the glContext was created.
- `t`: The current layer time.
- `ts`: The display timestamp associated with timeInterval. Can be null.

## Return Value

Return Value true if the receiver should render OpenGL content, false otherwise.

## Discussion

Discussion This method is called before attempting to render the frame for the layer time specified by timeInterval. If the method returns false, the frame is skipped. The default implementation always returns true.

## See Also

### Drawing Layer Content

- [isAsynchronous](quartzcore/caopengllayer/isasynchronous.md)
- [draw(inCGLContext:pixelFormat:forLayerTime:displayTime:)](quartzcore/caopengllayer/draw(incglcontext:pixelformat:forlayertime:displaytime:).md)
