i would pack all the necessary media files into some archive, say 7z. without compression of course since pngs are already compressed. this needs some extra libs included but afaik simplest unzip source shouldn't get your exe any larger (hope you are not writing an 64k compo). than i would just attach the archive to the compiled exe's end (copy /b run.exe + data.zip final.exe on windows). final thing is to know where the data.zip starts. easiest is to get filelength of run.exe and attach it as binary long int to the end of file.exe.
some simple batches should do the trick and you will get the possibility to work with a file/directory structure instead some memory pointers to textures. this way making change will be much easier.
This sounds interesting, how would I access the files in the .zip from my program? This kinda stuff is entirely new to me.
You basically have 3 options when it comes to embedding data into a exe.
- Provide the data in your C++ source ( as rivon mentioned ).
- Use a resource file with your C++ projectš
- Append the data to your exe ( as rostok mentioned )˛
šIn case your IDE doesn't have a Resource Editor, you could use something like ResEdit
˛In case you don't want to break your digital signature, you need to pull off some tricks
The best solution sounds like appending the data to the exe or storing it in some kind of resource file/archive, but I'd like to keep it cross platform so want to avoid using any windows specific resource stuff (but again I have no idea how it works or if there's a cross platform version of microsoft's RCs ).