if (!drawing) throw new IllegalStateException("PolygonSpriteBatch.begin must be called before end.");
if (vertexIndex > 0) flush();
lastTexture = null;
drawing = false;
GLCommon gl = Gdx.gl;
gl.glDepthMask(true);
if (isBlendingEnabled()) gl.glDisable(GL10.GL_BLEND);
if (Gdx.graphics.isGL20Available()) {
if (customShader != null)
customShader.end();
else
shader.end();
} else {
gl.glDisable(GL10.GL_TEXTURE_2D);
}
}