Public Member Functions | Properties

CC3DrawableVertexArray Class Reference

This abstract subclass of CC3VertexArray adds the functionality to draw the vertex data to the display through the GL engine. More...

#import <CC3VertexArrays.h>

Inheritance diagram for CC3DrawableVertexArray:
CC3VertexArray CC3Identifiable CC3VertexIndices CC3VertexLocations CC3VertexRunLengthIndices

List of all members.

Public Member Functions

(void) - allocateStripLengths:
(void) - deallocateStripLengths
(void) - draw

Properties

GLenum drawingMode
GLuint firstElement
GLuint stripCount
GLuint * stripLengths

Detailed Description

The underlying data can be drawn in a single GL call for all vertices, or the vertices can be arranged in strips, and the strips drawn serially. This second method obviously consumes more GL calls, and will be less efficient, but in some applications, might assist in the organization of mesh vertex data.


Member Function Documentation

- (void) allocateStripLengths: (GLsizei)  sCount

Sets the specified number of strips into the stripCount property, then allocates an array of Gluints of that length, and sets that array in the stripLengths property.

It is safe to invoke this method more than once. The previously allocated array of strip-lengths will be deallocated before the new array is created.

The array can be deallocated by invoking the deallocateStripLengths method.

- (void) deallocateStripLengths

Deallocates the array of strip-lengths that was created by a previous invocation of the allocateStripLengths: method.

It is safe to invoke this method more than once, or even if allocateStripLengths: was not previously invoked.

This method is invoked automatically when this instance is deallocated.

- (void) draw

Draws the elements, either in strips, or in a single call, depending on the value of the stripCount property.

This method is invoked automatically from the draw method of CC3VertexArrayMeshModel.


Property Documentation

- (GLenum) drawingMode [read, write, assign]

The drawing mode indicating how the vertices are connected (points, lines, triangles...).

This must be set with a valid GL drawing mode enumeration.

The default value is GL_TRIANGLE_STRIP.

- (GLuint) firstElement [read, assign]

An index reference to the first element that will be drawn.

This abstract implementation always returns zero. Subclasses will override.

Implemented in CC3VertexLocations.

- (GLuint) stripCount [read, write, assign]

The underlying data can be drawn in strips, using multiple GL calls, rather than a single call.

This property indicates the number of strips to draw. A value of zero indicates that vertex drawing should be done in a single GL call.

- (GLuint *) stripLengths [read, write, assign]

An array of values, each indicating the number of elements to draw in the corresponding strip.

The stripCount property indicates the number of items in this array. If drawing is not performed in strips (stripCount is zero), this property will be NULL.

An easy way to create a suitable array for this property, and set the associated stripCount property at the same time, is to invoke the allocateStripLengths: method.


The documentation for this class was generated from the following file: