/** * Adds a collection of textured triangles to the current render operation. See * {@link #addTris(Texture,int,AffineTransform,float[],int,int,float,float,int[],int,int,int)} * for parameter documentation. * * @param sxys a list of sx/sy texture coordinates as: {@code [sx1, sy1, sx2, sy2, ...]}. This * must be of the same length as {@code xys}. */ public void addTris (Texture tex, int tint, AffineTransform xf, float[] xys, float[] sxys, int xysOffset, int xysLen, int[] indices, int indicesOffset, int indicesLen, int indexBase) { setTexture(tex); prepare(tint, xf); addTris(xys, sxys, xysOffset, xysLen, indices, indicesOffset, indicesLen, indexBase); }
/** * Adds a collection of textured triangles to the current render operation. See * {@link #addTris(Texture,int,AffineTransform,float[],int,int,float,float,int[],int,int,int)} * for parameter documentation. * * @param sxys a list of sx/sy texture coordinates as: {@code [sx1, sy1, sx2, sy2, ...]}. This * must be of the same length as {@code xys}. */ public void addTris (Texture tex, int tint, AffineTransform xf, float[] xys, float[] sxys, int xysOffset, int xysLen, int[] indices, int indicesOffset, int indicesLen, int indexBase) { setTexture(tex); prepare(tint, xf); addTris(xys, sxys, xysOffset, xysLen, indices, indicesOffset, indicesLen, indexBase); }
setTexture(tex); prepare(tint, xf); addTris(xys, xysOffset, xysLen, tw, th, indices, indicesOffset, indicesLen, indexBase);
setTexture(tex); prepare(tint, xf); addTris(xys, xysOffset, xysLen, tw, th, indices, indicesOffset, indicesLen, indexBase);
protected void paintImpl (Surface surf) { // fill some shapes with patterns surf.setFillPattern(ttex).fillRect(10, 0, 100, 100); // render a sliding window of half of our triangles to test the slice rendering triangleBatch.addTris(ttex, Tint.NOOP_TINT, af, verts, offset*4, (hsamples+1)*4, ttex.width(), ttex.height(), indices, offset*6, hsamples*6, offset*2); offset += doff; if (offset == 0) doff = 1; else if (offset == hsamples) doff = -1; } private int offset = 0, doff = 1;