I have finally managed to make it work on iOS devices with the following code based on the primitives test. Here's the .h:
class Circle : public cocos2d::Layer
void onDrawPrimitives(const kmMat4 &transform, bool transformUpdated);
virtual void draw(cocos2d::Renderer *renderer, const kmMat4 &transform, bool transformUpdated) override;
And the cpp:
void Circle::onDrawPrimitives(const kmMat4 &transform, bool transformUpdated)
Size visibleSize = Director::getInstance()->getVisibleSize();
color4B(255, 0, 255, 255);
DrawPrimitives::drawSolidCircle(Point(visibleSize.width/2, visibleSize.height/2), 60, 0, 30, 1, 1);
void Circle::draw(Renderer *renderer, const kmMat4& transform, bool transformUpdated)
_customCommand.func = CC_CALLBACK_0(Circle::onDrawPrimitives, this, transform, transformUpdated);
I'm almost hitting a point where I will either #if #elif this to use drawnode or my custom layer class depending on the platform, since the shader modification does the job on a Mac and Android.
Even though I'm not very experienced in Cocos2d-x or OpenGL, I would greatly appreciate some insight to answer this question.