~smspillaz/compiz/compiz.animationjc-returns

Viewing all changes in revision 4013.

  • Committer: smspillaz at gmail
  • Date: 2016-05-23 15:29:12 UTC
  • Revision ID: smspillaz@gmail.com-20160523152912-rglpj54t81kf5atz
vertexbuffer: Add ability to render vertices indirectly

For the longest time, there was no equavilent to glDrawElements
in the GLVertexBuffer class, which made porting other plugins
a lot more work than it needed to be.

This change adds the *indices and nIndices paramters to the
render () method of GLVertexBuffer. If indices is non-null, then
GLVertexBuffer will render using glDrawElements instead of
glDrawArrays, rendering the vertices in the order specified
by indices.

Note that in this case, the order that vertices are added
to addVertexData matters - a two-triangle quad needs to
be added as v0, v1, v2, v3 as opposed to v0, v1, v2, v0, v3, v2
where indices of 0 1 2, 0 3 2 are used.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: