Ejemplo n.º 1
0
  @Override
  public Surface fillTriangles(float[] xys, int[] indices) {
    bindFramebuffer();

    GLShader shader = ctx.trisShader(this.shader);
    if (fillPattern != null) {
      int tex = fillPattern.ensureTexture(true, true);
      if (tex > 0) {
        shader.prepareTexture(tex, tint);
        shader.addTriangles(
            topTransform(), xys, fillPattern.width(), fillPattern.height(), indices);
      }
    } else {
      shader.prepareColor(Tint.combine(fillColor, tint));
      shader.addTriangles(topTransform(), xys, 1, 1, indices);
    }
    return this;
  }
Ejemplo n.º 2
0
  @Override
  public Surface fillTriangles(float[] xys, float[] sxys, int[] indices) {
    bindFramebuffer();

    if (fillPattern == null) throw new IllegalStateException("No fill pattern currently set");
    int tex = fillPattern.ensureTexture();
    if (tex > 0) {
      GLShader shader = ctx.trisShader(this.shader).prepareTexture(tex, tint);
      shader.addTriangles(topTransform(), xys, sxys, indices);
    }
    return this;
  }