GTL Part 6 : DDS Support Added

posted in Not dead...
Published August 23, 2005
Advertisement
So, with the lack of anything else todo I decided to hit the code hard and get DDS support added to the GTL, and it went pretty smoothly and should in theory all be working perfectly [smile]

I had a couple of problems, firstly it turns out that DDS format files always return at least 1 mipmap in the file (the main surface) which tripped me slightly with calculation of the image size and due to 'silly fingers' I accidently type'd an '8' instead of a '4' in the code which works out the size of each mipmap level, which caused a white cube for a while, however a quick fix there and the problem went away and a lovely spinning texture'd cube was born.

A couple of other changes accured in the library as well;
* All image format tags changed to FORMAT_, it just makes more sense
* The library gained a couple of extra functions to retrive the width, height and size of an image at a certain mipmap level. The first two could be done by hand, however from my own point of view I want a function which will do the Right Thing(TM). The function to retrive the size of the image is a little more involved, it infact calls apon a static function in the DDSFilter class (I might do something about that, punt it out to the Until's namespace maybe) as such it made sense to make a function out of it.

So, I'm pretty happy with how things are stacking up thus far. I need to do alot more testing on the DDS decoder, right now its only loading a DXT1 image without a mipmap chain, so I need to test the other compression types and come up with a test for ATI's 3Dc compression format as well.

For the added mipmap support the current functions will have to become real functions, not holding place code which just returns the details of the base level image. The getImage() function is going to be the most involved when it comes to extracting bitmap's from the image data, even more so with cubemaps and 3D images (which I've not even tested as yet!).

I'm also considering adding support for HDR images, OpenEXR and PFM (portable float map), however if/when this happens I will have completely stabilies the current code base and come up with the promised C/SDL interface into the library (for some reason bolting on a C interface to a C++ library seems a bit backwards, heh [grin]).

So, a pretty productive day and on the whole I'm happy with how things are progressing, with any luck I can get a beta release Out Soon(TM) and let the general programming public loose on the code to break it [grin]

Infact, that reminds me, must setup a sourceforge project for this...
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

Advertisement