Classes | Enumerations | Functions

CC3OpenGLES11StateTracker.h File Reference

#import "ccTypes.h"
#import "CC3Foundation.h"
#import "CC3OpenGLES11Foundation.h"

Classes

class  CC3OpenGLES11StateTracker
 This is the base class of all OpenGL ES 1.1 state trackers. More...
class  CC3OpenGLES11StateTrackerBoolean
 A CC3OpenGLES11StateTrackerPrimitive that tracks a boolean GL state value. More...
class  CC3OpenGLES11StateTrackerCapability
 CC3OpenGLES11StateTrackerCapability tracks a boolean GL capability, indicating whether the capability is enabled or disabled. More...
class  CC3OpenGLES11StateTrackerColor
 A CC3OpenGLES11StateTrackerPrimitive that tracks a color GL state value. More...
class  CC3OpenGLES11StateTrackerColorFixedAndFloat
 A CC3OpenGLES11StateTrackerPrimitive that tracks a color GL state value, as either a float or fixed value. More...
class  CC3OpenGLES11StateTrackerComposite
 A CC3OpenGLES11StateTracker that tracks a composite value. More...
class  CC3OpenGLES11StateTrackerEnumeration
 A CC3OpenGLES11StateTrackerPrimitive that tracks an enumerated GL state value. More...
class  CC3OpenGLES11StateTrackerFloat
 A CC3OpenGLES11StateTrackerPrimitive that tracks a float GL state value. More...
class  CC3OpenGLES11StateTrackerInteger
 A CC3OpenGLES11StateTrackerPrimitive that tracks an integer GL state value. More...
class  CC3OpenGLES11StateTrackerManager
 An CC3OpenGLES11StateTracker that manages a number of other trackers. More...
class  CC3OpenGLES11StateTrackerPointer
 A CC3OpenGLES11StateTrackerPrimitive that tracks a pointer GL state value. More...
class  CC3OpenGLES11StateTrackerPrimitive
 A type of CC3OpenGLES11StateTracker that tracks the state of a single primitive GL state value. More...
class  CC3OpenGLES11StateTrackerVector
 A CC3OpenGLES11StateTrackerPrimitive that tracks a 3D vector GL state value. More...
class  CC3OpenGLES11StateTrackerVector4
 A CC3OpenGLES11StateTrackerPrimitive that tracks a 4D vector GL state value. More...
class  CC3OpenGLES11StateTrackerViewport
 CC3OpenGLES11StateTrackerViewport tracks the viewport GL state. More...

Enumerations

enum  CC3GLESStateOriginalValueHandling

Functions

typedef void (CC3SetGLBooleanFunction(GLboolean))
typedef void (CC3SetGLViewportFunction(GLint, GLint, GLsizei, GLsizei))
typedef void (CC3SetGLColorFunctionFixed(GLubyte, GLubyte, GLubyte, GLubyte))
typedef void (CC3SetGLColorFunction(GLfloat, GLfloat, GLfloat, GLfloat))
typedef void (CC3SetGLEnumerationFunction(GLenum))
typedef void (CC3SetGLIntegerFunction(GLint))
typedef void (CC3SetGLFloatFunction(GLfloat))

Detailed Description


Enumeration Type Documentation

An enumeration of the techniques for handling the existing value of a GL state at the time the CC3OpenGLES11Engine singleton instance open method is invoked, combined with techniques for how to leave that GL state when the singleton close method is invoked, prior to the resumption of normal cocos2d 2D drawing.

The following types of original value handling are available:

  • kCC3GLESStateOriginalValueIgnore: The original value of the GL state when the CC3OpenGLES11Engine open method is invoked is ignored. The first subsequent state change will always set the GL state. The GL state is left as-is when the CC3OpenGLES11Engine close method is invoked.
  • kCC3GLESStateOriginalValueReadOnce: The original GL state value is read once, on the fist invocation of the CC3OpenGLES11Engine open method, and is remembered. The value is assumed to always have this value at the time of any subsequent invocations of the CC3OpenGLES11Engine open method. The first subsequent attempt to change this GL state value will only be forwarded to the GL function if it is different than this value. The GL state is left as-is when the CC3OpenGLES11Engine close method is invoked.
  • kCC3GLESStateOriginalValueReadAlways: The original GL state value is read on every invocation of the CC3OpenGLES11Engine open method. The first subsequent attempt to change this GL state value will only be forwarded to the GL function if it is different than this value. The GL state is left as-is when the CC3OpenGLES11Engine close method is invoked.
  • kCC3GLESStateOriginalValueReadOnceAndRestore: The original GL state value is read as described for kCC3GLESStateOriginalValueReadOnce. On every invocation of the CC3OpenGLES11Engine close method, the GL state is ensured to be set back to this value before 2D drawing resumes.
  • kCC3GLESStateOriginalValueReadAlwaysAndRestore: The original GL state value is read as described for kCC3GLESStateOriginalValueReadAlways. On every invocation of the CC3OpenGLES11Engine close method, the GL state is ensured to be set back to this value before 2D drawing resumes.
  • kCC3GLESStateOriginalValueRestore: The original GL state value is set manually during initialization. On every invocation of the CC3OpenGLES11Engine close method, the GL state is ensured to be set back to this value before 2D drawing resumes.

For maximum throughput in the GL engine, reading of GL state from the GL engine should be minimized. Therefore, the enumerations kCC3GLESStateOriginalValueReadAlways and kCC3GLESStateOriginalValueReadAlwaysAndRestore should be avoided whenever possible and only used as a last resort.

The enumeration kCC3GLESStateOriginalValueIgnore is best for GL state that has an unpredictable value when the CC3OpenGLES11Engine method is invoked, and where cocos2d does not expect the state to be in any particular value when 2D drawing resumes after 3D drawing is complete.

The enumeration kCC3GLESStateOriginalValueReadOnceAndRestore is best for GL state that must be left with a predictable value when the CC3OpenGLES11Engine close method is invoked. This is typical for state that cocos2d expects to have a particular value when 2D drawing resumes after 3D drawing is complete.

The enumeration kCC3GLESStateOriginalValueReadAlwaysAndRestore should only be used for GL state that is unpredictable when 3D drawing begins, but must be left in that same state when 2D drawing ends. This is rare, and should only be used as a last resort.

The enumeration kCC3GLESStateOriginalValueRestore should only be used when it is not possible to read the GL value from the GL engine. This is the case for a few OES state values.

The enumerations kCC3GLESStateOriginalValueReadOnce and kCC3GLESStateOriginalValueReadAlways have limited value, since they perform a GL read, but do not restore that value once 3D drawing is complete. It is generally better to simply use the enumeration kCC3GLESStateOriginalValueIgnore instead. However, kCC3GLESStateOriginalValueReadOnce can be useful for reading platform characteristics and limits.


Function Documentation

typedef void ( CC3SetGLBooleanFunction(GLboolean)   )

Declaration of a generic GL function that takes a boolean value.

typedef void ( CC3SetGLViewportFunction(GLint, GLint, GLsizei, GLsizei)   )

Declaration of a generic GL function that takes viewport component values.

typedef void ( CC3SetGLColorFunctionFixed(GLubyte, GLubyte, GLubyte, GLubyte)   )

Declaration of a generic GL function that takes color component values.

typedef void ( CC3SetGLColorFunction(GLfloat, GLfloat, GLfloat, GLfloat)   )

Declaration of a generic GL function that takes color component values.

typedef void ( CC3SetGLEnumerationFunction(GLenum)   )

Declaration of a generic GL function that takes an enumerated value.

typedef void ( CC3SetGLIntegerFunction(GLint)   )

Declaration of a generic GL function that takes an integer value.

typedef void ( CC3SetGLFloatFunction(GLfloat)   )

Declaration of a generic GL function that takes a float value.