Exemplo n.º 1
0
  @Override
  public void render() {
    Gdx.gl.glClearColor(0, 0, 0, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    manager.update();
    manager.render(batch);
  }
Exemplo n.º 2
0
  @Override
  public void create() {
    batch = new SpriteBatch();
    res = new Resources();
    r = new Random();

    ShaderProgram.pedantic = false;
    res.addShader(
        new ShaderProgram(
            Gdx.files.internal("shaders/vertex.glsl").readString(),
            Gdx.files.internal("shaders/fragment.glsl").readString()),
        "ambient");
    res.addShader(
        new ShaderProgram(
            Gdx.files.internal("shaders/vertex.glsl").readString(),
            Gdx.files.internal("shaders/fragment.glsl").readString()),
        "blur");

    res.addTexture(new Texture(Gdx.files.internal("textures/light2.png")), "light");
    res.addTexture(new Texture(Gdx.files.internal("textures/background.png")), "background");
    textureAtlas = new TextureAtlas(Gdx.files.internal("pack/gamepack.pack"));

    manager = new StateManager();
    manager.pushState(new PlayState(manager));

    initShaderProgramVariables();
  }