diff --git a/gltriangles.go b/gltriangles.go index 2665aed22005b32636d7fae662ccee6c5897b422..73654dd1b042e02e39f27d676b0ec2238773a65d 100644 --- a/gltriangles.go +++ b/gltriangles.go @@ -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 diff --git a/graphics.go b/graphics.go index 637ea4e75134faaca32fc79fe81eec5feb1f3927..85c5a263de3854678cc740717d4a968606bde42d 100644 --- a/graphics.go +++ b/graphics.go @@ -130,6 +130,7 @@ func (td *TrianglesDrawer) flush() { td.dirty = false for _, t := range td.tris { + t.SetLen(td.Len()) t.Update(td.Triangles) } }