I’m new to C++ and I would like to know if this is the right way to allocate/deallocate cocoS2d-x objects. Note that I’ve commented
image->release(); because I had a linker error about it. Not sure if it’s because I’m not supposed to release an image or if I have a config problem (using cocos2d-x v1 on xCode 4.3).
CCImage *image=new CCImage();
CCTexture2D texture=new CCTexture2D;
CCSprite pSprite = CCSprite::spriteWithTexture;
// position the sprite on the center of the screen
// add the sprite as a child to this layer