View Full Version : Should I...?

06-03-2002, 03:29 AM
Should I use DevIL (aka OpenIL) or should I just code my own texture-loading library for use with texturemapping in OpenGL??? For those who've used DevIL, is it good? is it fast? is it easy to use?

What are the pros and cons of using DevIL instead of creating my own texture library?

PS: I can't seem to find anywhere in DevIL's website if we could make commercial software using DevIL (i'm asking if there is a fee, or is it free?)


06-03-2002, 03:56 AM
It depends if you have time to waste or not. There are dozens of image file loaders. If you have the time and will to code one by yourself, go ahead, but writting a good loader that supports many image file formats (and many flavours of each format) is likely to take you a lot of time.

Is DevIL fast? As far as I can tell, yes. Note that I never tried to load dozens of 10-MB JPEGs in one go, but for usual stuff, there is no speed problem.
Is DevIL easy to use? Yes, definitely.
Is it free for commercial use? I think so, because it uses free libraries to load the various file formats. However, I encourage you to contact directly the author and get a clear answer.

Pros & cons:
pros : easy to use, efficient, robust, documented
cons : you have to ship third party dlls (devil's dlls) with your program.

06-03-2002, 06:12 AM
And they have a great new logo. How could you refuse?!

Oh, and it is free:

The license is LGPL so you may link to the library in a commercial project without contamination. [IANAL]

I normally remember it by forwarding through

[This message has been edited by dorbie (edited 06-03-2002).]

06-03-2002, 04:17 PM
Can you write your own image loader? If not, then write your own image loader!

Really. If you lack the skills to do it your self, then try to do it your self. And, is it faster???????? WTF? loading images is about as simple as it gets. If you can't do it, learn ... if you can do it, then write it.

PLEASE don't rely on other peoples code. A lot of people rely on 3rd party graphics stuff. It always sucks - so forget it. DO IT YOURSELF!

You'll learn loads from it if nothing else.

06-03-2002, 05:00 PM
Most image formats ARE easy, and an image loader is a good exercise in "doing it right by doing it yourself."

If you're learning, yes, I highly reccomend trying to write your own loaders. Watch out though, JPGs will knock the wind out of you http://www.opengl.org/discussion_boards/ubb/wink.gif

However, I must vouch for DevIL/OpenIL/ImageLib (OMG Pick a frickin' name and STICK WITH IT!) in that it does NOT "suck," and in fact is a very useful tool. It is in fact the ONLY third party library I have ever used, and I only originally grabbed it because my image loader code was not handy and I needed a QAD setup and it absolutely positively had to be there overnight. After finding out how much easier it was to dole the responsibility out, I decided to stick with it.

One thing I like about it is how it does NOT automatically try to do everything for you--although it does have utility funcs for uploading images and textures as whatnot, I use it strictly for loading, grab a pointer to what it read, and then send it on its way.

06-03-2002, 08:10 PM
If you don't wanna write your own, then go right ahead and use it. I use it myself because of the many different file formats it supports, and of the various ways you can manipulate your images, for example, blurring and alienifying your textures...and it makes it so damn easy to code. You have a different purpose for using an image loader, so that's up to you whether to use DevIL or not.

Pros: Easy to use, supports MANY image file formats, and it's licensed under the Lesser General Public License, so you know Microshaft'll never touch this ;)
Cons: The gif loader sucks for me for some reason (well, the gif file format sucks in general, though)

06-03-2002, 09:57 PM
thanks for the replies guys. i'll probably be using DevIL for the meantime, then if i have time, i'll be creating my own image library to use (it's free anyway, so no hurry...=) ).

now that my image-loading problem is done. let's move to sounds.

which one would you recommend for 3d sounds? pros and cons? is it also advisable to write your own sound-library???


06-04-2002, 03:35 AM
I would agree that accumulating skills is important, but you have to spend your effort where you get the best return. It all depends if you are coding to produce something or coding as a learning exercise.

Image loaders are mostly trivial and writing them is not challenging. OTOH trying to implement your own JPEG loader could take time if you start from scratch. I'd never waste my time doing this, I have better things to write with my time, and my work wouldn't be as optimized tested and portable as available libraries online which have been tuned and tested over a prolonged time.

06-04-2002, 08:59 AM
On 06-03-2002 11:57 PM, a contributor named nomad made the following remark:
now that my image-loading problem is done. let's move to sounds.

which one would you recommend for 3d sounds? pros and cons? is it also advisable to write your own sound-library???

You mean for loading different file formats, such as mp3, midi, etc., or just doing sound effects in general?

FMOD has a nice mix of both. It allows you to load a variety of waveform and segmented formats, and you can manipulate your sound in many ways. FMOD's pretty bitchin' fast, compared to other audio libraries.

Pros: Supports many file formats--mp3, ogg vorbis, screamtracker3, etc--as well as a variety of effects--reverb, preverb, echo,etc--and it's easy to use.
Cons: It don't work on Macintosh. I don't know if it ever will, though. Also, depending on what you're gonna do with your project, you may have to pay for it. It's free to try out, though. See their licensing for details. In addition, it doesn't support SoundTracker .MOD format for some reason, only ProTracker and FastTracker .MOD

If you don't really care about which file format you're using, and just want to focus on effects, I guess you can check out OpenAL. I don't know too much about it, I haven't gotten it to work on Borland yet, and I haven't seen any programs that actually use OpenAL.

Pros: Works on a variety of operating systems.
Cons: Doesn't really support actually loading your sound data. Doesn't like MIDI. The company who made it, Loki Entertainment Software, is dead now, so finding the place to download it from is also a pain.

I use FMOD myself, because loading different file formats is important to me for what I write. As for writing your own sound library, I guess you could...that is, if you know how to.