MCPcopy
hub / github.com/jscad/OpenJSCAD.org / compileSource

Function compileSource

src/ui/viewer/lightgl.js:905–913  ·  view source on GitHub ↗
(type, source)

Source from the content-addressed store, hash-verified

903
904
905 function compileSource(type, source) {
906 var shader = gl.createShader(type);
907 gl.shaderSource(shader, source);
908 gl.compileShader(shader);
909 if(!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
910 throw 'compile error: ' + gl.getShaderInfoLog(shader);
911 }
912 return shader;
913 }
914 this.program = gl.createProgram();
915 gl.attachShader(this.program, compileSource(gl.VERTEX_SHADER, vertexSource));
916 gl.attachShader(this.program, compileSource(gl.FRAGMENT_SHADER, fragmentSource));

Callers 1

ShaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected