code: public void setTexture (Texture texture) {
      if (curTexId != 0 && curTexId != texture.id) flush();
      this.curTexId = texture.id;
    }
docs: Prepares this batch to render using the supplied texture. If pending operations have been
  added to this batch for a different texture, this call will trigger a {@link #flush}.
  <p>Note: if you call {@code add} methods that take a texture, you do not need to call this
  method manually. Only if you're adding bare primitives is it needed.