package zero1hd.rhythmbullet.desktop.screens;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

import zero1hd.rhythmbullet.RhythmBullet;
import zero1hd.rhythmbullet.desktop.screens.main.MainScreen;
import zero1hd.rhythmbullet.util.InitialScreen;

public class SplashScreen extends ScreenAdapter implements InitialScreen {
	private Texture splashTexture;
	private SpriteBatch batch;
	
	@Override
	public void init() {
		batch = new SpriteBatch();
		splashTexture = new Texture(Gdx.files.internal("splash_texture.png"));
	}
	
	@Override
	public void render(float delta) {
		Gdx.gl.glClearColor(1f, 1f, 1f, 1f);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		batch.begin();
		batch.draw(splashTexture, 0, 0);
		batch.end();
		
		super.render(delta);
	}
	
	@Override
	public void hide() {
		splashTexture.dispose();
		super.hide();
	}

	@Override
	public void preAssetLoad() {
	}

	@Override
	public void postAssetLoad() {
	}
	
	@Override
	public void resize(int width, int height) {
		super.resize(width, height);
	}
	
	@Override
	public Screen advance(RhythmBullet game) {
		return new MainScreen(game);
	}
}
