mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 19:22:49 +01:00
graphics: Calc capacity of vertices
This commit is contained in:
parent
fb4ac5cd56
commit
fbf6b6c525
@ -126,7 +126,14 @@ func (q *commandQueue) Flush(context *opengl.Context) error {
|
|||||||
// glViewport must be called at least at every frame on iOS.
|
// glViewport must be called at least at every frame on iOS.
|
||||||
context.ResetViewportSize()
|
context.ResetViewportSize()
|
||||||
for _, g := range q.commandGroups() {
|
for _, g := range q.commandGroups() {
|
||||||
vertices := []int16{}
|
n := 0
|
||||||
|
for _, c := range g {
|
||||||
|
switch c := c.(type) {
|
||||||
|
case *drawImageCommand:
|
||||||
|
n += len(c.vertices)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vertices := make([]int16, 0, n)
|
||||||
for _, c := range g {
|
for _, c := range g {
|
||||||
switch c := c.(type) {
|
switch c := c.(type) {
|
||||||
case *drawImageCommand:
|
case *drawImageCommand:
|
||||||
|
Loading…
Reference in New Issue
Block a user