LWJGL
May 24, 2013, 01:57:45 *
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: architecture word width mismatch (?) when using devil  (Read 8618 times)
manji
Newbie
*
Posts: 41



WWW
« on: February 17, 2009, 16:03:41 »

I'm trying to run lesson06 of NeHe, using the devil optional package in a 64bit linux system. While the class is compiled successfully, when I run it I get the following error:

Code:
run:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/stathis/various/lwjgl-2.0.1/native/linux/liblwjgl-devil.so: /home/stathis/various/lwjgl-2.0.1/native/linux/liblwjgl-devil.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1030)
        at org.lwjgl.devil.ILNative$1.run(ILNative.java:69)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.lwjgl.devil.ILNative.loadLibrary(ILNative.java:62)
        at org.lwjgl.devil.ILNative.<clinit>(ILNative.java:77)
        at org.lwjgl.devil.IL.create(IL.java:590)
        at nehe.lessons.Lesson06.init(Lesson06.java:202)
        at nehe.lessons.Lesson06.run(Lesson06.java:72)
        at nehe.lessons.Lesson06.main(Lesson06.java:67)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

I read somewhere that this might have to do with the jdk 64bit edition I'm using, and maybe I should try the 32bit. If so, can I use the 32bit just for Netbeans and the 64bit for the rest of the system?
Logged

Matzon
Administrator
Demigod
*****
Posts: 2239



« Reply #1 on: February 17, 2009, 23:43:22 »

lwjgl doesn't support devil and fmod any more since 2.0
Logged

manji
Newbie
*
Posts: 41



WWW
« Reply #2 on: February 18, 2009, 15:19:51 »

I read about it on other posts too... It sucks, but if there was no way to maintain it, so be it. Could someone please show me an example of how to use slick-util, the recommended replacement for Devil, to load a texture?
Logged

embeddednode
Newbie
*
Posts: 2


« Reply #3 on: March 17, 2009, 19:09:24 »

I read about it on other posts too... It sucks, but if there was no way to maintain it, so be it. Could someone please show me an example of how to use slick-util, the recommended replacement for Devil, to load a texture?

You could change to the SWT in the LWJGL 2. For example,
Code:
import org.eclipse.swt.graphics.ImageData;
(skip......)
int loadTexture(String imgPath) {
ImageData  img      = new ImageData(imgPath);
int        width    = img.width;
int        height   = img.height;
byte[]     data     = new byte[img.data.length];
for(int i=0; i<img.data.length; i++)
data[i] = img.data[img.data.length-(i+0x1)];
ByteBuffer scratch  = ByteBuffer.wrap(data);
IntBuffer  buffer   = ByteBuffer.allocateDirect(0x4).order(ByteOrder.nativeOrder()).asIntBuffer();
GL11.glGenTextures(buffer);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, buffer.get(0x0));
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0x0, GL11.GL_RGB, width, height, 0x0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, scratch);
return buffer.get(0x0);
}

I hope the example which can help you.  Grin

Best regads,
embeddednode
Logged
Matzon
Administrator
Demigod
*****
Posts: 2239



« Reply #4 on: March 18, 2009, 12:33:55 »

or just:
TextureLoader.getTexture(format, new FileInputStream(texfile));
Logged

manji
Newbie
*
Posts: 41



WWW
« Reply #5 on: March 22, 2009, 03:21:54 »

embeddednode thank you, I downloaded SWT and I'll work on your code. Also, I found that the spaceinvaders (http://www.cokeandcode.com/node/9) game uses Texture and TextureLoader classes.

Matzon, I didn't get it, where is the TextureLoader class you say?
Logged

Matzon
Administrator
Demigod
*****
Posts: 2239



« Reply #6 on: March 22, 2009, 04:34:17 »

org.newdawn.slick.opengl.TextureLoader
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!