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 protected void doDispose( GlimpseContext context ) { GL2ES2 gl = context.getGL( ).getGL2ES2( ); this.strip.dispose( gl ); this.prog.dispose( gl ); } }
float x = strip.logicalSize( ); float y = x + 10*( random.nextFloat( ) - 0.5f ); strip.grow1( x, y ); int iPerturb = strip.logicalSize( ) / 4; float xPerturb = iPerturb; float yPerturb = xPerturb + 10*( random.nextFloat( ) - 0.5f ); strip.edit( iPerturb, 1 ).put( xPerturb ).put( yPerturb );
@Override protected void doDispose( GlimpseContext context ) { GL2ES2 gl = context.getGL( ).getGL2ES2( ); this.strip.dispose( gl ); this.prog.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; }