[Mesa-dev] [Piglit] [PATCH] Add a simple testcase to test that GL_ELEMENT_ARRAY_BUFFER is per vao
Yuanhan Liu
yuanhan.liu at linux.intel.com
Wed Nov 23 17:32:01 PST 2011
On Wed, Nov 23, 2011 at 08:33:00AM -0700, Brian Paul wrote:
> On 11/23/2011 02:34 AM, Yuanhan Liu wrote:
> >+ GLuint element;
> >+ GLfloat vertics[] = {
>
> minor nit: s/vertics/vertices/
>
>
> >+ -1, -1, 0,
> >+ 1, -1, 0,
> >+ 1, 1, 0,
> >+ -1, 1, 0,
> >+ };
> >+ GLubyte indics[] = {0, 1, 2, 3};
>
> and s/indics/indices/
Sorry for the typos, will fix it in the next patch.
Thanks,
Yuanhan Liu
>
>
> >+
> >+ piglit_require_extension("GL_ARB_vertex_array_object");
> >+
> >+ glClearColor(0, 0, 0, 1);
> >+
> >+ glGenBuffers(1,&vbo);
> >+ glGenBuffers(1,&element);
> >+
> >+ glGenVertexArrays(1,&vao);
> >+ glBindVertexArray(vao);
> >+
> >+ glBindBuffer(GL_ARRAY_BUFFER, vbo);
> >+ glBufferData(GL_ARRAY_BUFFER, sizeof(vertics), vertics, GL_STATIC_DRAW);
> >+ glVertexPointer(3, GL_FLOAT, 0, NULL);
> >+ glEnableClientState(GL_VERTEX_ARRAY);
> >+
> >+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, element);
> >+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indics), indics, GL_STATIC_DRAW);
> >+
> >+ glBindVertexArray(0);
> >+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
> >+}
>
> Looks good otherwise.
>
> Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list