/** * Finishes off rendering. Enables depth writes, disables blending and texturing. Must always be * called after a call to {@link #begin()} */ public void end() { if (!drawing) throw new IllegalStateException("SpriteBatch.begin must be called before end."); if (idx > 0) renderMesh(); lastTexture = null; idx = 0; 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); } }
public void draw(float deltaTime) { GLCommon gl = Gdx.gl; gl.glClear(GL10.GL_COLOR_BUFFER_BIT); guiCam.update(); batcher.disableBlending(); batcher.begin(); batcher.draw(helpRegion, 0, 0, 320, 480); batcher.end(); batcher.enableBlending(); batcher.begin(); batcher.draw(Assets.arrow, 320, 0, -64, 64); batcher.end(); gl.glDisable(GL10.GL_BLEND); }
public void draw() { GLCommon gl = Gdx.gl; gl.glClear(GL10.GL_COLOR_BUFFER_BIT); guiCam.update(); batcher.setProjectionMatrix(guiCam.combined); batcher.disableBlending(); batcher.begin(); batcher.draw(helpRegion, 0, 0, 320, 480); batcher.end(); batcher.enableBlending(); batcher.begin(); batcher.draw(Assets.arrow, 320, 0, -64, 64); batcher.end(); gl.glDisable(GL10.GL_BLEND); }