@Override public void doPaintTo( GlimpseContext context ) { GL3 gl = context.getGL( ).getGL3( ); Axis2D axis = requireAxis2D( context ); GlimpseBounds bounds = getBounds( context ); this.program.begin( gl ); try { this.program.setAxisOrtho( gl, axis ); this.program.setViewport( gl, bounds ); this.program.draw( gl, style, path ); } finally { this.program.end( gl ); } }
@Override protected void doDispose( GlimpseContext context ) { GL2ES2 gl = context.getGL( ).getGL2ES2( ); this.path.dispose( gl ); this.prog.dispose( gl ); } }
public LineStripExamplePainter( ) { this.strip = new LineStrip( 64 ); // Set line appearance (except for thickness, which is set in doPaintTo) this.style = new LineStyle( ); style.thickness_PX = 4; style.joinType = JOIN_MITER; style.rgba = floats( 0.7f, 0, 0, 1 ); //style.stippleEnable = true; //style.stippleScale = 2; //style.stipplePattern = 0b0001010111111111; // Create the shader program for drawing lines this.prog = new LineProgram( ); }
@Override public void doDispose( GlimpseContext context ) { GL3 gl = context.getGL( ).getGL3( ); this.program.dispose( gl ); this.path.dispose( gl ); } }
public CustomLinesPainter( Tag leftAngleTag_CWDEG, Tag rightAngleTag_CWDEG, Tag thicknessTag_PX, Tag featherTag_PX ) { // Create a path, which will be populated in doPaintTo() this.strip = new LineStrip( ); // Set line appearance this.style = new LineStyle( ); this.style.joinType = JOIN_MITER; this.style.rgba = floats( 0.7f, 0, 0, 0.5f ); // Create the shader program for drawing lines this.prog = new LineProgram( ); this.angleTagB_CWDEG = leftAngleTag_CWDEG; this.angleTagC_CWDEG = rightAngleTag_CWDEG; this.thicknessTag_PX = thicknessTag_PX; this.featherTag_PX = featherTag_PX; }
@Override public void doPaintTo( GlimpseContext context ) { GlimpseBounds bounds = getBounds( context ); Axis2D axis = requireAxis2D( context ); GL2ES3 gl = context.getGL( ).getGL2ES3( ); enableStandardBlending( gl ); prog.begin( gl ); try { // Tell the shader program the pixel-size of our viewport prog.setViewport( gl, bounds ); // Tell the shader program that our line coords will be in xy-axis space prog.setAxisOrtho( gl, axis ); // Do the actual drawing prog.draw( gl, style, path, ppvAspectRatio( axis ) ); } finally { prog.end( gl ); disableBlending( gl ); } }
@Override protected void doDispose( GlimpseContext context ) { GL2ES2 gl = context.getGL( ).getGL2ES2( ); this.strip.dispose( gl ); this.prog.dispose( gl ); } }
public ContourPainter( float[] coordsX, float[] coordsY ) { this.path = new LinePath( ); this.style = new LineStyle( ); this.program = new LineProgram( ); this.coordsX = coordsX; this.coordsY = coordsY; int size = Math.min( coordsX.length, coordsY.length ); for ( int i = 0; i < size - 1; i += 2 ) { this.path.moveTo( coordsX[i], coordsY[i] ); this.path.lineTo( coordsX[i + 1], coordsY[i + 1] ); } }
prog.begin( gl ); try prog.setViewport( gl, bounds ); prog.setAxisOrtho( gl, axis ); prog.draw( gl, style, path, ppvAspectRatio( axis ) ); prog.end( gl ); disableBlending( gl );
@Override protected void doDispose( GlimpseContext context ) { GL2ES2 gl = context.getGL( ).getGL2ES2( ); this.strip.dispose( gl ); this.prog.dispose( gl ); } }
this.prog = new LineProgram( );
this.prog.begin( gl ); try this.prog.setViewport( gl, bounds ); this.prog.setAxisOrtho( gl, axis ); this.prog.draw( gl, this.style, this.strip, ppvAspectRatio( axis ) ); this.prog.end( gl ); disableBlending( gl );
@Override protected void doDispose( GlimpseContext context ) { GL2ES2 gl = context.getGL( ).getGL2ES2( ); this.path.dispose( gl ); this.prog.dispose( gl ); } }
this.prog.begin( gl ); try this.prog.setViewport( gl, bounds ); this.prog.setAxisOrtho( gl, axis ); this.prog.draw( gl, this.style, this.strip, ppvAspectRatio( axis ) ); this.prog.end( gl ); disableBlending( gl );