I'm trying to make basic game in Eclipse libGDX. I have Problem with rendering sprite. I do everything like it shoud be, but I still get this Error:
LwjglGraphics: created OpenGL 3.2+ core profile (GLES 3.0) context. This is experimental! Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: BG.png at com.badlogic.gdx.graphics.Pixmap.(Pixmap.java:148) at com.badlogic.gdx.graphics.TextureData$Factory.loadFromFile(TextureData.java:98) at com.badlogic.gdx.graphics.Texture.(Texture.java:100) at com.badlogic.gdx.graphics.Texture.(Texture.java:92) at com.zebrabandit.egghead.Assets.Load(Assets.java:13) at com.zebrabandit.egghead.GameScreen.(GameScreen.java:24) at com.zebrabandit.egghead.EggHead.create(EggHead.java:10) at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:147) at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:124) Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: BG.png (Internal) at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:136) at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:222) at com.badlogic.gdx.graphics.Pixmap.(Pixmap.java:145) ... 8 more
And here is my CODE:
public static Texture backgroundT;
public static Sprite backgroundS;
...
backgroundT = new Texture(Gdx.files.internal("BG.png"));
backgroundT.setFilter(TextureFilter.Linear, TextureFilter.Linear);
backgroundS = new Sprite(backgroundT);
backgroundS.flip(false, true);
...
@Override
public void render(float delta) {
Gdx.gl.glClearColor(1F, 1F, 1F, 1F);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
camera.update();
batch.setProjectionMatrix(camera.combined);
batch.begin();
//rendering code :D
batch.draw(Assets.backgroundS, 0, 0);
batch.end();
}