public void apply(GOut g) { BGL gl = g.gl; gl.glFogi(GL2.GL_FOG_MODE, GL2.GL_LINEAR); gl.glFogf(GL2.GL_FOG_START, s); gl.glFogf(GL2.GL_FOG_END, e); gl.glFogfv(GL2.GL_FOG_COLOR, ca, 0); gl.glEnable(GL2.GL_FOG); }
public void prect(Coord c, Coord ul, Coord br, double a) { st.set(cur2d); apply(); gl.glEnable(GL2.GL_POLYGON_SMOOTH); gl.glBegin(GL.GL_TRIANGLE_FAN); vertex(c); vertex(c.add(0, ul.y)); double p2 = Math.PI / 2; all: { float tc; tc = (float) (Math.tan(a) * -ul.y); if ((a > p2) || (tc > br.x)) { vertex(c.x + br.x, c.y + ul.y); } else { vertex(c.x + tc, c.y + ul.y); break all; } tc = (float) (Math.tan(a - (Math.PI / 2)) * br.x); if ((a > p2 * 2) || (tc > br.y)) { vertex(c.x + br.x, c.y + br.y); } else { vertex(c.x + br.x, c.y + tc); break all; } tc = (float) (-Math.tan(a - Math.PI) * br.y); if ((a > p2 * 3) || (tc < ul.x)) { vertex(c.x + ul.x, c.y + br.y); } else { vertex(c.x + tc, c.y + br.y); break all; } tc = (float) (-Math.tan(a - (3 * Math.PI / 2)) * -ul.x); if ((a > p2 * 4) || (tc < ul.y)) { vertex(c.x + ul.x, c.y + ul.y); } else { vertex(c.x + ul.x, c.y + tc); break all; } tc = (float) (Math.tan(a) * -ul.y); vertex(c.x + tc, c.y + ul.y); } gl.glEnd(); gl.glDisable(GL2.GL_POLYGON_SMOOTH); checkerr(); }
public void apply(GOut g) { BGL gl = g.gl; gl.glPolygonOffset(factor, units); gl.glEnable(mode); }
public void apply(GOut g) { BGL gl = g.gl; gl.glEnable(GL.GL_SAMPLE_COVERAGE); gl.glSampleCoverage(cov, inv); }