Bug fix: initial capacity of vertices

This commit is contained in:
Hajime Hoshi 2015-01-03 16:25:17 +09:00
parent f80850ef14
commit abed162e91

View File

@ -73,7 +73,7 @@ func DrawTexture(c *opengl.Context, texture opengl.Texture, projectionMatrix *[4
c.VertexAttribPointer(program, "vertex", stride, uintptr(float32Size*0))
c.VertexAttribPointer(program, "tex_coord", stride, uintptr(float32Size*2))
vertices := make([]float32, 0, quads.Len())
vertices := make([]float32, 0, stride*quads.Len())
for i := 0; i < quads.Len(); i++ {
x0, y0, x1, y1 := quads.Vertex(i)
u0, v0, u1, v1 := quads.Texture(i)