Skip to main content
GameDev.net gamedev.net
🔒 Locked

[SDL] 1 Large Surface or Seperate Surfaces

Started by Turt99 Oct 7, 2009 at 7:10 AM 1 replies 700+ views
Original Post
Turt99
Turt99
I've seen a bunch of tools that will take your sprite files and combine them into 1 large file. Is there a benefit to having all your graphics stored in 1 file and loaded to a single surface rather then using seperate files and seperate surfaces. I'm using SDL and 2D sprites.
FOLLOW ME ON TWITTER OR MY BLOG
samuraicrow
samuraicrow
The advantages to having 1 large sprite sheet compared to individual sprites include:
  • taking less time to load and decompress the images

  • being able to upload all of the textures to the graphics card for hardware accelerated blitting in one long burst rather than many small ones (burst fetching is faster than random access of memory)

  • better use of memory chunks (oftentimes the page size of the MMU in the processor is 4k and refuses to deal with smaller chunks of memory than that, meaning that using a lot of small surfaces wastes memory)


Almost all of the advantages of using small surfaces are gone in today's operating systems.
Turt99
Turt99
Thanks for the reply, I did some more research myself and I think I'm going to rework my game a little to use larger sprite sheets, it should make it easier to track things when they are all in one place.
FOLLOW ME ON TWITTER OR MY BLOG

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.