DevIL Logo
      A full featured cross-platform image library.




SourceForge Home





Contact Us

Tutorial 11: Customizing DevILLast Revised: 1:31 AM 02/01/2001
DevIL allows some customization of the library, besides registering your own functions. You can actually customize DevIL before compile time to use just what you want. For example, if you only want to load .tga files, you can remove support for everything else in DevIL.

Separation of Libraries
DevIL is currently separated into three different libraries, because each performs a specific task. DevIL is the lowest level library and mainly deals with loading, saving and converting images. DevILU is the next highest library, deals mainly with manipulating images, and is dependent on DevIL. DevILUT is the highest library and deals mainly with displaying images and sending them to your choice of graphics API. Just include the header of the corresponding library(s) you wish to use (<il/il.h>, <il/ilu.h>, <il/ilut.h>).

DevIL Trimming
If you crack open <il/il.h>, you will see several lines that look similar to this:

      //#define IL_NO_BMP
      //#define IL_NO_CUT
      //#define IL_NO_CHEAD

If you uncomment any of these and recompiled DevIL, support for that format will be left out of DevIL. I suggest you only do this if you are absolutely sure you do not need support for that format or never will. Each //#define corresponds directly to a file format, and the correlation should be self-explanatory.

Jpeg Libraries
DevIL supports both libjpeg and the Intel Jpeg Library (IJL) for its .jpg loading and saving capabilities. Unfortunately, the IJL only works in Windows, and it does not support loading from file streams. The downside to libjpeg is that some jpegs do not load correctly at all, and from what I can tell, they are progressive jpegs. If you want to make sure all jpeg files load correctly, and you are using Windows, enable IJL support. Directly under the //#defines described in the above section, there is a line that reads //#define IL_USE_IJL (with or without the comments). If you want to use the IJL instead of libjpeg, uncomment this line if it is not already. If you wish to use libjpeg, comment this line if it is not already.

API Preening
Several graphics APIs are supported by DevIL. These include OpenGL, Allegro, Windows GDI and DirectX. Support for each of these is controlled in ilut.h.

#define ILUT_USE_ALLEGRO - If this line is used, ilut will have Allegro support.
#define ILUT_USE_WIN32 - If this line is used, ilut will have Windows GDI and DirectX support.
#define ILUT_USE_OPENGL - If this line is used, ilut will have OpenGL support.