Public Member Functions | Static Public Member Functions | Properties

CC3OpenGLES11StateTrackerPrimitive Class Reference

A type of CC3OpenGLES11StateTracker that tracks the state of a single primitive GL state value. More...

#import <CC3OpenGLES11StateTracker.h>

Inheritance diagram for CC3OpenGLES11StateTrackerPrimitive:
Inheritance graph
[legend]
Collaboration diagram for CC3OpenGLES11StateTrackerPrimitive:
Collaboration graph
[legend]

List of all members.

Public Member Functions

(void) - close
(void) - getGLValue
(id) - initWithParent:forState:
(id) - initWithParent:forState:andOriginalValueHandling:
(void) - open
(void) - restoreOriginalValue
(void) - setGLValue
(void) - setGLValueAndNotify

Static Public Member Functions

(CC3GLESStateOriginalValueHandling+ defaultOriginalValueHandling
(id) + trackerWithParent:forState:
(id) + trackerWithParent:forState:andOriginalValueHandling:

Properties

GLenum name
CC3GLESStateOriginalValueHandling originalValueHandling
BOOL shouldAlwaysReadOriginal
BOOL shouldRestoreOriginalOnClose
BOOL valueIsKnown
BOOL valueIsKnownOnClose

Detailed Description

A type of CC3OpenGLES11StateTracker that tracks the state of a single primitive GL state value.

This is an abstract class. Subclasses will define tracking each type of primitive GL state data.


Member Function Documentation

- (void) close

Depending on the value of the originalValueHandling property, this implementation may attempt to restore the GL value back to the value read when the open method was invoked.

Implements CC3OpenGLES11StateTracker.

+ (CC3GLESStateOriginalValueHandling) defaultOriginalValueHandling

The default technique for handling the GL state value as it was before tracking is opened.

See the notes for the CC3GLESStateOriginalValueHandling enumeration for more on handling original GL state.

The default value of this abstract implementation is kCC3GLESStateOriginalValueIgnore. Subclasses will override to establish different defaults.

- (void) getGLValue

Template method to get the value from the GL engine and store it as the original value.

This abstract implementation does nothing. Subclasses will override to get the value and store it in an original value instance variable of the appropriate type.

The application should not invoke this method directly.

- (id) initWithParent: (CC3OpenGLES11StateTracker *)  aTracker
forState: (GLenum)  qName 

Initializes this instance with the specified enumerated GL name.

- (id) initWithParent: (CC3OpenGLES11StateTracker *)  aTracker
forState: (GLenum)  aName
andOriginalValueHandling: (CC3GLESStateOriginalValueHandling origValueHandling 

Initializes this instance with the specified enumerated GL name, and to handle original values as specified.

- (void) open

Depending on the value of the originalValueHandling property, this implementation may call the OpenGL ES 1.1 engine to read the GL value being tracked.

Implements CC3OpenGLES11StateTracker.

- (void) restoreOriginalValue

Template method that sets the current value of the GL state back to the original value.

The value will only be propagated to the GL engine if the original value is different than the current GL value, or if the current value in the GL engine is unknown.

This abstract implementation does nothing. Subclasses will override to set the value using the appropriate variable type.

This method is invoked automatically when the close method is invoked, and the original value is to be restored. The application should not invoke this method directly.

- (void) setGLValue

Template method to set the value into the GL engine.

This abstract implementation does nothing. Subclasses will override to set a value of the appropriate type into the GL engine.

The application should not invoke this method directly.

- (void) setGLValueAndNotify

Set the GL value, notify the CC3OpenGLES11Engine, mark the value as known, and log the activity.

This method is invoked automatically by the value property setter method, and, in turn, invokes the setGLValue template method. The application should not invoke this method directly.

+ (id) trackerWithParent: (CC3OpenGLES11StateTracker *)  aTracker
forState: (GLenum)  qName 

Allocates and initializes an autoreleased instance with the specified enumerated GL name.

+ (id) trackerWithParent: (CC3OpenGLES11StateTracker *)  aTracker
forState: (GLenum)  aName
andOriginalValueHandling: (CC3GLESStateOriginalValueHandling origValueHandling 

Allocates and initializes an autoreleased instance with the specified enumerated GL name, and to handle original values as specified.


Property Documentation

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

The enumerated name under which the GL engine identifies this state.

- (CC3GLESStateOriginalValueHandling) originalValueHandling [read, write, assign]

The type of handling to apply to the value of the GL state at the time the open and close method are invoked.

See the notes for the CC3GLESStateOriginalValueHandling enumeration for more on handling original GL state.

The initial value is set to the value returned by the defaultOriginalValueHandling method. Different subclasses may return different values from the defaultOriginalValueHandling method.

- (BOOL) shouldAlwaysReadOriginal [read, assign]

Returns whether the tracker should read the original value from the GL engine on every frame.

Returns YES if the name property is not nil, and the value of the originalValueHandling property is either kCC3GLESStateOriginalValueReadAlways or kCC3GLESStateOriginalValueReadAlwaysAndRestore, otherwise returns NO.

- (BOOL) shouldRestoreOriginalOnClose [read, assign]

Returns whether the tracker should restore the original value back to the GL engine when this tracker is closed.

Returns YES if the value of the originalValueHandling property is either kCC3GLESStateOriginalValueReadOnceAndRestore or kCC3GLESStateOriginalValueReadAlwaysAndRestore, otherwise returns NO.

- (BOOL) valueIsKnown [read, write, assign]

Indicates whether the current state in the GL engine is known.

- (BOOL) valueIsKnownOnClose [read, assign]

Returns the value to set the valueIsKnown property to when closing this tracker.

Returns NO if the value of the originalValueHandling property is kCC3GLESStateOriginalValueIgnore, otherwise returns YES.


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