Alternative for obsolete OpenGL calls?
gerchicov-bp opened this issue · 0 comments
gerchicov-bp commented
http://2sa-studio.blogspot.com/2014/05/soft-bodies-with-cocos2d-v3.html
That example still works except of this code:
// Draw the triangle fan
CC_NODE_DRAW_SETUP();
ccGLBlendFunc(self.blendFunc.src, self.blendFunc.dst);
ccGLBindTexture2D(self.texture.name);
ccGLEnableVertexAttribs( kCCVertexAttribFlag_PosColorTex );
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, texCoords);
glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_FLOAT, GL_TRUE, 0, colors);
glDrawArrays(GL_TRIANGLE_FAN, 0, (GLsizei)nVertices);
How to replace it in current cocos2d version?