Inherits from NSObject
Conforms to NGLIterator
NGLSurface
NSFastEnumeration
Declared in NGLSurfaceMulti.h

Overview

Multi/Sub instance of NGLSurface.

NGLSurfaceMulti is a special kind of NGLSurface and represents a collection of multiple surfaces. It allows you to create many surfaces onto one single mesh. So you can use many shaders behaviors using the same mesh instance.

Tasks

Class Methods

surfaceMultiWithSurface:

Returns an autorelease instance of NGLSurfaceMulti.

+ (id)surfaceMultiWithSurface:(NGLSurface *)first

Parameters

first

The first surface to be added.

Return Value

A NGLSurfaceMulti autoreleased instance.

Discussion

Returns an autorelease instance of NGLSurfaceMulti.

This method creates a surface library with one surface inside of it.

See Also

Declared In

NGLSurfaceMulti.h

Instance Methods

addNGLSurfaceMulti:copyItems:

Adds a set of NGLSurface instances to this surface library.

- (void)addNGLSurfaceMulti:(NGLSurfaceMulti *)multi copyItems:(BOOL)flag

Parameters

multi

A NGLSurfaceMulti instance.

flag

Specifies if the new items will be copied or just retained.

Discussion

Adds a set of NGLSurface instances to this surface library.

Just as the addSurface: method, every NGLMaterial will be internally retained.

See Also

Declared In

NGLSurfaceMulti.h

addSurface:

Adds a NGLSurface instance to this surface library.

- (void)addSurface:(NGLSurface *)item

Parameters

item

The NGLSurface instance to add.

Discussion

Adds a NGLSurface instance to this surface library.

The NGLSurface instance will be internally retained.

See Also

Declared In

NGLSurfaceMulti.h

count

Returns the number of instances in this library at the moment.

- (unsigned int)count

Return Value

An unsigned int data type.

Discussion

Returns the number of instances in this library at the moment.

Declared In

NGLSurfaceMulti.h

hasSurface:

Checks if a surface exists in this library.

- (BOOL)hasSurface:(NGLSurface *)item

Parameters

item

The NGLShaders to search for.

Discussion

Checks if a surface exists in this library.

See Also

Declared In

NGLSurfaceMulti.h

initWithSurfaceKind:

Initiates a surface library based NGLSurface protocol.

- (id)initWithSurfaceKind:(id<NGLSurface>)surface

Parameters

surface

An object that conforms with the NGLSurface protocol.

Return Value

A NGLSurfaceMulti instance.

Discussion

Initiates a surface library based NGLSurface protocol.

This method will check if the informed object is a simple NGLSurface or a NGLSurfaceMulti and will automatically retain its items.

See Also

Declared In

NGLSurfaceMulti.h

initWithSurfaces:

Initiates a surface library based on many NGLSurface instances.

- (id)initWithSurfaces:(NGLSurface *)first, ...

Parameters

first

The first surface to be added.

...

A sequence of NGLSurface instances separated by comma. This method requires a nil termination.

Return Value

A NGLSurfaceMulti instance.

Discussion

Initiates a surface library based on many NGLSurface instances.

This method initializes a surface library and puts many surfaces into it.

See Also

Declared In

NGLSurfaceMulti.h

removeAll

Removes all surfaces in this library. All the surfaces will receive a release message.

- (void)removeAll

Discussion

Removes all surfaces in this library. All the surfaces will receive a release message.

If there is no surface in this library, this method does nothing.

Declared In

NGLSurfaceMulti.h

surfaceWithIdentifier:

Returns a surface by its identifier.

- (NGLSurface *)surfaceWithIdentifier:(unsigned int)identifier

Parameters

identifier

The identifier to search for.

Return Value

The pointer to the object in this library.

Discussion

Returns a surface by its identifier.

This method returns a NGLSurface. If the identifier was not found, then this method returns nil. If more than one surface has the same identifier, only the first occurence will be returned.

See Also

Declared In

NGLSurfaceMulti.h