opengles 2.0 VBO提交数据

opengles 2.0 VBO提交数据_第1张图片

- (void)setupVBOs {

    

    GLuint vertexBuffer;

    glGenBuffers(1, &vertexBuffer);

    glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);

    glBufferData(GL_ARRAY_BUFFER, sizeof(Vertexs), Vertexs, GL_STATIC_DRAW);

    

    GLuint indexBuffer;

    glGenBuffers(1, &indexBuffer);

    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);

    glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(Indices), Indices, GL_STATIC_DRAW);

    

}


范例工程:

LxOpenglES_VBO.zip

你可能感兴趣的:(C/C++,opengl,es)