draw(inCGLContext:pixelFormat:forLayerTime:displayTime:)
Draws the OpenGL content for the specified time.
Declaration
func draw(inCGLContext ctx: CGLContextObj, pixelFormat pf: CGLPixelFormatObj, forLayerTime t: CFTimeInterval, displayTime ts: UnsafePointer<CVTimeStamp>?)Parameters
- ctx:
The rendering context in to which the OpenGL content should be rendered.
- pf:
The pixel format used when the
glContextwas created. - t:
The current layer time.
- ts:
The display timestamp associated with
timeInterval. Can benull.
Discussion
This method is called when a new frame needs to be generated for the layer time specified by timeInterval. The viewport of glContext is set correctly for the size of the layer. No other state is defined. If the method enables OpenGL features, it should disable them before returning.
The default implementation of the method flushes the context.