Jump to content
  • Advertisement
Sign in to follow this  
Just Chris

Encoded images

This topic is 4609 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

Are there any APIs for making 2D games that package the visual assets of the game (all the images that make up the game graphics) into encoded files? I don't know for anyone else but to me it feels 'unprofessional' to leave the images open for viewing outside of the game. I don't know if SDL can work with encoded image file formats such as .raw.

Share this post


Link to post
Share on other sites
Advertisement
The easiest way not to leave the images open is to simply zip them together and use a library like PhysFS (which includes SDL RWops bindings) to access the archive. You don't need to leave the name of the archive as .zip, but can use some arbitrary extension.

Share this post


Link to post
Share on other sites
There's also a great tutorial on the home page of gamedev right now on using zlib, which works perfectly for compressing a bunch of images together. If you don't want the overhead of compression, there's an option in zlib to not compress the data at all (making it more like unix's tar). And of course, there's always the option of doing it yourself; simply read in the pixel data, transform it in a way you know well (for beginners I recommend learning RLE - run length encoding, google it), and that'll cut down on your library dependencies. If you really felt like going the distance, you could write an image->language converter and have the images stored inside of the executable itself, though that's not always a good idea, especially if the game's already got some bloat to it.

It's up to you, use your imagination.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!