One surface or many?

Started by
4 comments, last by Gav 24 years, 2 months ago
When using DirectDraw, is it preferable to use one large surface to hold all the sprites on, or a different surface for each different sprite? Different surfaces would be easier to manage but is it as/more efficient than using one surface? No sense being pessimistic. It wouldn''t work anyway.
===========================There are 10 types of people in the world. Those that understand binary and those that don't.( My views in no way reflect the views of my employer. )
Advertisement
I dont think it matters that much, as long you dont store each frame of each sprite in a seperate surface. The advantage of using big surfaces is just that they save _some_ memory, i dont know how much exactly but i dont think its that much. Also, as you said, having one surface for each sprite is much easier to handle, this is how i do it (i think this is the way most of us do actually).
The bigger the surfaces are, the more is DDraw not able to handle ''em in the best way, but the more Surfaces you have, the more speed gets lost. You should look for the best way for your program. (For example: Store all Bitmaps of one Object in a single surface)

BYE
I think the surface containing the sprites should not be to large. If it won''t fit in the display memory, DirectX will place it in the system memory, which is much slower as we know. So smaller surfaces are preferable, since more of them can be placed in the display memory.

PmpCh
That''s in theory, but If you need x sprites to make up object player, then it would probably be best to put all of x sprites for player on one surface, if you made a lot of smaller surfaces, it would take up just as much room, if not more. Personally, I like putting all my frames for an object on one large surface, since the object is going to need them anyway, but that''s just me.
Write more poetry.http://www.Me-Zine.org
Mix the two thats the best way ive seen yet. For an example currently I have a object that comes in 8 differnt colors,Do i put them all on one bitmap? NO. Reason why in the game you will at best see only 2 differnt versions of that object. Which means i can load the 2 that are needed into video memory instead of having to try an waste memory for 8 of them.Tiles i would say go ahead and put on one bitmap(If your using sets of tiles,otherwise try an load only the ones that are gonna be in that specific level,ect instead of all of them.)

This topic is closed to new replies.

Advertisement