You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Look at batch.go#L82 and canvas.go#L73
All MakePicture methods return new TargetPicture instances.
Also every Sprite caches a TargetPicture.
So, does that means, for 10k Sprites created from a single Picture, pixel creates 10k TargetPictures?
That sounds very inefficient!
The text was updated successfully, but these errors were encountered:
Yep, means exactly that! This can be efficient or inefficient based on what target you're using. If you're drawing directly to the window, then yes, this will be rather inefficient, because a new OpenGL texture will be allocated for each picture. However, if you use Batch, it will be very efficient because TargetPicture for Batch is just a struct of two pointers and the Batch only makes one TargetPicture from its own target (e.g. window).
Look at batch.go#L82 and canvas.go#L73
All MakePicture methods return new TargetPicture instances.
Also every Sprite caches a TargetPicture.
So, does that means, for 10k Sprites created from a single Picture, pixel creates 10k TargetPictures?
That sounds very inefficient!
The text was updated successfully, but these errors were encountered: