forked from enlightenment/efl
test_glview_simple: opimize draw code.
Summary: There is no need to call glVertexAttribPointer & glEnableVertexAttribArray() while rendering. Reviewers: seoz, jpeg, Hermet Reviewed By: Hermet Subscribers: seoz Differential Revision: https://phab.enlightenment.org/D1827
This commit is contained in:
parent
19d6ed361c
commit
2ba1640a00
|
@ -134,7 +134,10 @@ _init_gl(Evas_Object *obj)
|
|||
|
||||
gl->glGenBuffers(1, &gld->vbo);
|
||||
gl->glBindBuffer(GL_ARRAY_BUFFER, gld->vbo);
|
||||
gl->glBufferData(GL_ARRAY_BUFFER, 3 * 3 * 4, vVertices, GL_STATIC_DRAW);
|
||||
gl->glBufferData(GL_ARRAY_BUFFER, sizeof(vVertices), vVertices, GL_STATIC_DRAW);
|
||||
gl->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE,
|
||||
0, 0);
|
||||
gl->glEnableVertexAttribArray(0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -190,9 +193,6 @@ _draw_gl(Evas_Object *obj)
|
|||
gl->glUseProgram(gld->program);
|
||||
|
||||
gl->glBindBuffer(GL_ARRAY_BUFFER, gld->vbo);
|
||||
gl->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE,
|
||||
0, 0);
|
||||
gl->glEnableVertexAttribArray(0);
|
||||
|
||||
gl->glDrawArrays(GL_TRIANGLES, 0, 3);
|
||||
|
||||
|
|
Loading…
Reference in New Issue