fix TrianglesDrawer flush (SetLen)

This commit is contained in:
faiface 2017-02-03 02:09:06 +01:00
parent 0771f07888
commit 7a8967c9d1
2 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,7 @@ import (
// NewGLTriangles returns OpenGL triangles implemented using pixelgl.VertexSlice. A few notes.
//
// Triangles returned from this function support TrianglesPosition, TrianglesColor and
// TrianglesTexture. If you need to support more, you can "override" Update and Append method.
// TrianglesTexture. If you need to support more, you can "override" SetLen and Update method.
//
// Draw method simply draws the underlying pixelgl.VertexSlice. It needs to be called in the main
// thread manually. Also, you need to take care of additional Target initialization or setting of

View File

@ -130,6 +130,7 @@ func (td *TrianglesDrawer) flush() {
td.dirty = false
for _, t := range td.tris {
t.SetLen(td.Len())
t.Update(td.Triangles)
}
}