2

在 800x600 屏幕上的随机位置上渲染几十张 16x16 位图数万次的最快方法是什么?

1) 使用 CopyPixel() 将每个精灵 blit 到 800*600 屏幕缓冲区?当然,在屏幕缓冲区上调用 unlock()、lock()。

2) 使用炼金术?在 c++ 端创建一个 uint* screenBuffer = new uint[800*600]; 并创建许多: uint* spriteBmp = new uint[16*16]; 并将每个 spriteBmp 复制到 screenBuffer 中的数千个 (x,y) 位置?

3)像素弯曲?

此外,我很好奇哪种方法可以潜在地使用硬件渲染。即,如果 1) 和 3) 可以利用用户图形卡,它们应该比我使用 2) 创建的任何软件光栅化器快很多。

我不需要对每个 bmp 进行缩放或旋转,但我想知道它们是否会破坏为屏幕对齐位图所做的任何 as3 API 优化。

谢谢

4

1 回答 1

0

Have you tried Starling? It's a free library that uses the GPU!

You can really render huge amount of bitmaps using the GPU.

btw: If you use the same bitmap, it'll be even faster!

于 2012-08-01T14:36:43.707 回答