|
cocos2d for iPhone 1.0.0
2D engine for iOS and OS X
|


Go to the source code of this file.
Defines | |
| #define | CC_SWAP(x, y) |
| #define | CCRANDOM_MINUS1_1() ((random() / (float)0x3fffffff )-1.0f) |
| #define | CCRANDOM_0_1() ((random() / (float)0x7fffffff )) |
| #define | CC_DEGREES_TO_RADIANS(__ANGLE__) ((__ANGLE__) * 0.01745329252f) |
| #define | CC_RADIANS_TO_DEGREES(__ANGLE__) ((__ANGLE__) * 57.29577951f) |
| #define | CC_BLEND_SRC GL_ONE |
| #define | CC_ENABLE_DEFAULT_GL_STATES() |
| #define | CC_DISABLE_DEFAULT_GL_STATES() |
| #define | CC_DIRECTOR_END() |
| #define | CC_CONTENT_SCALE_FACTOR() 1 |
cocos2d helper macros
Definition in file ccMacros.h.
| #define CC_BLEND_SRC GL_ONE |
default gl blend src function. Compatible with premultiplied alpha images.
Definition at line 101 of file ccMacros.h.
| #define CC_CONTENT_SCALE_FACTOR | ( | ) | 1 |
RETINA DISPLAY DISABLED
Definition at line 249 of file ccMacros.h.
| #define CC_DEGREES_TO_RADIANS | ( | __ANGLE__ | ) | ((__ANGLE__) * 0.01745329252f) |
converts degrees to radians
Definition at line 90 of file ccMacros.h.
| #define CC_DIRECTOR_END | ( | ) |
do { \ CCDirector *__director = [CCDirector sharedDirector]; \ CC_GLVIEW *__view = [__director openGLView]; \ [__view removeFromSuperview]; \ [__director end]; \ } while(0)
Stops and removes the director from memory. Removes the EAGLView from its parent
Definition at line 206 of file ccMacros.h.
| #define CC_DISABLE_DEFAULT_GL_STATES | ( | ) |
{ \
glDisable(GL_TEXTURE_2D); \
glDisableClientState(GL_TEXTURE_COORD_ARRAY); \
glDisableClientState(GL_COLOR_ARRAY); \
glDisableClientState(GL_VERTEX_ARRAY); \
}
Disable default GL states:
Definition at line 129 of file ccMacros.h.
| #define CC_ENABLE_DEFAULT_GL_STATES | ( | ) |
{ \
glEnableClientState(GL_VERTEX_ARRAY); \
glEnableClientState(GL_COLOR_ARRAY); \
glEnableClientState(GL_TEXTURE_COORD_ARRAY); \
glEnable(GL_TEXTURE_2D); \
}
GL states that are enabled:
Definition at line 115 of file ccMacros.h.
| #define CC_RADIANS_TO_DEGREES | ( | __ANGLE__ | ) | ((__ANGLE__) * 57.29577951f) |
converts radians to degrees
Definition at line 95 of file ccMacros.h.
| #define CC_SWAP | ( | x, | |
| y | |||
| ) |
({ __typeof__(x) temp = (x); \
x = y; y = temp; \
})
simple macro that swaps 2 variables
Definition at line 71 of file ccMacros.h.
| #define CCRANDOM_0_1 | ( | ) | ((random() / (float)0x7fffffff )) |
returns a random float between 0 and 1
Definition at line 85 of file ccMacros.h.
| #define CCRANDOM_MINUS1_1 | ( | ) | ((random() / (float)0x3fffffff )-1.0f) |
returns a random float between -1 and 1
Definition at line 80 of file ccMacros.h.