From d87c339a0812827489ac2fe0670bb9edc65494ff Mon Sep 17 00:00:00 2001 From: hyzboy Date: Fri, 7 Dec 2018 16:43:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3BindVBO2VAO=E4=B8=AD=E7=9A=84?= =?UTF-8?q?bug=EF=BC=8C=E5=B9=B6=E5=9C=A8windows=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/DirectGLRender/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/DirectGLRender/main.cpp b/example/DirectGLRender/main.cpp index 262368b4..790091e5 100644 --- a/example/DirectGLRender/main.cpp +++ b/example/DirectGLRender/main.cpp @@ -70,13 +70,13 @@ void BindVBO2VAO(const int vao,const int binding_index,const int shader_location glVertexArrayAttribBinding(vao,shader_location,binding_index); glVertexArrayAttribFormat(vao,shader_location,vb->GetComponent(),vb->GetDataType(),GL_FALSE,0); glEnableVertexArrayAttrib(vao,shader_location); - glVertexArrayVertexBuffer(vao,shader_location,vb->GetBufferIndex(),0,vb->GetStride()); + glVertexArrayVertexBuffer(vao,binding_index,vb->GetBufferIndex(),0,vb->GetStride()); } void InitVertexBuffer() { - vb_vertex=new VB2f(4,vertex_data); - vb_color=new VB3f(4,color_data); + vb_vertex=new VB2f(3,vertex_data); + vb_color=new VB3f(3,color_data); va=new VertexArray(GL_TRIANGLES, //画三角形 2); //两个属性