Nate wroteAh, so I got my runtime implementations confused. spine-cocos2dx is using PolygonBatch to batch geometry and this is flushed per skeleton. In a scene graph like cocos2d-x, batching can be difficult. Typically some built-in mechanism is used for rendering. This provides a single place for the framework to know when texture changes occur so it can batch across scene graph nodes.
At the time we wrote the runtime, there did not appear to be a suitable API. Do you know if there is way for the framework to do the rendering? Does cocos2d-x still parallel cocos2d-iphone? I thought I read they had started to diverge some time ago. FWIW, cocos2d-iphone does have such an API.
Yes, right. I come from using cocos2d-iPhone and I know it works just fine there. You're also right about the two cocos2d-versions diverging some time ago. Basically when they did, I went to cocos2d-x. There was a lot of drama and the main developer and founder of cocos2d-iPhone is now working on cocos2d-x (along other things happening). They even split cocos2d-iphone into another two versions....so basically there's no real hope for any of these iphone versions in the near future....
But back to topic, cocos2d-x also has some kind of dynamic batching which is based on the scene graph. If you add two sprites from the same texture to the scene, they get batched dynamically. It also works for BitmapFont labels, etc. Though I'm still fairly new to cocos2d-x, so I don't know yet how it works exactly.
This guy here (kind of) explains how the cocos2d-x dynamic batching works, but the links for further explanations are down:
http://discuss.cocos2d-x.org/t/cocos2d-x-3-batch-drawing-explained/15282/5
If this is not enough to understand, maybe you could ask in the cocos2d-x forums how the batching would be handled best for Spine. I tried myself asking the question there, but got no response at all. Since they know you, you've probably got better chances then me, getting a helpful answer π
Nate wroteAs an alternative to "dynamic" batching performed by the framework, batching can also be done with an interesting trick. When a scene graph node is added to the batch, it also adds any adjacent nodes to the batch and marks them as "batched" so they don't try to draw when it's their turn.
This sounds interesting, too - though I don't quite understand how it would work in our case. Would one PolygonBatch render all of the Skeletons?
I guess the best way to do it, is the way with the best performance outcome. What do you think which way this would be?