LWJGL
June 19, 2013, 15:11:36 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Trouble with DevIL  (Read 2471 times)
Jimmy_Scythe
Newbie
*
Posts: 8


« on: June 04, 2005, 10:07:24 »

I ripped the texture loader right out of the sample code on the main site because I thought it would be less of a pain than writing my own AWT or Java2D texture loader. everyting compiled just fine and I copied the /jar and /native directories to the projects base directory and then tried to launch it with "java -cp ;res;jar/lwjgl.jar;jar/lwjgl_devil.jar; -Djava.library.path=native " and I got this error message:

Exception in thread "main" java.lan.NoSuchMethodError: org.lwjgl.devil.IL.ilGenImages(ILjava/nio/IntBuffer;)V


  Is this method just not implemented yet or is there a bug in the sample code that I'm not aware of due to my complete and total ignorance of DevIL?

The code I used can be found here: http://java-game-lib.sourceforge.net/wiki/tiki-index.php?page=Developers+Image+Library
Logged
Matzon
Administrator
Demigod
*****
Posts: 2239



« Reply #1 on: June 04, 2005, 11:13:00 »

Are you sure you're calling create ?
does the org.lwjgl.test.devil.BasicTest work ?
Logged

Jimmy_Scythe
Newbie
*
Posts: 8


« Reply #2 on: June 05, 2005, 11:16:15 »

yeah, I called create in the app's init method. I'm not sure if devil.BasicTest worked since it just gave me alot of text that I couldn't really understand other than "error=noerror" and the names of different methods used by DevIL. ilGenImages was the very first thing that came out of BasicTest, so I'm totally baffled as to why it can't find the method at runtime. I think I'm just gonna throw all the *.jar files into the command line and see if the VMt can't find it then.
Logged
Matzon
Administrator
Demigod
*****
Posts: 2239



« Reply #3 on: June 05, 2005, 11:18:12 »

you need to make sure that the devil libs are locatable too via the  -Djava.library.path
Logged

Jimmy_Scythe
Newbie
*
Posts: 8


« Reply #4 on: June 05, 2005, 14:46:09 »

Okay..... I'm starting to think that something is wrong somewhere else in my code. the -Djava.library.path=native and the native folder contains DevIL.dll, ILU.dll, ILUT.dll and lwjgl-devil.dll. It could be something with java.nio. * but I don't think that's likely. BTW I ran basic test from the project folder and it returned "noerror" on both ilGenImages and ilBindImage. since there was no resource file in that directory (I use \Data for the 3D information and textures) it couldn't run all the tests. This means that I should probably go back over the code and rebuild since everything else can find the ilGenImages method and my app can't. I think NeHe did a 3D walkthrough project like this but Im not sure if it's been converted yet. If it has been I'll try it and then see what he did differently if it works.
Logged
Jimmy_Scythe
Newbie
*
Posts: 8


« Reply #5 on: June 06, 2005, 20:27:40 »

I found the NeHe code that was similar to what I was doing. I'm using anim8or files but the concept is still basically the same as NeHe's Lesson10. Problem is that the exact same code is used in the LWJGL implementation of that lesson and the code doesn't work. I'm kinda wondering if the method is declared wrong and the VM is looking for an overload of the ilGenImages() method. the full error reads:

Exception in thread "main" java.lang.NoSuchMethodError:  org.lwjgl.devil.IL.ilGenImages(ILjava/nio/intBuffer;)V

    The javadoc entry for ilGenimages() states that it's "public static void ilGenImages(java.nio.IntBuffer images)". So I'm thinking the problem is either in the line that reads:

IntBuffer image= ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer()
;

   or in the declaration of ilGenImages() itself which reads:

IL.ilGenImages(1, image);

   I'm thinking that the 1 is un-needed. <shrugs> I'm gonna try omitting the 1 from the declaration. Aside from that, I'm tapped for ideas. Any other thoughts on this would be helpful to anyone trying to use this code snippet in their own stuff.
Logged
Matzon
Administrator
Demigod
*****
Posts: 2239



« Reply #6 on: June 07, 2005, 04:29:22 »

Quote
I'm thinking that the 1 is un-needed. <shrugs> I'm gonna try omitting the 1 from the declaration. Aside from that, I'm tapped for ideas. Any other thoughts on this would be helpful to anyone trying to use this code snippet in their own stuff.

the 1 IS irrelevant, since it's read from the passed buffers .remaining() method.

However, you really should be able to compile at all if you pass a 1, since it shouldn't be able to locate that method??
Logged

Jimmy_Scythe
Newbie
*
Posts: 8


« Reply #7 on: June 07, 2005, 11:27:19 »

I can't figure out why it compiled either. After I ditched the 1 everything ran fine. Interestingly enough, the LWJGL implementation of NeHe's Lesson10 unzipped with a Lesson10 class already compiled. It got the same error. I'm sure that ilGenImages(1,image) was written in the sample code because that's how the function is called in C/C++ but you'd think that whoever set that up would have tested it before posting it. I can't speak for the creator of the Lesson10 code but I'm going over my own program to try and figure out why it compiled at all.
Logged
Matzon
Administrator
Demigod
*****
Posts: 2239



« Reply #8 on: June 07, 2005, 12:12:29 »

think the problem is that the old devil code used c style arguments, but that was changed 2 releases ago.
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!