cocos2d-iphone
2.0
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
|
Enumerations | |
enum | { kCCVertexAttribFlag_None = 0, kCCVertexAttribFlag_Position = 1 << 0, kCCVertexAttribFlag_Color = 1 << 1, kCCVertexAttribFlag_TexCoords = 1 << 2, kCCVertexAttribFlag_PosColorTex = ( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_Color | kCCVertexAttribFlag_TexCoords ) } |
enum | ccGLServerState { CC_GL_BLEND = 1 << 3, CC_GL_ALL = ( CC_GL_BLEND ) } |
Functions | |
void | ccGLInvalidateStateCache (void) |
void | ccGLUseProgram (GLuint program) |
void | ccGLDeleteProgram (GLuint program) |
void | ccGLBlendFunc (GLenum sfactor, GLenum dfactor) |
void | ccSetProjectionMatrixDirty (void) |
void | ccGLEnableVertexAttribs (unsigned int flags) |
void | ccGLActiveTexture (GLenum textureEnum) |
GLenum | ccGLGetActiveTexture (void) |
void | ccGLBindTexture2D (GLuint textureId) |
void | ccGLDeleteTexture (GLuint textureId) |
void | ccGLEnable (ccGLServerState flags) |
anonymous enum |
vertex attrib flags
enum ccGLServerState |
GL server side states
void ccGLActiveTexture | ( | GLenum | textureEnum | ) |
If the active texture is not textureEnum, then it will active it. If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glActiveTexture() directly.
void ccGLBindTexture2D | ( | GLuint | textureId | ) |
If the texture is not already bound, it binds it. If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly.
void ccGLBlendFunc | ( | GLenum | sfactor, |
GLenum | dfactor | ||
) |
Uses a blending function in case it not already used. If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glBlendFunc() directly.
void ccGLDeleteProgram | ( | GLuint | program | ) |
Deletes the GL program. If it is the one that is being used, it invalidates it. If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glDeleteProgram() directly.
void ccGLDeleteTexture | ( | GLuint | textureId | ) |
It will delete a given texture. If the texture was bound, it will invalidate the cached. If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly.
void ccGLEnable | ( | ccGLServerState | flags | ) |
It will enable / disable the server side GL states. If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glEnable() directly.
void ccGLEnableVertexAttribs | ( | unsigned int | flags | ) |
Will enable the vertex attribs that are passed as flags. Possible flags:
kCCVertexAttribFlag_Position kCCVertexAttribFlag_Color kCCVertexAttribFlag_TexCoords
These flags can be ORed. The flags that are not present, will be disabled.
GLenum ccGLGetActiveTexture | ( | void | ) |
Returns the active texture. If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glGetIntegerv(GL_ACTIVE_TEXTURE);
void ccGLInvalidateStateCache | ( | void | ) |
Invalidates the GL state cache. If CC_ENABLE_GL_STATE_CACHE it will reset the GL state cache.
void ccGLUseProgram | ( | GLuint | program | ) |
Uses the GL program in case program is different than the current one. If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glUseProgram() directly.
void ccSetProjectionMatrixDirty | ( | void | ) |
sets the projection matrix as dirty