CARenderer Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/QuartzCore.framework
Availability
Available in OS X v10.5 and later.
Declared in
CARenderer.h
Companion guides

Overview

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.

Tasks

Rendered Layer

Renderer Geometry

Create a New Renderer

Render a Frame

Properties

bounds

The bounds of the receiver.

@property CGRect bounds
Availability
  • Available in OS X v10.5 and later.
Declared In
CARenderer.h

layer

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

@property(retain) CALayer *layer
Availability
  • Available in OS X v10.5 and later.
Declared In
CARenderer.h

Class Methods

rendererWithCGLContext:options:

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

+ (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.

Availability
  • Available in OS X v10.5 and later.
Declared In
CARenderer.h

Instance Methods

addUpdateRect:

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

- (void)addUpdateRect:(CGRect)aRect
Parameters
aRect

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

Availability
  • Available in OS X v10.5 and later.
Declared In
CARenderer.h

beginFrameAtTime:timeStamp:

Begin rendering a frame at the specified time.

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

The layer time.

timeStamp

The display timestamp associated with timeInterval. Can be null.

Availability
  • Available in OS X v10.5 and later.
Declared In
CARenderer.h

endFrame

Release any data associated with the current frame.

- (void)endFrame
Availability
  • Available in OS X v10.5 and later.
Declared In
CARenderer.h

nextFrameTime

Returns the time at which the next update should happen.

- (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.

Availability
  • Available in OS X v10.5 and later.
Declared In
CARenderer.h

render

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

- (void)render
Availability
  • Available in OS X v10.5 and later.
Declared In
CARenderer.h

updateBounds

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

- (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.

Availability
  • Available in OS X v10.5 and later.
Declared In
CARenderer.h