I've recently encountered a strange problem with my program and I can't seem to fix it. When I try to apply a shader to my SpriteBatch
it doesn't change. I've debugged this problem like so:
if (test) {
System.out.println("Batch shader: " + stage.getBatch().getShader());
System.out.println("Default shader: " + Assets.getDefaultShader());
System.out.println("Default batch: " + Assets.SPRITE_BATCH);
System.out.println("Stage batch: " + stage.getBatch());
}
stage.getBatch().setShader(null);
if (test)
System.out.println("Batch shader: " + stage.getBatch().getShader()); //Should print null
stage.act();
if (test)
System.out.println("Batch shader: " + stage.getBatch().getShader());
stage.draw();
if (test)
System.out.println("Batch shader: " + stage.getBatch().getShader());
test = false;
All of those shaders print the exact same thing, and the batches are also the same (the batches are supposed to be the same). Any ideas why?