mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +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,
|
||||
colorM: color,
|
||||
}
|
||||
p.begin()
|
||||
defer p.end()
|
||||
n := quads.SetVertices(vertices)
|
||||
if n == 0 {
|
||||
return nil
|
||||
}
|
||||
p.begin()
|
||||
defer p.end()
|
||||
c.BufferSubData(c.ArrayBuffer, vertices[:16*n])
|
||||
c.DrawElements(c.Triangles, 6*n)
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user