Iām not arguing in favor of someone using Cocos2d-x. We use other engines/frameworks for certain projects now. Iām also not arguing against using libGDX. Especially since I have no experience with it.
However, I thought Iād drop my 2c here:
If you use a SpriteBatchNode you can draw ~15000 bunnies on an iPhone 6 Plus @ 60fps (16ms frame time) and around and ~25K @ 30fps (33ms). Using SpriteBatchNode or the more āmodernā TriangleCommand to render this many sprites is essential and its usage is confirmed within the forums as well as by looking inside the particle rendering and management systems.
In Init
#if defined(USE_SPRITE_BATCH)
bunnyBatch = SpriteBatchNode::create(filename); // class member
bunnySprite = Sprite::createWithTexture(bunnyBatch->getTexture());
addChild(bunnyBatch);
#else
bunnySprite = Sprite::create(filename);
#endif
In moreBunnies
#if defined(USE_SPRITE_BATCH)
bunnyBatch->addChild(bunny.sprite);
#else
this->addChild(bunny.sprite);
#endif
I have written off libGDX in the past because of Java, but have since dabbled in Scala and Closure and might be fun to give it a go in a future prototype or gamejam as a first use.
One thing I didnāt realize about libGDX and found interesting, but not surprising based on its performance, was that it actually uses a lot of c++ underneath. You could argue that libGDX is more like cocos2d-x + Lua than it is a pure Java framework/engine. Thatās where it gets a lot of its performance, which is smart.
Every engine/framework has their pros/cons and their default usage (texture āblitsā, render commands, scene graphs, components, etc). Cocos2d-x could also definitely use a few versions that only merge in performance improvement PRs.
Cocos2d-xās Node/Sprite classes contain a lot of excess data which could be trimmed or re-architected. Ideally cocos2d-x v4 would incorporate a lower-level API more similar to libGDX along with a scene graph API and a component API. Iām not sure weāll see a lot of improvement quickly enough, however
p.s. you should probably remove I/O ( e.g. printf ) within inner loops of benchmarks ā¦?