简体   繁体   中英

How can I create simple 2d graphics with decent frames per second?

I tried to make a spinning hand when I found bitblt takes on average 33 ms to draw the hand each time, this is just one image. When a game draws a screen full of stuff I'd assume it would take longer then the simple bitblt method drawing a small picture on the screen but I guess not.

What common/popular methods exist that I could use to create simple 2d graphics such as drawing an image from a file that take much less time to execute then bitblt?

How can I create simple 2d graphics with decent frames per second?

Use hardware acceleration via OpenGL/DirectX. You should be able to easily get at least 300 (and up to 2000) frames per second, if vsync is disabled.

However, size of image matters. The bigger is your image, the slower is the drawing. Blitting large 2D image onto screen can kill framerate on some GPUs.

Also see this question .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM