Reading from compressed archives
I want to put all the content of my programs in a compressed archive as its beginning is getting quite large. I know that in several libraries like zlib, but I don't know how to get them to do what I want to do:
-
Be able to load textures / models, etc. from a file, curlyly im using d3dx methods like D3DXCreateTextureFromFileEx. I really don't want to write my own image loaders for the different formats I need, so I need a way to be compatible with these d3d methods. I know they have a way to load from a file into memory, would it be wise to extract the file into memory and then load it?
-
Be able to use C ++ streams with files in a compressed archive, for example:
std :: zipstream file ("data.zip:sounds/beep.wav", std :: ios :: in | std :: ios :: binary);
source to share
There is an article titled Programming the Virtual File System , archived in flipcode , that should provide what you need. If you have questions specific to this article, many former flipcodes members now frequent the forums at DevMaster.net .
source to share