Archived

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

dynamic size surface

This topic is 5046 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 want to display "national borders" on a 2D tilemap. Each border unit is one tile wide and can face either NORTH, SOUTH, EAST, or WEST. My current code blits each tile to the backbuffer individually, cuasing the backbuffer to be locked, blitted to, and unlocked hundreds of times. Is there a more efficient way of blitting to the backbuffer fewer times? Perhaps some sort of matrix could store the border information, create a DD surface basedo n this information, and then blit solely this surface to the backbuffer?

Share this post


Link to post
Share on other sites
Can''t you just do this:

Lock Buffer
For each tile
Blt tile to buffer
Unlock buffer

Or even generate a seperate buffer in memory, made up of the border tiles, then blit the full thing to the backbuffer, although this would mean the full size of the buffer would need to be copied, whereas a lot less data would have to be transfered if you copy each individual tile.

---------------------------------------

Let''s struggle for our dream of Game!

http://andrewporritt.4t.com

Share this post


Link to post
Share on other sites
Well, I guess the question is what would be more efficient:
Blitting less data many times, or blitting more data once. Assuming that the rest of the surface, in the latter case, is viewed as transparent, does that mean that the data will be completely disregarded, or does that just mean that it looks at the data and decides not to blit it? If it disregards the data completely, then it may make sense if I did waht you suggest, and just blit once...

Share this post


Link to post
Share on other sites