public void draw( GL2ES3 gl, Texture texture, GLEditableBuffer stBuffer, GLEditableBuffer xyBuffer, int first, int count ) { if ( texture.getTarget( ) != GL_TEXTURE_2D ) { throw new RuntimeException( "Texture has wrong target: required = GL_TEXTURE_2D, found = " + texture.getTarget( ) ); } gl.glActiveTexture( GL_TEXTURE0 ); texture.bind( gl ); gl.glUniform1i( this.handles.IMAGE, 0 ); gl.glBindBuffer( GL_ARRAY_BUFFER, stBuffer.deviceBuffer( gl ) ); gl.glVertexAttribPointer( this.handles.inSt, 2, GL_FLOAT, false, 0, 0 ); gl.glBindBuffer( GL_ARRAY_BUFFER, xyBuffer.deviceBuffer( gl ) ); gl.glVertexAttribPointer( this.handles.inXy, 2, GL_FLOAT, false, 0, 0 ); gl.glDrawArrays( GL_TRIANGLE_STRIP, first, count ); }