Skip to content

Alternative for obsolete OpenGL calls? #1398

Open
@gerchicov-bp

Description

@gerchicov-bp

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions