Newbie to LWJGL: Problem with devIL-import

Started by TheWanderer, July 08, 2006, 13:20:03

Previous topic - Next topic

TheWanderer

Hi,

a few days ago I just started with LWJGL and played around with the examples from the NeHe-Tutorial page to see how things work.

When I got to lesson 06 there was a new import:

import org.lwjgl.devil.IL;

and when I try to compile my examples I only get the following error:

The import org.lwjgl.devil cannot be resolved.


I had a look into the lwjgl.jar and there is nothing like the import is looking for. What am I doing wrong? Did I forget to import something besides the jars and dlls in the download package? I am using Eclipse on Windows XP Prof.

I would be very grateful for any advice. :(


P.S.: I spent some time searching the forum and I couldn't find anything related to my problem. It seems I am missing something really simple as no one seems to have the same problem.

Matzon

you need to add the devil jars lwjgl_devil.jar, the optional ones.

TheWanderer

Thanks! It took me some time to find the optional package, but now I can compile my code :)

However after changing

IL.ilGenImages(1, image); to  IL.ilGenImages(image); (could it be that the NeHe-Tutorials are outdated?) I still get one more error when I try to start the program. After calling IL.create(); it gives me this:

Exception in thread "main" java.lang.UnsatisfiedLinkError: nCreateIL
   at org.lwjgl.devil.ILNative.nCreateIL(Native Method)
   at org.lwjgl.devil.ILNative.createIL(ILNative.java:64)
   at org.lwjgl.devil.IL.create(IL.java:583)
   at Lesson06.init(Lesson06.java:194)
   at Lesson06.run(Lesson06.java:64)
   at Lesson06.main(Lesson06.java:59)


I found the following topic and there he was missing the file IL.dll. Could this be the reason for the exception I get? And if yes, where do I find the file? It is neither included in the 1.0beta package nor in the optional one.

Thank you for your help.

Matzon

it contains Devil.dll which is the one you need
ÿou might want to call IL.create first tho.

Generally the nehe tutorials are a bit out of date

TheWanderer

Hi,

*grmph* I am sorry, I was using an old version of the devIL.dll. :oops:  It works now!


Thanks! :o

gcsaba2

Hello, I've also just started messing around with LWJGL and had the same problem TheWanderer had (I'm also reading NeHe's tutorial).
The problem was I had to do IL.create() first, this solved the problem, however now I got a new problem.

A few lines down in the code, it says:
// Create A IntBuffer For Image Address In Memory
IntBuffer buf = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
GL11.glGenTextures(buf); // Create Texture In OpenGL

GL11.glBindTexture(GL11.GL_TEXTURE_2D, buf.get(0));

I get an error with GL11.glGenTextures():
Quotejava.lang.NullPointerException
   at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1225)
I thought maybe this means the file doesn't exist, or the format is wrong, but after checking with File.exists(), and trying to use JPG, GIF, BMP and RAW formats I'm still getting the same error. What am I doing wrong here?

gcsaba2

Hmm, I seem to have solved the problem?  :? If I use NeHe.bmp then it works ok, if I use my own picture I get an error. So something's wrong with the image then...

gcsaba2

Bah, if I resize it to 256x256 then it works...  :x

Fool Running

QuoteHmm, I seem to have solved the problem? Confused If I use NeHe.bmp then it works ok, if I use my own picture I get an error. So something's wrong with the image then...
That's strange :?  GL11.glGenTextures() shouldn't care about the image in any way...
As a matter of fact, none of the code you pasted should care about the image whatsoever.
Are you sure that's where it was crashing? Usually a NullPointerException in glGenTextures() means you forgot to call Display.Create().
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D