Mac Developer Library

Developer

QuartzCore Framework Reference CARenderer Class Reference

Options
Deployment Target:

On This Page
Language:

CARenderer

Inheritance


Conforms To


Import Statement


Swift

import QuartzCore

Objective-C

@import QuartzCore;

Availability


Available in OS X v10.5 and later.

CARenderer allows an application to render a layer tree into a CGL context. For real-time output you should use an instance of NSView to host the layer-tree.

  • layer layer Property

    The root layer of the layer-tree the receiver should render.

    Declaration

    Swift

    var layer: CALayer!

    Objective-C

    @property(strong) CALayer *layer

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in OS X v10.5 and later.

  • bounds bounds Property

    The bounds of the receiver.

    Declaration

    Swift

    var bounds: CGRect

    Objective-C

    @property CGRect bounds

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in OS X v10.5 and later.

  • Creates and returns a CARenderer instance with the render target specified by the Core OpenGL context.

    Declaration

    Swift

    init!(CGLContext ctx: UnsafeMutablePointer<Void>, options dict: [NSObject : AnyObject]!) -> CARenderer

    Objective-C

    + (CARenderer *)rendererWithCGLContext:(void *)ctx options:(NSDictionary *)dict

    Parameters

    ctx

    A Core OpenGL render context that is used as the render target.

    dict

    A dictionary of optional parameters.

    Return Value

    A new instance of CARenderer that will use ctx as the render target.

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in OS X v10.5 and later.

  • Begin rendering a frame at the specified time.

    Declaration

    Swift

    func beginFrameAtTime(_ timeInterval: CFTimeInterval, timeStamp timeStamp: UnsafeMutablePointer<CVTimeStamp>)

    Objective-C

    - (void)beginFrameAtTime:(CFTimeInterval)timeInterval timeStamp:(CVTimeStamp *)timeStamp

    Parameters

    timeInterval

    The layer time.

    timeStamp

    The display timestamp associated with timeInterval. Can be null.

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in OS X v10.5 and later.

  • Returns the bounds of the update region that contains all pixels that will be rendered by the current frame.

    Declaration

    Swift

    func updateBounds() -> CGRect

    Objective-C

    - (CGRect)updateBounds

    Return Value

    The bounds of the update region..

    Discussion

    Initially updateBounds will include all differences between the current frame and the previously rendered frame.

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in OS X v10.5 and later.

  • Adds the rectangle to the update region of the current frame.

    Declaration

    Swift

    func addUpdateRect(_ aRect: CGRect)

    Objective-C

    - (void)addUpdateRect:(CGRect)aRect

    Parameters

    aRect

    A rectangle defining the region to be added to the update region.

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in OS X v10.5 and later.

  • Render the update region of the current frame to the target context.

    Declaration

    Swift

    func render()

    Objective-C

    - (void)render

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in OS X v10.5 and later.

  • Returns the time at which the next update should happen.

    Declaration

    Swift

    func nextFrameTime() -> CFTimeInterval

    Objective-C

    - (CFTimeInterval)nextFrameTime

    Return Value

    The time at which the next update should happen.

    Discussion

    If infinite, no update needs to be scheduled yet. If nextFrameTime is the current frame time, a continuous animation is running and an update should be scheduled after an appropriate delay.

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in OS X v10.5 and later.

  • Release any data associated with the current frame.

    Declaration

    Swift

    func endFrame()

    Objective-C

    - (void)endFrame

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in OS X v10.5 and later.