Next Page > Hide TOC

CARenderer Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/QuartzCore.framework
Availability
Available in Mac 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

For more about Objective-C properties, see “Properties” in The Objective-C 2.0 Programming Language.

bounds

The bounds of the receiver.

@property CGRect bounds

Availability
Declared In
CARenderer.h

layer

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

@property(retain) CALayer *layer

Availability
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
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
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
Declared In
CARenderer.h

endFrame

Release any data associated with the current frame.

- (void)endFrame

Availability
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
Declared In
CARenderer.h

render

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

- (void)render

Availability
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
Declared In
CARenderer.h

Next Page > Hide TOC


© 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-04-30)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.