How to render multicolor triangles

How to render multicolor triangles
0.0 0



I’m investigantion of how to render triangles which have different colors for each vertex.
I know that I should use shaders and I assume I should do some direct OpenGL calls. I tried to find how to render triangles in CCSprite but I lost somewhere at the middle of the process. :slight_smile: Could you help me and show an example of how to render such rect (like on the attached picture) stretched to full screen size?

Thank you.

I’m using cocos2d-x 2.1.1, MacOS X 1.6, XCode 4.5.

triangles.png (66.1 KB)