I'm doing a program to test Spine_LibGDX and I get this error:
Exception in thread "LWJGL Application" java.lang.NullPointerException: Cannot invoke "com.badlogic.gdx.utils.Array.contains(Object, boolean)" because "com.badlogic.gdx.backends.lwjgl.LwjglGraphics.extensions" is null
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.supportsExtension(LwjglGraphics.java:622)
at com.badlogic.gdx.graphics.GLTexture.getMaxAnisotropicFilterLevel(GLTexture.java:232)
at com.badlogic.gdx.graphics.GLTexture.unsafeSetAnisotropicFilter(GLTexture.java:191)
at com.badlogic.gdx.graphics.Texture.load(Texture.java:163)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:147)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:142)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:122)
at com.badlogic.gdx.graphics.g2d.TextureAtlas.load(TextureAtlas.java:253)
at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:245)
at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:240)
at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:235)
at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:225)
at com.QYun.SpineTest.create(SpineTest.java:30)
It is SpineTest code:
public class SpineTest implements ApplicationListener {
float x = 0;
float y = 0;
OrthographicCamera camera;
TwoColorPolygonBatch batch;
SkeletonRenderer renderer;
Skeleton Frostl_Build;
AnimationState Frostl_BuildState;
@Override
public void create() {
float w = Gdx.graphics.getWidth();
float h = Gdx.graphics.getHeight();
camera = new OrthographicCamera(w, h);
batch = new TwoColorPolygonBatch();
renderer = new SkeletonRenderer();
renderer.setPremultipliedAlpha(true);
TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("Frostl_Build/Frostl_Build.atlas"));
SkeletonBinary binary = new SkeletonBinary(atlas);
binary.setScale(4.0f);
SkeletonData skeletonData = binary.readSkeletonData(Gdx.files.internal("Frostl_Build/Frostl_Build.skel"));
Frostl_Build = new Skeleton(skeletonData);
Frostl_Build.setPosition(300, 50);
AnimationStateData stateData = new AnimationStateData(skeletonData);
Frostl_BuildState = new AnimationState(stateData);
Frostl_BuildState.addAnimation(0, "run", true, 0);
}
@Override
public void resize(int width, int height) {
if(camera != null) camera.setToOrtho(false, width, height);
x = camera.position.x;
y = camera.position.y;
}
@Override
public void render() {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
Frostl_BuildState.update(Gdx.graphics.getDeltaTime());
Frostl_BuildState.apply(Frostl_Build);
Frostl_Build.updateWorldTransform();
camera.update();
camera.update();
batch.getProjectionMatrix().set(camera.combined);
batch.begin();
renderer.draw(batch, Frostl_Build);
batch.end();
Gdx.graphics.setTitle("Fps: "+ Gdx.graphics.getFramesPerSecond());
}
@Override
public void pause() {
}
@Override
public void resume() {
}
@Override
public void dispose() {
}
}
Please help me BadLogic π