cocos2d-objc icon indicating copy to clipboard operation
cocos2d-objc copied to clipboard

Alternative for obsolete OpenGL calls?

Open gerchicov-bp opened this issue 6 years ago • 0 comments

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?

gerchicov-bp avatar May 29 '19 13:05 gerchicov-bp