This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Matrix4 | |
{ | |
mult(const Matrix4& other) { | |
#if defined(CC_PLATFORM_IOS) || defined(CC_PLATFORM_MAC) | |
GLKMatrix4Multiply(...); | |
#elif defined(CC_PLATFORM_ANDROID) && defined(__ARMV7__) | |
// Use ne10 library | |
ne10XXXXX(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation HelloWorldLayer | |
// on "init" you need to initialize your instance | |
-(id) init | |
{ | |
// always call "super" init | |
// Apple recommends to re-assign "self" with the "super's" return value | |
if( (self=[super init]) ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone git://github.com/cocos2d/cocos2d-html5.git | |
$ cd cocos2d-html5 | |
$ git submodule update --init | |
$ python -m SimpleHTTPServer | |
... and run a brower and open it in localhost:8000/tests | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// cocos2d constants | |
// | |
cc.DIRECTOR_PROJECTION_2D = 0; | |
cc.DIRECTOR_PROJECTION_3D = 1; | |
cc.TEXTURE_PIXELFORMAT_RGBA8888 = 0; | |
cc.TEXTURE_PIXELFORMAT_RGB888 = 1; | |
cc.TEXTURE_PIXELFORMAT_RGB565 = 2; | |
cc.TEXTURE_PIXELFORMAT_A8 = 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define CCARRAY_FOREACH(__array__, __object__) \ | |
if (__array__ && __array__->data->num > 0) \ | |
for(id *arr = __array__->data->arr, *end = __array__->data->arr + __array__->data->num-1; \ | |
arr <= end && ((__object__ = *arr) != nil || true); \ | |
arr++) |
NewerOlder