Anyways, the IOstreams library is pretty much perfect for what I want todo, the basic setup being;
- Create filtering stream object
- Work out which file format we are dealing with and push the correct filtering object into the stream
- Push a file reading object into the stream
- Read the data in
When we push the filtering object into the stream we pass it a reference to a structure into which the header is decoded before we start returning decoded data. This means that the loading loop is just a reading loop, however we are garrenteed to have the header decoded first as such we can use this data while decoding (such as setting the correct size of the final data buffer).
So, the basic framework is in place and I've got a test program which shows that the bitmap decoder does infact work. So, what I have todo now is make the filtering objects for the various file formats, after that I can refactor the internals so that things are a little saner.
I'm also considering making a templated version, I'm pretty sure various bits could be swapped about so that I can compile time dispatch some things (mostly related to the texture types). However this is low on my 'todo' list and needs some more investigation.
More soon I hope [smile]