Question on SDL and Tile Sheets

Started by
2 comments, last by Zakwayda 12 years, 11 months ago
Alright just a quick question here.

When using SDL and using a tile sheet, when you choose to use only the one tile from the whole sheet for a part of your game, does it have to find memory for the WHOLE tile sheet when your only blitting a small section of it, or does it know to find a space memory for that small section and forget the rest?

Just wondering, i know if so it's probably not that big of a deal but i was just curious.
Advertisement
Are you talking about software blitting, or hardware-accelerated rendering?
Well in either case really, it would be good to know what both do specifically in this situation.
I'm not sure if I understand the question completely, but generally speaking, whether you blit or render an entire image or only a portion of it will not affect how much memory is used.

With software blitting, typically you'd load the tile sheet into memory, and then blit parts of it to the screen as needed; what portions of the tile sheet you actually use won't affect memory consumption.

With hardware-accelerated rendering, the situation is similar, except that the tile sheet will likely be a texture, and what parts are rendered will be determined by the texture coordinates used.

Of course you can load and unload different tile sheets as needed, which may have an effect on how much memory is being used.

This topic is closed to new replies.

Advertisement