/** Ends a series of drawing commands that were clipped per a call to {@link #startClipped}. */ public void endClipped () { batch.flush(); // flush our clipped calls with SCISSOR_TEST still enabled Rectangle r = popScissorState(); if (r == null) batch.gl.glDisable(GL20.GL_SCISSOR_TEST); else batch.gl.glScissor(r.x, r.y, r.width, r.height); batch.gl.checkError("endClipped"); }
/** Ends a series of drawing commands that were clipped per a call to {@link #startClipped}. */ public void endClipped () { batch.flush(); // flush our clipped calls with SCISSOR_TEST still enabled Rectangle r = popScissorState(); if (r == null) batch.gl.glDisable(GL20.GL_SCISSOR_TEST); else batch.gl.glScissor(r.x, r.y, r.width, r.height); batch.gl.checkError("endClipped"); }
/** Starts a series of drawing commands that are clipped to the specified rectangle (in view * coordinates, not OpenGL coordinates). Thus must be followed by a call to {@link #endClipped} * when the clipped drawing commands are done. * * @return whether the resulting clip rectangle is non-empty. <em>Note:</em> the caller may wish * to skip their drawing if this returns false, but they must still call {@link #endClipped}. */ public boolean startClipped (int x, int y, int width, int height) { batch.flush(); // flush any pending unclipped calls Rectangle r = pushScissorState(x, target.flip() ? target.height()-y-height : y, width, height); batch.gl.glScissor(r.x, r.y, r.width, r.height); if (scissorDepth == 1) batch.gl.glEnable(GL20.GL_SCISSOR_TEST); batch.gl.checkError("startClipped"); return !r.isEmpty(); }
/** Starts a series of drawing commands that are clipped to the specified rectangle (in view * coordinates, not OpenGL coordinates). Thus must be followed by a call to {@link #endClipped} * when the clipped drawing commands are done. * * @return whether the resulting clip rectangle is non-empty. <em>Note:</em> the caller may wish * to skip their drawing if this returns false, but they must still call {@link #endClipped}. */ public boolean startClipped (int x, int y, int width, int height) { batch.flush(); // flush any pending unclipped calls Rectangle r = pushScissorState(x, target.flip() ? target.height()-y-height : y, width, height); batch.gl.glScissor(r.x, r.y, r.width, r.height); if (scissorDepth == 1) batch.gl.glEnable(GL20.GL_SCISSOR_TEST); batch.gl.checkError("startClipped"); return !r.isEmpty(); }