Simple DDS loader

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
egrath
Posts: 28
Joined: Wed May 13, 2009 8:15 am
Location: Austria
Contact:

Simple DDS loader

Post by egrath »

Hello,
for a project of mine i needed the ability to load DDS Textures in Irrlicht. The result was a little and simple to use library which does:
  • Load a DDS File and return a *IImage
  • Supports DXT1/3
  • No dependencies to other libraries (except Irrlicht :-)
The entire DXT decoding is based around FFmpeg's s3tc.c implementation which has been additionally licensed under the Terms of the ZLIB license by the original author (Ivo van Poorten). My code is also licensed under the terms of the ZLIB.

Download it here: http://egonrath.eg.funpic.de/wordpress/?p=376
Mirror: http://rapidshare.de/files/47641084/DdsTool.7z.html

Greetings,
Egon

/edit: Updated links and license
Last edited by egrath on Wed Jun 24, 2009 5:26 am, edited 1 time in total.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Nice job. I'll see if I can get this into Irrlicht somehow (Although the IImage system is due for a long overhaul so we may just wait until then).
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

DDS is certainly a features often missed. I think I've also seen 2 other implementations on the forums trying to fix that. One from festini was for an older Irrlicht and worked only for OpenGL, but also had a loader. I think the other was from Nadro, I haven't checked out that one yet.

@BlindSide: Be careful, we can't use LGPL code in Irrlicht.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Ah I missed the license part, nevermind then.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
egrath
Posts: 28
Joined: Wed May 13, 2009 8:15 am
Location: Austria
Contact:

Post by egrath »

Hello,
if LGPL is a problem i can implement the S3TC decoding from scratch and relicense under the zlib license. Just let me know.
Egon
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

LGPL cannot be included into Irrlicht, as it would require shared objects for those parts. So this code cannot be put into Irrlicht as is.
egrath
Posts: 28
Joined: Wed May 13, 2009 8:15 am
Location: Austria
Contact:

Post by egrath »

Hello,

i've contacted the author of the parts not written by me and he told me that he additionally releases his components (s3tc.c and s3tc.h) under the Terms of the ZLIB License for inclusion in Irrlicht.

Tomorrow i will upload a new Release of the Library licensed under the terms of ZLIB at its entire.

Greetings,
Egon
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

BlindSide wrote:Nice job. I'll see if I can get this into Irrlicht somehow (Although the IImage system is due for a long overhaul so we may just wait until then).
What we need is native dds support - decoding on load is far less useful, if that is what this is.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Thanks egrat for taking the extra time to get a compatible license (and do carry my thanks to the author of the code you used for allowing it too if you talk to him again)

That's a nice gesture.

10 robot pieces to each of you.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

sio2 wrote:
BlindSide wrote:Nice job. I'll see if I can get this into Irrlicht somehow (Although the IImage system is due for a long overhaul so we may just wait until then).
What we need is native dds support - decoding on load is far less useful, if that is what this is.
Yes I agree, but it's not really possible at the moment. The only easy way out is to compress it ourselves at runtime.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
egrath
Posts: 28
Joined: Wed May 13, 2009 8:15 am
Location: Austria
Contact:

Post by egrath »

Hello,
the license for the entire library has been changed to ZLIB. Updated links are in the first post.
Egon
Post Reply