devIL vs java class

Started by sq, February 06, 2005, 20:13:27

Previous topic - Next topic

sq

hi everyone. i've started playing with lwjgl a few days ago. question... what are the advantages/disadvantages (speed, memory efficiency, cross-platform issues, etc) of using devIL vs a java utility class  (like org.lwjgl.examples.spaceinvaders.TextureLoader) for loading images? Thanks.

Matzon

Faster, more formats, easier integreation with opengl (ilut has some OGL methods).

However, all of this can be overcome using a custom format of your choice instead of distributing as jpg/tga/png.

So basically, Devil is just a handy library.

jam007

Hm. I have just started adding textures to my program. And I followed the tutorials with java classes. Is there som examples that shows how to use deviIL classes to load and handle textures?

I would like to have different textures on different objects.  Like cars having different colours on the same model and some have the same colour. I was thinking of loading the used textures and puting the integer refering to that texture in an object together with a name and then making a list of these texture objects. Then to apply a texture to a particular object using a reference to an item in the texturelist stored in the object. Maybe with devIL I can do this in an other way. Can I check if an texture exists or has to be loaded with devIL?

Anders

Matzon

I am not sure why you're mixing textures and devil together?
Devil just loads an image, and you get that image data and pass it on to some gl rutines that "convert" it into a texture.

So in the case of the NeHe tutorials, you would take the integer returned from loadTexture and stuff it into a hashtable, using the path as key (just one way of doing it). Then you have a list of texture ids and a keys which you can use for all  said cars.

note: The tutorials don't delete the images loaded by IL ?

jam007

QuoteI am not sure why you're mixing textures and devil together?
:? Just missunderstood I guess. I tried to understand the text on devIL at their site and the connection to openGL.

Thanks for the hashtable idea

Anders

sq

I decided to give DevIL a try. I've downloaded the 3 .dlls (http://prdownloads.sourceforge.net/openil/DevIL-EndUser-1.6.7.zip), placed them in the same directory with lwjgl and when I try to run NeHe Lesson 06 I get The specified procedure could not be found. Am I using the right files?

java.lang.UnsatisfiedLinkError: C:\j2sdk1.4.2_04\lwjgl-win32-0.95\lwjgl-devil.dll: The specified procedure could not be found

at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1485)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at org.lwjgl.devil.IL.<clinit>(IL.java:304)
at Lesson06.init(Lesson06.java:194)
at Lesson06.run(Lesson06.java:64)
at Lesson06.main(Lesson06.java:59)

Matzon

afaik, you have to place the DLL's in the dir you execute from, due to how the binding is done at this time.
so you should have:
NeHe:
\src
\bin
\lib (lwjgl stuff)
DevIL.dll
ILU.dll
ILUT.dll

at least, this works for me...

CaptainJester

Quote from: "Matzon"afaik, you have to place the DLL's in the dir you execute from, due to how the binding is done at this time.

You can also put them in your PATH.
The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities.  We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)
8)