Reputation: 151
What's the fastest way to render a few dozen 16x16 bitmaps tens of thousand times at random locations on a 800x600 screen?
1) Use CopyPixel() to blit each sprite to the 800*600 screen buffer? Of course, call unlock(), lock() on the screen buffer.
2) Using Alchemy? At c++ side create a uint* screenBuffer = new uint[800*600]; and create many: uint* spriteBmp = new uint[16*16]; And copy each spriteBmp to thousands of (x,y) locations in screenBuffer?
3) Pixel bender?
Additionally I'm curious which method can potentially use hardware rendering. I.e., if 1) and 3) can take advantage of user graphics cards, they should be magnitudes faster than any software rasterizer I create with 2).
I don't need scaling or rotation on each bmp, but I do wonder if they would break any as3 API optimizations made for screen aligned bitmaps.
Thanks
Upvotes: 2
Views: 785