Inherits from CC3Identifiable : NSObject
Declared in CC3OpenGL.h

Overview

CC3OpenGL manages the OpenGL or OpenGL ES state for a single GL context.

CC3OpenGL is implemented as a class cluster. The abstract CC3OpenGL class supports a superset of functionality for OpenGL, OpenGL ES 1.1, or OpenGL ES 2.0. Concrete subclass implementations provide functionality tailored to each specific GL implementation.

OpenGL is designed to be a state machine that operates asynchronously from the application code that calls its functions. Calls to most gl functions queue up commands to the GL engine that are processed by the GL engine asynchronously from the gl call.

This design allows GL command execution to be run on a different processor than the application is running on, specifically a hardware-assisted GPU.

To maximize the throughput and performance of this design, it is important that GL state is changed only when necessary, and that querying of the GL state machine is avoided wherever possible.

By routing all GL requests through CC3OpenGL, this class can keep track of the GL state change requests made to the GL engine, and will only forward such requests to the GL engine if the state really is changing.

Tasks

Properties

__deprecated

@deprecated Renamed to maxNumberOfBoneInfluencesPerVertex.

@property (nonatomic, readonly) GLuint maxNumberOfVertexUnits __deprecated

Declared In

CC3OpenGL.h

context

The OpenGL engine context.

@property (nonatomic, retain) CC3GLContext *context

Discussion

The value of this property is automatically retrieved from the CCGLView.

Declared In

CC3OpenGL.h

deletionDelay

Indicates the length of time, in seconds, that this instance will wait after the terminateOpenGL method is invoked, before this instance is actually deleted. This delay is intended to provide time for object deallocation and cleanup after the caches have been cleared, and autorelease pools have been drained.

@property (nonatomic, assign) NSTimeInterval deletionDelay

Discussion

The value of this property is specified in seconds. The initial value of this is 0 for the instance that is used on the primary rendering thread, and 0.25 for the instance that is used for loading resources in the background.

Declared In

CC3OpenGL.h

extensions

Returns a collection of names of the GL extensions supported by the platform.

@property (nonatomic, retain, readonly) NSSet *extensions

Declared In

CC3OpenGL.h

isRenderingContext

Returns whether this instance is tracking state for the primary rendering GL context on the rendering thread.

@property (nonatomic, readonly) BOOL isRenderingContext

Declared In

CC3OpenGL.h

maxCubeMapTextureSize

Returns the maximum size for a cube-map texture supported by the platform.

@property (nonatomic, readonly) GLuint maxCubeMapTextureSize

Declared In

CC3OpenGL.h

maxNumberOfBoneInfluencesPerVertex

Returns the maximum number of vertex skinning bone influences per vertex supported by the platform, or zero if the platform does not impose a limit.

@property (nonatomic, readonly) GLuint maxNumberOfBoneInfluencesPerVertex

Declared In

CC3OpenGL.h

maxNumberOfClipPlanes

Returns the maximum number of clip planes supported by the platform.

@property (nonatomic, readonly) GLuint maxNumberOfClipPlanes

Declared In

CC3OpenGL.h

maxNumberOfFragmentShaderUniformVectors

Returns the maximum number of GLSL uniform vectors allowed in each fragment shader.

@property (nonatomic, readonly) GLuint maxNumberOfFragmentShaderUniformVectors

Declared In

CC3OpenGL.h

maxNumberOfLights

Returns the maximum number of lights supported by the platform.

@property (nonatomic, readonly) GLuint maxNumberOfLights

Declared In

CC3OpenGL.h

maxNumberOfPaletteMatrices

Returns the maximum number of vertex skinning palette matrices supported by the platform, or zero if the platform does not impose a limit.

@property (nonatomic, readonly) GLuint maxNumberOfPaletteMatrices

Declared In

CC3OpenGL.h

maxNumberOfPixelSamples

Returns the maximum number of pixel samples supported by the platform, or zero if the platform does not impose a limit.

@property (nonatomic, readonly) GLuint maxNumberOfPixelSamples

Declared In

CC3OpenGL.h

maxNumberOfShaderProgramVaryingVectors

Returns the maximum number of GLSL varying vectors allowed in each shader program.

@property (nonatomic, readonly) GLuint maxNumberOfShaderProgramVaryingVectors

Declared In

CC3OpenGL.h

maxNumberOfTextureUnits

Returns the maximum number of texture units supported by the platform, or zero if the platform does not impose a limit.

@property (nonatomic, readonly) GLuint maxNumberOfTextureUnits

Declared In

CC3OpenGL.h

maxNumberOfVertexAttributes

Returns the maximum number of vertex attributes supported by the platform, or zero if the platform does not impose a limit.

@property (nonatomic, readonly) GLuint maxNumberOfVertexAttributes

Declared In

CC3OpenGL.h

maxNumberOfVertexShaderUniformVectors

Returns the maximum number of GLSL uniform vectors allowed in each vertex shader.

@property (nonatomic, readonly) GLuint maxNumberOfVertexShaderUniformVectors

Declared In

CC3OpenGL.h

maxRenderbufferSize

Returns the maximum size for a renderbuffer supported by the platform.

@property (nonatomic, readonly) GLuint maxRenderbufferSize

Declared In

CC3OpenGL.h

maxTextureSize

Returns the maximum size for a 2D texture supported by the platform.

@property (nonatomic, readonly) GLuint maxTextureSize

Declared In

CC3OpenGL.h

shaderProgramPrewarmer

The shader prewarmer for this context.

@property (nonatomic, retain) CC3ShaderPrewarmer *shaderProgramPrewarmer

Discussion

When loading, compiling and linking a shader program, some of the steps are deferred, within the GL engine, until the shader is first used to draw a mesh. This can result in a significant, unexpected, and undesired pause during the GL draw call.

This prewarmer can be used to force that first draw call to be made immediately, and to an off-screen surface, so it won’t be visible.

Declared In

CC3OpenGL.h

Class Methods

delegate

Returns the CC3OpenGLDelegate delegate that will receive callback notifications for asynchronous OpenGL activities.

+ (NSObject<CC3OpenGLDelegate> *)delegate

Declared In

CC3OpenGL.h

isRenderThread

Returns whether the current thread is being used for primary rendering.

+ (BOOL)isRenderThread

Declared In

CC3OpenGL.h

renderThread

Returns the thread that is being used for primary rendering.

+ (NSThread *)renderThread

Declared In

CC3OpenGL.h

setDelegate:

Sets the CC3OpenGLDelegate delegate that will receive callback notifications for asynchronous OpenGL activities.

+ (void)setDelegate:(NSObject<CC3OpenGLDelegate> *)delegate

Declared In

CC3OpenGL.h

sharedGL

Returns the shared singleton instance for the currently running thread, creating it if necessary.

+ (CC3OpenGL *)sharedGL

Discussion

Within OpenGL, the state of the GL engine is tracked per thread. To support this, although the interface is as a singleton, this implementation actually keeps track of a CC3OpenGL instance per thread, and will return the appropriate instance according to which thread the invocation of this method is occuring.

Currently, a maximum of two instances are supported, one for the primary rendering thread, and one for a single background thread that can be used for loading resources, textures, and shaders.

Declared In

CC3OpenGL.h

terminateOpenGL

Terminates the current use of OpenGL by this application.

+ (void)terminateOpenGL

Discussion

Terminates the CCDirector.sharedDirector singleton. Terminates OpenGL and deletes all GL contexts, serving all threads. Also clears all caches that contain content that uses OpenGL, including:

 - CC3Resource
  • CC3Texture
  • CC3ShaderProgram
  • CC3Shader
  • CC3ShaderSourceCode

You can invoke this method when your app no longer needs support for OpenGL, or will not use OpenGL for a significant amount of time, in order to free up app and OpenGL memory used by your application.

To ensure that further OpenGL calls are not attempted, before invoking this method, you should release all CC3Scenes that you have created or loaded, along with any Cocos2D components.

To ensure that that the current GL activity has finished before pulling the rug out from under it, this request is queued for each existing context, on the thread for which the context was created, and will only be executed once any currently running tasks on the queue have been completed.

In addition, once dequeued, a short delay is imposed, before the context instance is actually released and deallocated, to provide time for object deallocation and cleanup after the caches have been cleared, and autorelease pools have been drained. The length of this delay may be different for each context instance, and is specified by the deletionDelay property of each instance.

Since much of the processing of this method is handled through queued operations, as described above, this method will return as soon as the requests are queued, and well before the operations have completed, and OpenGL has been terminated.

You can choose to be notified once all operations triggered by this method have completed, and OpenGL has been terminated, by registering a delegate object using the setDelegate: class method. The delegate object will be sent the didTerminateOpenGL method once all operations triggered by this method have completed, and OpenGL has been terminated. You should use this delegate notification if you intend to make use of OpenGL again, as you must wait for one OpenGL session to terminate before starting another.

Note that, in order to ensure that OpenGL is free to shutdown, this method forces the CC3Texture shouldCacheAssociatedCCTextures class-side property to NO, so that any background loading that is currently occurring will not cache Cocos2D textures. If you had set this property to YES, and intend to restart OpenGL at some point, then you might want to set it back to YES before reloading 3D resources again.

Use this method with caution, as creating the GL contexts again will require significant overhead.

Declared In

CC3OpenGL.h

Instance Methods

activateClientTextureUnit:

Sets the specified texture unit as the active texture unit for client actions. Subsequent changes made to texture unit client properties will affect only this texture unit. The specified texture unit must be a value between zero and the maximum number of texture units supported by the platform.

- (void)activateClientTextureUnit:(GLuint)tuIdx

Discussion

This method is invoked automatically for any texture action method that identifies the texture unit on which the action should be made. Normally, this method does not need to be invoked directly.

Declared In

CC3OpenGL.h

activateMatrixStack:

Activates the specified matrix stack to make it the current matrix stack.

- (void)activateMatrixStack:(GLenum)mode

Declared In

CC3OpenGL.h

activatePaletteMatrixStack:

Activates the specified palette matrix stack to make it the current matrix stack.

- (void)activatePaletteMatrixStack:(GLuint)pmIdx

Declared In

CC3OpenGL.h

activateTextureUnit:

Sets the specified texture unit as the active texture unit. Subsequent changes made to texture unit properties will affect only this texture unit. The specified texture unit must be a value between zero and the maximum number of texture units supported by the platform.

- (void)activateTextureUnit:(GLuint)tuIdx

Discussion

This method is invoked automatically for any texture action method that identifies the texture unit on which the action should be made. Normally, this method does not need to be invoked directly.

Declared In

CC3OpenGL.h

alignFor2DDrawingWithVisitor:

Aligns the state within the GL engine to be suitable for 2D drawing by Cocos2D.

- (void)alignFor2DDrawingWithVisitor:(CC3NodeDrawingVisitor *)visitor

Discussion

This is invoked automatically during the transition from 3D to 2D drawing. You can also invoke this method if you perform 3D activities outside of the normal drawing loop, and you find that it interferes with subsequent 2D rendering by Cocos2D. However, such occurrances should be rare, and in most circumstances you should never need to invoke this method.

Declared In

CC3OpenGL.h

alignFor3DDrawingWithVisitor:

Aligns the state within the GL engine to be suitable for 3D drawing by Cocos3D.

- (void)alignFor3DDrawingWithVisitor:(CC3NodeDrawingVisitor *)visitor

Discussion

This is invoked automatically during the transition from 2D to 3D drawing.

Declared In

CC3OpenGL.h

allocateStorageForRenderbuffer:withSize:andFormat:andSamples:

Allocates storage for the specified renderbuffer, sufficient to render an image of the specified size, in the specified pixel format, and with the specified number of samples per pixel, which will be a value larger than one if antialiasing multisampling is in use. If multi-sampling is not supported by the platform, the pixelSamples value is ignored.

- (void)allocateStorageForRenderbuffer:(GLuint)rbID withSize:(CC3IntSize)size andFormat:(GLenum)format andSamples:(GLuint)pixelSamples

Declared In

CC3OpenGL.h

attachShader:toShaderProgram:

Attaches the specified shader to the specified shader program.

- (void)attachShader:(GLuint)shaderID toShaderProgram:(GLuint)programID

Declared In

CC3OpenGL.h

bindBuffer:toTarget:

Binds the buffer with the specified ID to the specified buffer target.

- (void)bindBuffer:(GLuint)buffId toTarget:(GLenum)target

Declared In

CC3OpenGL.h

bindFog:withVisitor:

Binds the specified fog configuration to the GL engine.

- (void)bindFog:(CC3Fog *)fog withVisitor:(CC3NodeDrawingVisitor *)visitor

Declared In

CC3OpenGL.h

bindFramebuffer:

Makes the framebuffer with the specified ID the current framebuffer in the GL engine.

- (void)bindFramebuffer:(GLuint)fbID

Declared In

CC3OpenGL.h

bindMesh:withVisitor:

Binds the vertex attributes in the specified mesh to the GL engine.

- (void)bindMesh:(CC3Mesh *)mesh withVisitor:(CC3NodeDrawingVisitor *)visitor

Declared In

CC3OpenGL.h

bindRenderbuffer:

Makes the renderbuffer with the specified ID the current renderbuffer in the GL engine.

- (void)bindRenderbuffer:(GLuint)rbID

Declared In

CC3OpenGL.h

bindRenderbuffer:toFrameBuffer:asAttachment:

Binds the specified renderbuffer to the specified framebuffer as the specified attachement.

- (void)bindRenderbuffer:(GLuint)rbID toFrameBuffer:(GLuint)fbID asAttachment:(GLenum)attachment

Declared In

CC3OpenGL.h

bindTexture2D:face:mipmapLevel:toFrameBuffer:asAttachment:

Binds the specified mipmap level of the specified face of the specified texture to the specified framebuffer as the specified attachement.

- (void)bindTexture2D:(GLuint)texID face:(GLenum)face mipmapLevel:(GLint)mipmapLevel toFrameBuffer:(GLuint)fbID asAttachment:(GLenum)attachment

Declared In

CC3OpenGL.h

bindTexture:toTarget:at:

Binds the texture with the specified ID to the specified target at the specified texture unit index, which must be a value between zero and the maximum number of texture units supported by the platform.

- (void)bindTexture:(GLuint)texID toTarget:(GLenum)target at:(GLuint)tuIdx

Declared In

CC3OpenGL.h

bindVertexArrayObject:

Binds the VAO with the specified ID.

- (void)bindVertexArrayObject:(GLuint)vaoId

Declared In

CC3OpenGL.h

bindVertexAttribute:withVisitor:

Retrieves the vertex array that should be bound to the specified attribute from the mesh of the current node and binds the content of the vertex array to the GLSL attribute. Does nothing if the mesh does not contain vertex content for the specified attribute.

- (void)bindVertexAttribute:(CC3GLSLAttribute *)attribute withVisitor:(CC3NodeDrawingVisitor *)visitor

Declared In

CC3OpenGL.h

bindVertexContent:withSize:withType:withStride:withShouldNormalize:toAttributeAt:

Binds the content pointer, size, type, stride, and normalization requirements value together for the vertex attribute at the specified index, which should be below the maximum number of vertex attributes supported by the platform.

- (void)bindVertexContent:(GLvoid *)pData withSize:(GLint)elemSize withType:(GLenum)elemType withStride:(GLsizei)vtxStride withShouldNormalize:(BOOL)shldNorm toAttributeAt:(GLint)vaIdx

Discussion

The values will be set in the GL engine only if at least one of the values has actually changed.

It is safe to submit a negative index. It will be ignored, and no changes will be made.

Declared In

CC3OpenGL.h

captureOpenGLFrame

Capture the current OpenGL command stream frame, starting at this point.

- (void)captureOpenGLFrame

Declared In

CC3OpenGL.h

checkFramebufferStatus:

Checks the completeness status of the specified framebuffer, and returns YES if the framebuffer is complete and ready to be drawn to, or NO if the framebuffer is not ready to be drawn to.

- (BOOL)checkFramebufferStatus:(GLuint)fbID

Discussion

If the framebuffer is not complete, an error is logged, and, if the GL_ERROR_ASSERTION_ENABLED compiler build setting is set, an assertion error is raised.

Declared In

CC3OpenGL.h

clearBuffers:

Clears the buffers identified by the specified bitmask, which is a bitwise OR combination of one or more of the following masks: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, and GL_STENCIL_BUFFER_BIT

- (void)clearBuffers:(GLbitfield)mask

Declared In

CC3OpenGL.h

clearOpenGLResourceCaches

Clears content and resource caches that use OpenGL, including the CC3ShaderPrewarmer instance in the shaderProgramPrewarmer property, and the following OpenGL resource caches:

- (void)clearOpenGLResourceCaches

Discussion

 - CC3Resource
  • CC3Texture
  • CC3ShaderProgram
  • CC3Shader
  • CC3ShaderSourceCode
  • CC3ShaderSourceCode

Declared In

CC3OpenGL.h

clearTextureBinding:

Clears the tracking of the specified texture.

- (void)clearTextureBinding:(GLuint)texID

Discussion

For each texture unit whose state tracking indicates that it is bound to the specified texture, sets the tracking state for that texture unit to the default texture ID (0), to ensure that the state tracking no longer expects to be bound to that texture.

This method is invoked automatically whenever a GL texture is deleted, or whenever a GL texture is removed from Cocos3D, but may still be in use by Cocos2D.

Declared In

CC3OpenGL.h

clearUnboundVertexAttributes

Clears the tracking of unbound vertex attribute arrays.

- (void)clearUnboundVertexAttributes

Declared In

CC3OpenGL.h

compileShader:from:sourceCodeStrings:

Compiles the specified shader from the specified number of GLSL source code strings, which is an array of null-terminated UTF8 strings. The number of source strings in the source string array must be at least as large as the specified count.

- (void)compileShader:(GLuint)shaderID from:(GLuint)srcStrCount sourceCodeStrings:(const GLchar **)srcCodeStrings

Discussion

You can use the getShaderWasCompiled: method to determine whether compilation was successful, and the getLogForShader: method to retrieve the reason for any unsuccessful compilation.

Declared In

CC3OpenGL.h

compileShader:fromSourceCodeStrings:

@deprecated Use the compileShader:from:sourceCodeStrings: method instead.

- (void)compileShader:(GLuint)shaderID fromSourceCodeStrings:(NSArray *)glslSources

Declared In

CC3OpenGL.h

createShader:

Creates a new shader of the specifed type and returns its ID.

- (GLuint)createShader:(GLenum)shaderType

Discussion

The shaderType parameter must be one of the following values: – GL_VERTEX_SHADER – GL_FRAGMENT_SHADER

Declared In

CC3OpenGL.h

createShaderProgram

Creates a new GLSL program and returns its ID.

- (GLuint)createShaderProgram

Declared In

CC3OpenGL.h

defaultShaderPreamble

Returns a string containing platform-specific GLSL source code to be used as a preamble for the vertex and fragment shader source code when compiling the shaders.

- (NSString *)defaultShaderPreamble

Declared In

CC3OpenGL.h

deleteBuffer:

Deletes the GL buffer with the specifid buffer ID.

- (void)deleteBuffer:(GLuint)buffID

Discussion

This is a wrapper for the GL function glDeleteBuffers.

Declared In

CC3OpenGL.h

deleteFramebuffer:

Deletes the framebuffer with the specified ID from the GL engine.

- (void)deleteFramebuffer:(GLuint)fbID

Declared In

CC3OpenGL.h

deleteRenderbuffer:

Deletes the renderbuffer with the specified ID from the GL engine.

- (void)deleteRenderbuffer:(GLuint)rbID

Declared In

CC3OpenGL.h

deleteShader:

Deletes the shader with the specified ID from the GL engine.

- (void)deleteShader:(GLuint)shaderID

Declared In

CC3OpenGL.h

deleteShaderProgram:

Deletes the shader program with the specified ID from the GL engine.

- (void)deleteShaderProgram:(GLuint)programID

Declared In

CC3OpenGL.h

deleteTexture:

Deletes the texture with the specified ID from the GL engine.

- (void)deleteTexture:(GLuint)texID

Declared In

CC3OpenGL.h

detachShader:fromShaderProgram:

Detaches the specified shader from the specified shader program.

- (void)detachShader:(GLuint)shaderID fromShaderProgram:(GLuint)programID

Declared In

CC3OpenGL.h

disableTexturingAt:

Disables texturing for all targets in the specified texture unit index, which must be a value between zero and the maximum number of texture units supported by the platform.

- (void)disableTexturingAt:(GLuint)tuIdx

Declared In

CC3OpenGL.h

disableTexturingFrom:

Disables texturing for all targets in all texture units starting at, and above, the specified texture unit index, which must be a value between zero and the maximum number of texture units supported by the platform.

- (void)disableTexturingFrom:(GLuint)tuIdx

Declared In

CC3OpenGL.h

discard:attachments:fromFramebuffer:

Discards the specified attachments from the specified framebuffer.

- (void)discard:(GLsizei)count attachments:(const GLenum *)attachments fromFramebuffer:(GLuint)fbID

Discussion

The attachments parameter is an array of framebuffer attachments enums that is may include: – GL_COLOR_ATTACHMENT0 – GL_DEPTH_ATTACHMENT – GL_STENCIL_ATTACHMENT

The count parameter indicates the length of this array.

Declared In

CC3OpenGL.h

drawIndicies:ofLength:andType:as:

Draws the vertices indexed by the specified indices, to the specified number of indices, each of the specified GL type, and using the specified draw mode.

- (void)drawIndicies:(GLvoid *)indicies ofLength:(GLuint)len andType:(GLenum)type as:(GLenum)drawMode

Discussion

This is a wrapper for the GL function glDrawElements.

Declared In

CC3OpenGL.h

drawVerticiesAs:startingAt:withLength:

Draws vertices bound by the vertex pointers using the specified draw mode, starting at the specified index, and drawing the specified number of verticies.

- (void)drawVerticiesAs:(GLenum)drawMode startingAt:(GLuint)start withLength:(GLuint)len

Discussion

This is a wrapper for the GL function glDrawArrays.

Declared In

CC3OpenGL.h

dumpTextureBindings

Returns a string description of the current texture object bindings for each texture unit.

- (NSString *)dumpTextureBindings

Declared In

CC3OpenGL.h

enable2DVertexAttributes

Enables the vertex attribute needed for drawing Cocos2D 2D artifacts, and disables all the rest.

- (void)enable2DVertexAttributes

Declared In

CC3OpenGL.h

enableAlphaTesting:

Enable/disable alpha testing.

- (void)enableAlphaTesting:(BOOL)onOff

Declared In

CC3OpenGL.h

enableBlend:

Enable/disable blending.

- (void)enableBlend:(BOOL)onOff

Declared In

CC3OpenGL.h

enableBoundVertexAttributes

Enables the vertex attributes that have been bound and disables the rest.

- (void)enableBoundVertexAttributes

Declared In

CC3OpenGL.h

enableClipPlane:at:

Enable/disable the user clipping plane at the specified index, which must be a value between zero and the maximum number of clipping planes supported by the platform.

- (void)enableClipPlane:(BOOL)onOff at:(GLuint)clipIdx

Declared In

CC3OpenGL.h

enableColorLogicOp:

Enable/disable the current color logic operation.

- (void)enableColorLogicOp:(BOOL)onOff

Declared In

CC3OpenGL.h

enableColorMaterial:

Enable/disable the ambient & diffuse material colors to track vertex color.

- (void)enableColorMaterial:(BOOL)onOff

Declared In

CC3OpenGL.h

enableCullFace:

Enable/disable polygon face culling.

- (void)enableCullFace:(BOOL)onOff

Declared In

CC3OpenGL.h

enableDepthTest:

Enable/disable depth testing.

- (void)enableDepthTest:(BOOL)onOff

Declared In

CC3OpenGL.h

enableDither:

Enable/disable dithering.

- (void)enableDither:(BOOL)onOff

Declared In

CC3OpenGL.h

enableFog:

Enable/disable fogging.

- (void)enableFog:(BOOL)onOff

Declared In

CC3OpenGL.h

enableLight:at:

Enable/disable the light at the specified index, which must be a value between zero and the maximum number of lights supported by the platform.

- (void)enableLight:(BOOL)onOff at:(GLuint)ltIdx

Declared In

CC3OpenGL.h

enableLighting:

Enable/disable lighting.

- (void)enableLighting:(BOOL)onOff

Declared In

CC3OpenGL.h

enableLineSmoothing:

Enable/disable line smoothing.

- (void)enableLineSmoothing:(BOOL)onOff

Declared In

CC3OpenGL.h

enableMatrixPalette:

Enable/disable bone skinning using matrix palettes.

- (void)enableMatrixPalette:(BOOL)onOff

Declared In

CC3OpenGL.h

enableMultisampling:

Enable/disable sampling multiple fragments per pixel.

- (void)enableMultisampling:(BOOL)onOff

Declared In

CC3OpenGL.h

enableNormalize:

Enable/disable the re-normalizing of normals when they are transformed.

- (void)enableNormalize:(BOOL)onOff

Declared In

CC3OpenGL.h

enablePointSmoothing:

Enable/disable point smoothing.

- (void)enablePointSmoothing:(BOOL)onOff

Declared In

CC3OpenGL.h

enablePointSpriteCoordReplace:at:

Enable/disable point sprite texture coordinate replacement for the specified texture unit index, which must be a value between zero and the maximum number of texture units supported by the platform.

- (void)enablePointSpriteCoordReplace:(BOOL)onOff at:(GLuint)tuIdx

Declared In

CC3OpenGL.h

enablePointSprites:

Enable/disable displaying points as textured point sprites.

- (void)enablePointSprites:(BOOL)onOff

Declared In

CC3OpenGL.h

enablePolygonOffset:

Enable/disable offsetting fragment depth when comparing depths.

- (void)enablePolygonOffset:(BOOL)onOff

Declared In

CC3OpenGL.h

enableRescaleNormal:

Enable/disable the re-scaling of normals when they are transformed.

- (void)enableRescaleNormal:(BOOL)onOff

Declared In

CC3OpenGL.h

enableSampleAlphaToCoverage:

Enable/disable alpha coverage in multisampling.

- (void)enableSampleAlphaToCoverage:(BOOL)onOff

Declared In

CC3OpenGL.h

enableSampleAlphaToOne:

Enable/disable setting alpha to one when multisampling.

- (void)enableSampleAlphaToOne:(BOOL)onOff

Declared In

CC3OpenGL.h

enableSampleCoverage:

Enable/disable sample coverage.

- (void)enableSampleCoverage:(BOOL)onOff

Declared In

CC3OpenGL.h

enableScissorTest:

Enable/disable discarding pixels that are outside to a scissor rectangle.

- (void)enableScissorTest:(BOOL)onOff

Declared In

CC3OpenGL.h

enableShaderPointSize:

Enable/disable displaying points as textured point sprites.

- (void)enableShaderPointSize:(BOOL)onOff

Declared In

CC3OpenGL.h

enableStencilTest:

Enable/disable discarding pixels that are not part of a defined stencil.

- (void)enableStencilTest:(BOOL)onOff

Declared In

CC3OpenGL.h

enableTexturing:inTarget:at:

Enable/disable texturing for the specified target in the specified texture unit index, which must be a value between zero and the maximum number of texture units supported by the platform.

- (void)enableTexturing:(BOOL)onOff inTarget:(GLenum)target at:(GLuint)tuIdx

Declared In

CC3OpenGL.h

enableTwoSidedLighting:

Enable/disable two-sided lighting.

- (void)enableTwoSidedLighting:(BOOL)onOff

Declared In

CC3OpenGL.h

enableVertexAttribute:at:

Enable/disable the vertex attributes at the specified index, which must be a value between zero and the maximum number of vertex attributes supported by the platform.

- (void)enableVertexAttribute:(BOOL)onOff at:(GLint)vaIdx

Discussion

It is safe to submit a negative index. It will be ignored, and no changes will be made.

Declared In

CC3OpenGL.h

finish

Flushes the GL buffer to the GL hardware, and returns only when all GL commands have finished.

- (void)finish

Declared In

CC3OpenGL.h

flush

Flushes the GL buffer to the GL hardware.

- (void)flush

Declared In

CC3OpenGL.h

fragmentShaderVarPrecision:

Returns the resolvable precision of the shader variable of the specified type within a fragment shader, or returns zero if the platform does not support shader precision modifiers.

- (GLfloat)fragmentShaderVarPrecision:(GLenum)precisionType

Discussion

The precisionType argument must be one of: – GL_LOW_FLOAT – GL_MEDIUM_FLOAT – GL_HIGH_FLOAT – GL_LOW_INT – GL_MEDIUM_INT – GL_HIGH_INT

Declared In

CC3OpenGL.h

fragmentShaderVarRangeMax:

Returns the maximum precision value of the shader variable of the specified type for a fragment shader, or returns zero if the platform does not support shader precision modifiers.

- (GLfloat)fragmentShaderVarRangeMax:(GLenum)precisionType

Discussion

For float variable types, this value is the (+/–) maximum value. For int variable types, this is the absolute maximum positive value.

The precisionType argument must be one of: – GL_LOW_FLOAT – GL_MEDIUM_FLOAT – GL_HIGH_FLOAT – GL_LOW_INT – GL_MEDIUM_INT – GL_HIGH_INT

Declared In

CC3OpenGL.h

fragmentShaderVarRangeMin:

Returns the minimum precision value of the shader variable of the specified type for a fragment shader, or returns zero if the platform does not support shader precision modifiers.

- (GLfloat)fragmentShaderVarRangeMin:(GLenum)precisionType

Discussion

For float variable types, this value is the (+/–) minimum resolvable value. For int variable types, this is the absolute minimum negative value.

The precisionType argument must be one of: – GL_LOW_FLOAT – GL_MEDIUM_FLOAT – GL_HIGH_FLOAT – GL_LOW_INT – GL_MEDIUM_INT – GL_HIGH_INT

Declared In

CC3OpenGL.h

generateBuffer

Generates and returns a GL buffer ID.

- (GLuint)generateBuffer

Discussion

This is a wrapper for the GL function glGenBuffers.

Declared In

CC3OpenGL.h

generateFramebuffer

Generates and returns a new framebuffer ID.

- (GLuint)generateFramebuffer

Declared In

CC3OpenGL.h

generateMipmapForTarget:at:

Generates a mipmap for the specified target for the texture bound to the specified texture unit.

- (void)generateMipmapForTarget:(GLenum)target at:(GLuint)tuIdx

Declared In

CC3OpenGL.h

generateRenderbuffer

Generates and returns a new renderbuffer ID.

- (GLuint)generateRenderbuffer

Declared In

CC3OpenGL.h

generateTexture

Generates a new texture and returns its ID.

- (GLuint)generateTexture

Declared In

CC3OpenGL.h

getFloat:

Returns the current value in the GL engine of the specified float parameter.

- (GLfloat)getFloat:(GLenum)param

Declared In

CC3OpenGL.h

getInteger:

Returns the current value in the GL engine of the specified integer parameter.

- (GLint)getInteger:(GLenum)param

Declared In

CC3OpenGL.h

getIntegerParameter:forShader:

Returns the integer value of the specified GL engine parameter for the specified shader.

- (GLint)getIntegerParameter:(GLenum)param forShader:(GLuint)shaderID

Declared In

CC3OpenGL.h

getIntegerParameter:forShaderProgram:

Returns the integer value of the specified GL engine parameter for the specified shader program.

- (GLint)getIntegerParameter:(GLenum)param forShaderProgram:(GLuint)programID

Declared In

CC3OpenGL.h

getLogForShader:

Returns the GL status info log for the specified shader.

- (NSString *)getLogForShader:(GLuint)shaderID

Declared In

CC3OpenGL.h

getLogForShaderProgram:

Returns the GL status info log for the GL program.

- (NSString *)getLogForShaderProgram:(GLuint)programID

Declared In

CC3OpenGL.h

getRenderbufferParameterInteger:

Returns the current value in the GL engine of the specified integer renderbuffer parameter.

- (GLint)getRenderbufferParameterInteger:(GLenum)param

Declared In

CC3OpenGL.h

getShaderProgramWasLinked:

Returns whether the specified shader was successfully linked.

- (BOOL)getShaderProgramWasLinked:(GLuint)programID

Declared In

CC3OpenGL.h

getShaderWasCompiled:

Returns whether the specified shader was successfully compiled.

- (BOOL)getShaderWasCompiled:(GLuint)shaderID

Declared In

CC3OpenGL.h

getSourceCodeForShader:

Returns the GLSL source code for the specified shader.

- (NSString *)getSourceCodeForShader:(GLuint)shaderID

Declared In

CC3OpenGL.h

getString:

Returns the current value in the GL engine of the specified string parameter.

- (NSString *)getString:(GLenum)param

Declared In

CC3OpenGL.h

insertEventMarker:

Inserts the specified marker into the GL command stream. This marker can be used by the debugger to organize the presentation of the commands in an OpenGL frame.

- (void)insertEventMarker:(NSString *)marker

Discussion

This version must convert the specified marker string into a ‘C’ string in order to send it to the GL engine. For better performance, use the pushGroupMarkerC: version of this method, and consider using a static ‘C’ string, or caching the ‘C’ string to avoid creating it on each frame.

Declared In

CC3OpenGL.h

insertEventMarkerC:

Inserts the specified marker into the GL command stream. This marker can be used by the debugger to organize the presentation of the commands in an OpenGL frame.

- (void)insertEventMarkerC:(const char *)marker

Discussion

For best performance, consider using a static string, or caching the string to avoid creating it on each frame.

Declared In

CC3OpenGL.h

linkShaderProgram:

Links the specified shader program.

- (void)linkShaderProgram:(GLuint)programID

Discussion

You can use the getShaderProgramWasLinked: method to determine whether linking was successful, and the getLogForShaderProgram: method to retrieve the reason for any unsuccessful link attempt.

Declared In

CC3OpenGL.h

loadBufferTarget:withData:ofLength:forUse:

Loads data into the GL buffer currently bound to the specified target, starting at the specified buffer pointer, and extending for the specified length. The buffer usage is a hint for the GL engine, and must be a valid GL buffer usage enumeration value.

- (void)loadBufferTarget:(GLenum)target withData:(GLvoid *)buffPtr ofLength:(GLsizeiptr)buffLen forUse:(GLenum)buffUsage

Declared In

CC3OpenGL.h

loadModelviewMatrix:

Activates the modelview matrix stack and replaces the current matrix with the specified matrix.

- (void)loadModelviewMatrix:(const CC3Matrix4x3 *)mtx

Declared In

CC3OpenGL.h

loadPaletteMatrix:at:

Activates the specified palette matrix stack and replaces the current matrix with the specified matrix.

- (void)loadPaletteMatrix:(const CC3Matrix4x3 *)mtx at:(GLuint)pmIdx

Declared In

CC3OpenGL.h

loadProjectionMatrix:

Activates the projection matrix stack and replaces the current matrix with the specified matrix.

- (void)loadProjectionMatrix:(const CC3Matrix4x4 *)mtx

Declared In

CC3OpenGL.h

loadTexureImage:intoTarget:onMipmapLevel:withSize:withFormat:withType:withByteAlignment:at:

Loads the specified texture image data, with the specified characteristics, into the specified target at the specified texture unit, in GL memory.

- (void)loadTexureImage:(const GLvoid *)imageData intoTarget:(GLenum)target onMipmapLevel:(GLint)mipmapLevel withSize:(CC3IntSize)size withFormat:(GLenum)texelFormat withType:(GLenum)texelType withByteAlignment:(GLint)byteAlignment at:(GLuint)tuIdx

Declared In

CC3OpenGL.h

loadTexureSubImage:intoTarget:onMipmapLevel:intoRectangle:withFormat:withType:withByteAlignment:at:

Loads the specified texture image data, with the specified characteristics, into the specified rectangular area within the texture at the specified target and texture unit, in GL memory. The image data replaces the texture data within the specified bounds.

- (void)loadTexureSubImage:(const GLvoid *)imageData intoTarget:(GLenum)target onMipmapLevel:(GLint)mipmapLevel intoRectangle:(CC3Viewport)rect withFormat:(GLenum)texelFormat withType:(GLenum)texelType withByteAlignment:(GLint)byteAlignment at:(GLuint)tuIdx

Declared In

CC3OpenGL.h

maxTextureSizeForTarget:

Returns the maximum size for a texture used for the specified target supported by the platform.

- (GLuint)maxTextureSizeForTarget:(GLenum)target

Declared In

CC3OpenGL.h

popGroupMarker

Pops the current group marker from the GL command stream.

- (void)popGroupMarker

Discussion

This is the complement to the pushGroupMarker: or pushGroupMarkerC: methods, and you can use this method in conjunction with either of those methods.

Declared In

CC3OpenGL.h

popModelviewMatrixStack

Activates the modelview matrix stack and pops off the current top level.

- (void)popModelviewMatrixStack

Declared In

CC3OpenGL.h

popProjectionMatrixStack

Activates the projection matrix stack and pops off the current top level.

- (void)popProjectionMatrixStack

Declared In

CC3OpenGL.h

populateShaderProgramVariable:

Populates the specified GLSL variable with info retrieved from the GL engine.

- (void)populateShaderProgramVariable:(CC3GLSLVariable *)var

Declared In

CC3OpenGL.h

pushGroupMarker:

Pushes the specified group marker into the GL command stream. This marker can be used by the debugger to organize the presentation of the commands in an OpenGL frame.

- (void)pushGroupMarker:(NSString *)marker

Discussion

This version must convert the specified marker string into a ‘C’ string in order to send it to the GL engine. For better performance, use the pushGroupMarkerC: version of this method, and consider using a static ‘C’ string, or caching the ‘C’ string to avoid creating it on each frame.

Declared In

CC3OpenGL.h

pushGroupMarkerC:

Pushes the specified group marker into the GL command stream. This marker can be used by the debugger to organize the presentation of the commands in an OpenGL frame.

- (void)pushGroupMarkerC:(const char *)marker

Discussion

For best performance, consider using a static string, or caching the string to avoid creating it on each frame.

Declared In

CC3OpenGL.h

pushModelviewMatrixStack

Activates the modelview matrix stack, pushes it down one level, and copies the old top to the new top.

- (void)pushModelviewMatrixStack

Declared In

CC3OpenGL.h

pushProjectionMatrixStack

Activates the projection matrix stack, pushes it down one level, and copies the old top to the new top.

- (void)pushProjectionMatrixStack

Declared In

CC3OpenGL.h

readPixelsIn:fromFramebuffer:into:

Reads the color content of the range of pixels defined by the specified rectangle from the GL color buffer of the currently bound framebuffer, into the specified array, which must be large enough to accommodate the number of pixels covered by the specified rectangle.

- (void)readPixelsIn:(CC3Viewport)rect fromFramebuffer:(GLuint)fbID into:(ccColor4B *)colorArray

Discussion

Content is written to memory left to right across each row, starting at the row at the bottom of the image, and ending at the row at the top of the image. The pixel content is packed tightly into the specified array, with no gaps left at the end of each row. In memory, the last pixel of one row is immediately followed by the first pixel of the next row.

If the specified framebuffer is not the active framebuffer, it is temporarily activated, long enough to read the contents, then the current framebuffer is reactivated. This allows pixels to be read from a secondary framebuffer while rendering to the active framebuffer.

This method should be used with care, since it involves making a synchronous call to query the state of the GL engine. This method will not return until the GL engine has executed all previous drawing commands in the pipeline. Excessive use of this method will reduce GL throughput and performance.

Declared In

CC3OpenGL.h

releaseShaderCompiler

Releases the shader compiler and its resources from the GL engine.

- (void)releaseShaderCompiler

Discussion

It will be restored automatically on the next shader compilation request.

Declared In

CC3OpenGL.h

resolveMultisampleFramebuffer:intoFramebuffer:

Resolves the content in the specified multisample framebuffer into the specified framebuffer, and leaves the multisample framebuffer bound to the GL_FRAMEBUFFER target for further rendering.

- (void)resolveMultisampleFramebuffer:(GLuint)fbSrcID intoFramebuffer:(GLuint)fbDstID

Declared In

CC3OpenGL.h

setAlphaFunc:reference:

Sets the alpha function and reference value.

- (void)setAlphaFunc:(GLenum)func reference:(GLfloat)ref

Declared In

CC3OpenGL.h

setBlendFuncSrc:dst:

Sets the blend function, forcing RGB and alpha blending to use the same blending function.

- (void)setBlendFuncSrc:(GLenum)src dst:(GLenum)dst

Declared In

CC3OpenGL.h

setBlendFuncSrcRGB:dstRGB:srcAlpha:dstAlpha:

Sets the blend function, allowing RGB and alpha blending to be set separately.

- (void)setBlendFuncSrcRGB:(GLenum)srcRGB dstRGB:(GLenum)dstRGB srcAlpha:(GLenum)srcAlpha dstAlpha:(GLenum)dstAlpha

Declared In

CC3OpenGL.h

setClearColor:

Sets the color used to clear the color buffer.

- (void)setClearColor:(ccColor4F)color

Declared In

CC3OpenGL.h

setClearDepth:

Sets the value used to clear the depth buffer.

- (void)setClearDepth:(GLfloat)val

Declared In

CC3OpenGL.h

setClearStencil:

Sets the value used to clear the stencil buffer.

- (void)setClearStencil:(GLint)val

Declared In

CC3OpenGL.h

setColor:

Sets the color used to paint in the absence of materials and textures.

- (void)setColor:(ccColor4F)color

Declared In

CC3OpenGL.h

setColorMask:

Sets the color mask indicating which of R, G, B & A should be written to the color buffer.

- (void)setColorMask:(ccColor4B)mask

Declared In

CC3OpenGL.h

setCullFace:

Sets the faces to cull.

- (void)setCullFace:(GLenum)val

Declared In

CC3OpenGL.h

setDebugLabel:forBuffer:

Sets the debug label for the specified buffer.

- (void)setDebugLabel:(NSString *)label forBuffer:(GLuint)buffID

Declared In

CC3OpenGL.h

setDebugLabel:forFramebuffer:

Sets the debug label for the specified framebuffer.

- (void)setDebugLabel:(NSString *)label forFramebuffer:(GLuint)fbID

Declared In

CC3OpenGL.h

setDebugLabel:forObject:ofType:

Sets the debug label for the specified GL object of the specified type.

- (void)setDebugLabel:(NSString *)label forObject:(GLuint)objID ofType:(GLenum)objType

Declared In

CC3OpenGL.h

setDebugLabel:forRenderbuffer:

Sets the debug label for the specified renderbuffer.

- (void)setDebugLabel:(NSString *)label forRenderbuffer:(GLuint)rbID

Declared In

CC3OpenGL.h

setDebugLabel:forShader:

Sets the debug label for the specified shader.

- (void)setDebugLabel:(NSString *)label forShader:(GLuint)shaderID

Declared In

CC3OpenGL.h

setDebugLabel:forShaderProgram:

Sets the debug label for the specified shader program.

- (void)setDebugLabel:(NSString *)label forShaderProgram:(GLuint)progID

Declared In

CC3OpenGL.h

setDebugLabel:forTexture:

Sets the debug label for the specified texture.

- (void)setDebugLabel:(NSString *)label forTexture:(GLuint)texID

Declared In

CC3OpenGL.h

setDebugLabel:forVertexArray:

Sets the debug label for the specified vertex array.

- (void)setDebugLabel:(NSString *)label forVertexArray:(GLuint)vaID

Declared In

CC3OpenGL.h

setDepthFunc:

Sets the depth function to use when comparing depths.

- (void)setDepthFunc:(GLenum)val

Declared In

CC3OpenGL.h

setDepthMask:

Sets whether the depth buffer is enabled for writing.

- (void)setDepthMask:(BOOL)writable

Declared In

CC3OpenGL.h

setFogColor:

Sets the color of the fog.

- (void)setFogColor:(ccColor4F)color

Declared In

CC3OpenGL.h

setFogDensity:

Sets the density of the fog.

- (void)setFogDensity:(GLfloat)val

Declared In

CC3OpenGL.h

setFogEnd:

Sets the end distance of the fog.

- (void)setFogEnd:(GLfloat)val

Declared In

CC3OpenGL.h

setFogHint:

Sets the fog hint.

- (void)setFogHint:(GLenum)hint

Declared In

CC3OpenGL.h

setFogMode:

Sets the type of the fog.

- (void)setFogMode:(GLenum)mode

Declared In

CC3OpenGL.h

setFogStart:

Sets the start distance of the fog.

- (void)setFogStart:(GLfloat)val

Declared In

CC3OpenGL.h

setFrontFace:

Sets which face winding is considered to be the front face.

- (void)setFrontFace:(GLenum)val

Declared In

CC3OpenGL.h

setGenerateMipmapHint:

Sets the mipmap generation hint.

- (void)setGenerateMipmapHint:(GLenum)hint

Declared In

CC3OpenGL.h

setLightAmbientColor:at:

Sets the ambient color of the light at the specified index, which must be a value between zero and the maximum number of lights supported by the platform.

- (void)setLightAmbientColor:(ccColor4F)color at:(GLuint)ltIdx

Declared In

CC3OpenGL.h

setLightAttenuation:at:

Sets the distance attenuation coefficients of the light at the specified index, which must be a value between zero and the maximum number of lights supported by the platform.

- (void)setLightAttenuation:(CC3AttenuationCoefficients)ac at:(GLuint)ltIdx

Declared In

CC3OpenGL.h

setLightDiffuseColor:at:

Sets the diffuse color of the light at the specified index, which must be a value between zero and the maximum number of lights supported by the platform.

- (void)setLightDiffuseColor:(ccColor4F)color at:(GLuint)ltIdx

Declared In

CC3OpenGL.h

setLightPosition:at:

Sets the homogeneous position of the light at the specified index, which must be a value between zero and the maximum number of lights supported by the platform.

- (void)setLightPosition:(CC3Vector4)pos at:(GLuint)ltIdx

Declared In

CC3OpenGL.h

setLightSpecularColor:at:

Sets the specular color of the light at the specified index, which must be a value between zero and the maximum number of lights supported by the platform.

- (void)setLightSpecularColor:(ccColor4F)color at:(GLuint)ltIdx

Declared In

CC3OpenGL.h

setLineSmoothingHint:

Sets the line smooting hint.

- (void)setLineSmoothingHint:(GLenum)hint

Declared In

CC3OpenGL.h

setLineWidth:

Sets the width used to draw lines.

- (void)setLineWidth:(GLfloat)val

Declared In

CC3OpenGL.h

setMaterialAmbientColor:

Sets the ambient color of the material.

- (void)setMaterialAmbientColor:(ccColor4F)color

Declared In

CC3OpenGL.h

setMaterialDiffuseColor:

Sets the diffuse color of the material.

- (void)setMaterialDiffuseColor:(ccColor4F)color

Declared In

CC3OpenGL.h

setMaterialEmissionColor:

Sets the emission color of the material.

- (void)setMaterialEmissionColor:(ccColor4F)color

Declared In

CC3OpenGL.h

setMaterialShininess:

Sets the shininess of the material.

- (void)setMaterialShininess:(GLfloat)val

Declared In

CC3OpenGL.h

setMaterialSpecularColor:

Sets the specular color of the material.

- (void)setMaterialSpecularColor:(ccColor4F)color

Declared In

CC3OpenGL.h

setOpOnStencilFail:onDepthFail:onDepthPass:

Sets the operations when the stencil fails, the depth test fails, or the depth test passes.

- (void)setOpOnStencilFail:(GLenum)sFail onDepthFail:(GLenum)dFail onDepthPass:(GLenum)dPass

Declared In

CC3OpenGL.h

setPerspectiveCorrectionHint:

Sets the perspective correction hint.

- (void)setPerspectiveCorrectionHint:(GLenum)hint

Declared In

CC3OpenGL.h

setPixelPackingAlignment:

Sets the packing alignment when writing pixel content from the GL engine into application memory to the specified alignment, which may be 1, 2, 4 or 8.

- (void)setPixelPackingAlignment:(GLint)byteAlignment

Discussion

This value indicates whether each row of pixels should start at a 1, 2, 4 or 8 byte boundary. Depending on the width of the image, a value other than 1 may result in additional bytes being added at the end of each row of pixels, in order to maintain the specified byte alignment. The contents of those additional bytes is undefined.

Declared In

CC3OpenGL.h

setPixelUnpackingAlignment:

Sets the unpacking alignment when reading pixel content from application memory for copying into the GL engine to the specified alignment, which may be 1, 2, 4 or 8.

- (void)setPixelUnpackingAlignment:(GLint)byteAlignment

Discussion

This value indicates whether each row of pixels should start at a 1, 2, 4 or 8 byte boundary. Depending on the width of the image, a value other than 1 may require that the application add additional bytes to the end of each row of pixels, in order to maintain the specified byte alignment. The contents of those additional bytes is not copied into the GL engine.

Declared In

CC3OpenGL.h

setPointSize:

Sets the size used to draw points.

- (void)setPointSize:(GLfloat)val

Declared In

CC3OpenGL.h

setPointSizeAttenuation:

Sets the point size attenuation coefficients.

- (void)setPointSizeAttenuation:(CC3AttenuationCoefficients)ac

Declared In

CC3OpenGL.h

setPointSizeFadeThreshold:

Sets the point size below which points will be faded away.

- (void)setPointSizeFadeThreshold:(GLfloat)val

Declared In

CC3OpenGL.h

setPointSizeMaximum:

Sets the maximum size at which points will be drawn.

- (void)setPointSizeMaximum:(GLfloat)val

Declared In

CC3OpenGL.h

setPointSizeMinimum:

Sets the minimum size at which points will be drawn.

- (void)setPointSizeMinimum:(GLfloat)val

Declared In

CC3OpenGL.h

setPointSmoothingHint:

Sets the point smooting hint.

- (void)setPointSmoothingHint:(GLenum)hint

Declared In

CC3OpenGL.h

setPolygonOffsetFactor:units:

Sets the polygon offset factor and units.

- (void)setPolygonOffsetFactor:(GLfloat)factor units:(GLfloat)units

Declared In

CC3OpenGL.h

setSceneAmbientLightColor:

Sets the color of the ambient scene lighting.

- (void)setSceneAmbientLightColor:(ccColor4F)color

Declared In

CC3OpenGL.h

setScissor:

Sets the scissor clipping rectangle.

- (void)setScissor:(CC3Viewport)vp

Declared In

CC3OpenGL.h

setShadeModel:

Sets the shading model.

- (void)setShadeModel:(GLenum)val

Declared In

CC3OpenGL.h

setShaderProgramUniformValue:

Ensures that the shader program for the specified GLSL uniform is active, then sets the value of the uniform into the GL engine.

- (void)setShaderProgramUniformValue:(CC3GLSLUniform *)uniform

Declared In

CC3OpenGL.h

setSpotlightCutoffAngle:at:

Sets the cutoff angle of the spot light at the specified index, which must be a value between zero and the maximum number of lights supported by the platform.

- (void)setSpotlightCutoffAngle:(GLfloat)val at:(GLuint)ltIdx

Declared In

CC3OpenGL.h

setSpotlightDirection:at:

Sets the direction of the spot light at the specified index, which must be a value between zero and the maximum number of lights supported by the platform.

- (void)setSpotlightDirection:(CC3Vector)dir at:(GLuint)ltIdx

Declared In

CC3OpenGL.h

setSpotlightFadeExponent:at:

Sets the angular fading exponent of the spot light at the specified index, which must be a value between zero and the maximum number of lights supported by the platform.

- (void)setSpotlightFadeExponent:(GLfloat)val at:(GLuint)ltIdx

Declared In

CC3OpenGL.h

setStencilFunc:reference:mask:

Sets the stencil function parameters.

- (void)setStencilFunc:(GLenum)func reference:(GLint)ref mask:(GLuint)mask

Declared In

CC3OpenGL.h

setStencilMask:

Sets mask for enabling writing of individual bits in the stencil buffer.

- (void)setStencilMask:(GLuint)mask

Declared In

CC3OpenGL.h

setTextureEnvColor:at:

Sets the texture environment color of the specified texture unit index, which must be a value between zero and the maximum number of texture units supported by the platform.

- (void)setTextureEnvColor:(ccColor4F)color at:(GLuint)tuIdx

Declared In

CC3OpenGL.h

setTextureEnvMode:at:

Sets the texture environment mode of the specified texture unit index, which must be a value between zero and the maximum number of texture units supported by the platform.

- (void)setTextureEnvMode:(GLenum)mode at:(GLuint)tuIdx

Declared In

CC3OpenGL.h

setTextureHorizWrapFunc:inTarget:at:

Sets the texture horizontal wrapping function in the specified target of the specified texture unit index, which must be a value between zero and the maximum number of texture units supported by the platform.

- (void)setTextureHorizWrapFunc:(GLenum)func inTarget:(GLenum)target at:(GLuint)tuIdx

Declared In

CC3OpenGL.h

setTextureMagnifyFunc:inTarget:at:

Sets the texture magnifying function in the specified target of the specified texture unit index, which must be a value between zero and the maximum number of texture units supported by the platform.

- (void)setTextureMagnifyFunc:(GLenum)func inTarget:(GLenum)target at:(GLuint)tuIdx

Declared In

CC3OpenGL.h

setTextureMinifyFunc:inTarget:at:

Sets the texture minifying function in the specified target of the specified texture unit index, which must be a value between zero and the maximum number of texture units supported by the platform.

- (void)setTextureMinifyFunc:(GLenum)func inTarget:(GLenum)target at:(GLuint)tuIdx

Declared In

CC3OpenGL.h

setTextureVertWrapFunc:inTarget:at:

Sets the texture vertical wrapping function in the specified target of the specified texture unit index, which must be a value between zero and the maximum number of texture units supported by the platform.

- (void)setTextureVertWrapFunc:(GLenum)func inTarget:(GLenum)target at:(GLuint)tuIdx

Declared In

CC3OpenGL.h

setViewport:

Sets the viewport rectangle.

- (void)setViewport:(CC3Viewport)vp

Declared In

CC3OpenGL.h

supportsExtension:

Returns whether this platform supports the GL extension with the specified name, which should be the name of the GL extension, as registered with the OpenGL standards bodies, or as specified by the GPU driver manufacturer.

- (BOOL)supportsExtension:(NSString *)extensionName

Discussion

You may specify the name either with or without a “GL_” prefix (eg. both @“OES_packed_depth_stencil” and @“GL_OES_packed_depth_stencil” will work if that extension is supported).

This method checks the extensions collection for the presence of the specified name. Although this is an optimized hash test, you should generally not use this test in time-critical code. If you need to frequently test for the presence of an extension (for example, within the render loop), you should invoke this method once at the beginning of your app, and cache the resulting boolean value elsewhere in your code.

Declared In

CC3OpenGL.h

unbindBufferTarget:

Unbinds all buffers from the specified buffer target.

- (void)unbindBufferTarget:(GLenum)target

Discussion

This is equivalent to invoking the bindBuffer:toTarget: method with a zero buffID parameter.

Declared In

CC3OpenGL.h

updateBufferTarget:withData:startingAt:forLength:

Updates data in the GL buffer currently bound to the specified target, from data starting at the specified offset to the specified pointer, and extending for the specified length.

- (void)updateBufferTarget:(GLenum)target withData:(GLvoid *)buffPtr startingAt:(GLintptr)offset forLength:(GLsizeiptr)length

Declared In

CC3OpenGL.h

useShaderProgram:

Binds the specified GLSL program as the program to be used for subsequent rendering.

- (void)useShaderProgram:(GLuint)programID

Declared In

CC3OpenGL.h

vertexShaderVarPrecision:

Returns the resolvable precision of the shader variable of the specified type within a vertex shader, or returns zero if the platform does not support shader precision modifiers.

- (GLfloat)vertexShaderVarPrecision:(GLenum)precisionType

Discussion

The precisionType argument must be one of: – GL_LOW_FLOAT – GL_MEDIUM_FLOAT – GL_HIGH_FLOAT – GL_LOW_INT – GL_MEDIUM_INT – GL_HIGH_INT

Declared In

CC3OpenGL.h

vertexShaderVarRangeMax:

Returns the maximum precision value of the shader variable of the specified type for a vertex shader, or returns zero if the platform does not support shader precision modifiers.

- (GLfloat)vertexShaderVarRangeMax:(GLenum)precisionType

Discussion

For float variable types, this value is the (+/–) maximum value. For int variable types, this is the absolute maximum positive value.

The precisionType argument must be one of: – GL_LOW_FLOAT – GL_MEDIUM_FLOAT – GL_HIGH_FLOAT – GL_LOW_INT – GL_MEDIUM_INT – GL_HIGH_INT

Declared In

CC3OpenGL.h

vertexShaderVarRangeMin:

Returns the minimum precision value of the shader variable of the specified type for a vertex shader, or returns zero if the platform does not support shader precision modifiers.

- (GLfloat)vertexShaderVarRangeMin:(GLenum)precisionType

Discussion

For float variable types, this value is the (+/–) minimum resolvable value. For int variable types, this is the absolute minimum negative value.

The precisionType argument must be one of: – GL_LOW_FLOAT – GL_MEDIUM_FLOAT – GL_HIGH_FLOAT – GL_LOW_INT – GL_MEDIUM_INT – GL_HIGH_INT

Declared In

CC3OpenGL.h