Here's the exception I get following the online tutorial. The code is pretty simple, so what could be wrong?
java.lang.IndexOutOfBoundsException: 157311
at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:209)
at org.lwjgl.opengl.glu.MipMap.gluScaleImage(MipMap.java:237)
at org.lwjgl.opengl.glu.MipMap.gluBuild2DMipmaps(MipMap.java:95)
at org.lwjgl.opengl.glu.GLU.gluBuild2DMipmaps(GLU.java:381)
at com.jme.scene.state.lwjgl.LWJGLTextureState.apply(LWJGLTextureState.java:247)
at com.jme.util.TextureManager.loadTexture(TextureManager.java:252)
at com.jme.util.TextureManager.loadTexture(TextureManager.java:158)
at com.codecrate.shard.ui.TextureManager.loadTexture(TextureManager.java:14)
at com.codecrate.shard.ShardHack.simpleInitGame(ShardHack.java:28)
at com.jme.app.SimpleGame.initGame(SimpleGame.java:366)
at com.jme.app.BaseGame.start(BaseGame.java:64)
at com.codecrate.shard.ShardHack.main(ShardHack.java:22)
public class ShardHack extends SimpleGame {
private final TextureManager textureManager;
public ShardHack() {
super();
setDialogBehaviour(NEVER_SHOW_PROPS_DIALOG);
this.textureManager = new TextureManager();
}
public static void main(String[] args) {
new ShardHack().start();
}
protected void simpleInitGame() {
display.setTitle("Shard Hack");
Texture texture = textureManager.loadTexture("MetallicTile.jpg");
TextureState ts = display.getRenderer().createTextureState();
ts.setEnabled(true);
ts.setTexture(texture);
Sphere s = new Sphere("Sphere", 30, 30, 25);
s.setLocalTranslation(new Vector3f(0,0,-40));
s.setModelBound(new BoundingBox());
s.updateModelBound();
s.setRenderState(ts);
rootNode.attachChild(s);
}
}