Batch of DrawNodes

Hi!

First, thank you all for making cocos2d-x possible. It’s awesome!
I’d want to know if it’s possible to create a batch of DrawNode (or CCDrawNode) objects to draw a lot of primitives with a single draw call.

Thanks!

Take a look at CCSpriteBatchNode / SpriteBatchNode.

The only object that a CCSpriteBatchNode accepts as child is CCSprite nodes, so it shouldn’t work for CCDrawNodes.

There’s no easy way to batch these type of nodes?

In cocos2d-x 3.0 Sprite nodes can be batched automatically.
This is also true for DrawNodes?

Oh, I’m sorry, I missed that you’re asking about CCDrawNode * facepalm *.
Actually CCDrawNode is itself a batch of primitives which are being drawn in a single draw call.

But I’ve got an unpleasant experience using CCDrawNode (eventually I had to refuse them): http://www.cocos2d-x.org/forums/6/topics/39305

I know that a single CCDrawNode can batch a lot of primitives, but what i’d like to do is to batch two or more CCDrawNodes in a single call (like CCSpriteBatchNode does with CCSprite).

I’ve read that CCDrawNode can be slower than drawing primitives because CCDrawNode applies antialias, but I haven’t tested it.

Anyway, thanks for your answer :slight_smile: