Can't load png file with slick-util: java.lang.NoSuchMethodError

Started by Twk Amz, April 17, 2015, 14:19:13

Previous topic - Next topic

Twk Amz

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).

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:

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?

abcdef

QuoteMaybe 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.

kappa

The main Slick-Util download is for LWJGL2, you can grab a LWJGL3 compatible version of Slick-Util from here.

Twk Amz

Quote from: 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.
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