Linux game resource files

Started by
3 comments, last by hydroo 17 years, 1 month ago
When developing with Windows, there are "resource files" that allow me to store all of my bitmaps, sounds, levels, etc. into the executable file. Then, I only need to distribute that one file, but my program still has access to all of its resource data. Since I'm new to Linux development, I was wondering if there is a similar feature I can use to put all of my game's resource data into the one executable file.
Advertisement
I don't think that there is an equivalent thing in the Unix world. You're probably better off storing your resources in a separate file and then bundling everything together in a tar.gz or some other format.
Quote:Original post by Cornflake420
When developing with Windows, there are "resource files" that allow me to store all of my bitmaps, sounds, levels, etc. into the executable file. Then, I only need to distribute that one file, but my program still has access to all of its resource data.

Since I'm new to Linux development, I was wondering if there is a similar feature I can use to put all of my game's resource data into the one executable file.

I'm not aware of any tools which make embedding data inside an ELF executable particularly easy. My advice would be not to try, since it isn't the way things are done on Linux. Storing resources externally will usually be a better idea. It gives users a chance to decide where data is to be stored on their system, and also makes it easier to update only certain parts of the data without having to download the entire thing again.

If you really have your heart set on having one executable to rule them all, however, you can append a zip archive to the executable. The executable is still perfectly executable, and you can access the archive using a normal zip library. So long as your zip utils are up-to-date, you can modify the zip archive as per usual, so distributing an update would be a matter of distributing an archive of the changed files and having the executable update itself from it. (Older versions of zip might corrupt an executable archive when modifying it. I don't know at which version number it became safe.)
Thanks for the responses. I was able to append a zip file to my executable.
QT Designer is able to store anystuff within your application(, but you have to use QT). http://www.trolltech.com

I don't exactly know what he does (and the others don't), but pictures/icons(and other stuff) for the gui SEEM to be stored into the executable.


I don't know any other way.

--
hope that helps

This topic is closed to new replies.

Advertisement