Blitting BG cut fps in half
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?
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.
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.
[ Odyssey Project ]
It also sounds like vsync is on, it depends on the version of Dx you''re using, but there''s a flag to set that disables vsync.
Magmai Kai Holmlor
- Not For Rent
Magmai Kai Holmlor
- Not For Rent
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement