Skip to content
Snippets Groups Projects
Commit c23446fb authored by faiface's avatar faiface
Browse files

improve sprite.Draw(batch) benchmark

parent 578ae8fa
Loading
package pixel_test
import (
"image"
"testing"
"github.com/faiface/pixel"
)
func BenchmarkSpriteDrawBatch(b *testing.B) {
sprite := pixel.NewSprite(nil, pixel.R(0, 0, 64, 64))
batch := pixel.NewBatch(&pixel.TrianglesData{}, nil)
img := image.NewRGBA(image.Rect(0, 0, 64, 64))
pic := pixel.PictureDataFromImage(img)
sprite := pixel.NewSprite(pic, pixel.R(0, 0, 64, 64))
batch := pixel.NewBatch(&pixel.TrianglesData{}, pic)
for i := 0; i < b.N; i++ {
sprite.Draw(batch, pixel.IM)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment