LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Twk Amz on April 17, 2015, 14:19:13

Title: Can't load png file with slick-util: java.lang.NoSuchMethodError
Post by: Twk Amz on April 17, 2015, 14:19:13
Hi, I got lwjgl working on my computer and I am trying to load a png with slick util. Lwjgl alone is working just fine, but when I added slick-util to my project, it crashes when I try to load an image(see code below).

Code: [Select]
Texture tex;
try {
tex = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("rsrc/tux.png")); // <==== Crash Line
} catch (IOException e) {
e.printStackTrace();
}

I added the jar file for slick util in eclipse. I didn't add any natives for slick, I searched and it seems like I just have to add the jar file(am I right here?). The error code is this one:

Code: [Select]
Exception in thread "main" java.lang.NoSuchMethodError: org.lwjgl.opengl.GL11.glGetInteger(ILjava/nio/IntBuffer;)V
at org.newdawn.slick.opengl.renderer.ImmediateModeOGLRenderer.glGetInteger(ImmediateModeOGLRenderer.java:194)
at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:317)
at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:254)
at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:200)
at org.newdawn.slick.opengl.TextureLoader.getTexture(TextureLoader.java:64)
at org.newdawn.slick.opengl.TextureLoader.getTexture(TextureLoader.java:24)
at HelloWorld.loop(HelloWorld.java:106)
at HelloWorld.run(HelloWorld.java:32)
at HelloWorld.main(HelloWorld.java:152)

I think that it may have to do with the project's setup. But the lwjgl natives are there. Maybe it's just that slick works with lwjgl2?
Anyway, I can't get it to work, Any Ideas?
Title: Re: Can't load png file with slick-util: java.lang.NoSuchMethodError
Post by: abcdef on April 17, 2015, 15:38:39
Quote
Maybe it's just that slick works with lwjgl2?

Slick hasn't been update for a long time, if there are any method changes in LWJGL3 (which there are) that effect slick then it won't work.
Title: Re: Can't load png file with slick-util: java.lang.NoSuchMethodError
Post by: kappa on April 17, 2015, 19:52:27
The main Slick-Util download is for LWJGL2, you can grab a LWJGL3 compatible version of Slick-Util from here (http://slick.ninjacave.com/slick-util3.zip).
Title: Re: Can't load png file with slick-util: java.lang.NoSuchMethodError
Post by: Twk Amz on April 17, 2015, 22:10:38
The main Slick-Util download is for LWJGL2, you can grab a LWJGL3 compatible version of Slick-Util from here (http://slick.ninjacave.com/slick-util3.zip).
I see, thanks, hope they maintain this version of slick-util. Also, where can I find the doc for this library? I didn't even find the download on my own