Archived

This topic is now archived and is closed to further replies.

Blitting BG cut fps in half

This topic is 5976 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m running my game in 800x600 32bit. I use a 800x600 32bit bitmap data for a background. When running the game without blitting the background in fullscreen I get about 60-62 fps. When I blit the background however I only get abou 30-32 fps. How do professional game developers do this and get maximun performance?

Share this post


Link to post
Share on other sites
They might use what''s called a ''dirty-rectangle'' system... kind of like event-driven programs rather than procedural: you only change game data (i.e. the background) if it''s supposed to change.

André Lamothe''s books explain how to do this... the effect generally is:

- blit previous dest-rect info to current-rect
- grab dest-rect image data
- blit sprite to dest-rect

Essentially, a clear-copy-move system. Otherwise, rendering to the entire frame-buffer every frame will slow your system down considerably. If you create a hardware DirectDraw interface you shouldn''t get this slowdown though... but you need to comprimise. Generally, if you''re using hardware-only, keep everything in hardware, blit every frame, and don''t perform video memory reads. If using a software rendering system, do all work in software, use the above system (clear-copy-move) in system memory, then send completed data to hardware for rendering.

Share this post


Link to post
Share on other sites