vislite
Version:
灵活、快速、简单的数据可视化交互式跨端前端库
1 lines • 768 B
JavaScript
var r=function(r,e,t){var a=r.createShader(e);if(null==a)throw new Error("Unable to create shader!");if(r.shaderSource(a,t),r.compileShader(a),!r.getShaderParameter(a,r.COMPILE_STATUS))throw new Error("Failed to compile shader:"+r.getShaderInfoLog(a));return a},e=function(){function e(r){this.__painter=r}return e.prototype.use=function(){return this.__painter.useProgram(this.program),this},e.prototype.compile=function(e,t){return this.program=function(e,t,a){var o=r(e,e.VERTEX_SHADER,t),n=r(e,e.FRAGMENT_SHADER,a),i=e.createProgram();if(e.attachShader(i,o),e.attachShader(i,n),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS))throw new Error("Failed to link program: "+e.getProgramInfoLog(i));return i}(this.__painter,e,t),this},e}();export{e as default};