mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
graphics: Early return when num of vertices is 0
This commit is contained in:
parent
c3d8cf2366
commit
492f471ec3
@ -66,12 +66,12 @@ func drawTexture(c *opengl.Context, texture opengl.Texture, projectionMatrix *[4
|
|||||||
geoM: geo,
|
geoM: geo,
|
||||||
colorM: color,
|
colorM: color,
|
||||||
}
|
}
|
||||||
p.begin()
|
|
||||||
defer p.end()
|
|
||||||
n := quads.SetVertices(vertices)
|
n := quads.SetVertices(vertices)
|
||||||
if n == 0 {
|
if n == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
p.begin()
|
||||||
|
defer p.end()
|
||||||
c.BufferSubData(c.ArrayBuffer, vertices[:16*n])
|
c.BufferSubData(c.ArrayBuffer, vertices[:16*n])
|
||||||
c.DrawElements(c.Triangles, 6*n)
|
c.DrawElements(c.Triangles, 6*n)
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user