const char *vertexShaderSource = "#version 330 core " "layout (location = 1) in vec3 aPos; " "void main() " "{ " " gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); " "} ";
glEnableVertexAttribArray(1);
这个1和上面的location = 1 对应
参考:
OPENGL学习笔记之glEnableVertexAttribArray函数