glenableclientstate is depreciated
VAO创建好后,我所知道的有三种绑定方法。
第一种在opengl4.0z中看到,psm也是这么做的,优点是清晰。
先在shader创建好之后绑定shader顶点输入属性
// Bind index 0 to the shader input variable "VertexPosition"
glBindAttribLocation(programHandle, 0, "VertexPosition");
// Bind index 1 to the shader input variable "VertexColor"
glBindAttribLocation(programHandle, 1, "VertexColor");
然后创建若干个vbo,每个vbo对应一个顶点属性,
// Create the buffer objects
GLuint vbo......
阅读全文