Image pooling

63 views
Skip to first unread message

MJ

unread,
Jun 14, 2014, 10:59:00 AM6/14/14
to haxe...@googlegroups.com
Hello,
What is the best way to create 500 images in an Image pool for re-use ? If created objects as Bitmapdata I can't change widht/height on the same object

Hugh

unread,
Jun 16, 2014, 1:04:12 AM6/16/14
to haxe...@googlegroups.com

If you are changing the width/height, then the bitmaps are not suitable for pooling.  The idea of the pool is to save allocation costs, but a resize requires an allocation.

I guess you should dospose() your oldest one, and create a new one for your pool.  Probably better to keep track of total number of pixels, rather than image count, so you might have 500 small images or 10 big ones.  

Hugh

MJ

unread,
Jun 16, 2014, 2:25:15 AM6/16/14
to haxe...@googlegroups.com
Thank you for you reply Hugh .
I'll try some things.
Reply all
Reply to author
Forward
0 new messages