PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Surface sizes?

If I have a tile-based map, would it be a better idea to blit the map to a surface once at startup and then blit part of this bigger image to the backbuffer instead of blitting tile by tile, each frame?

If so, is there a way to know how much a surface of a certain size occupies? In other words, can I prerender my whole map (suppose its 8000x8000) or would it be better to split it up and only prerender part of it?

I am using gapidraw.net if this is of any importance.
You'll be using up a ton of memory if you BLT the entire map to a temp surface. Depending on the number of layers you're drawing, you should have no trouble staying above 30 fps if you draw your map as needed.
I just created a 5000x5000 image in Paint Shop Pro, 75DPI, 256 colors... It says that uncompressed it's 25,001,176 bytes.

I suggest drawing your tiles as you go as well :)

Incidentally, part of my current game is a tile-based scrolling map, full-screen, and I draw it real-time. No frame rate problems whatsoever, and I'm far from the most efficient coder around.