diff --git a/lib/make/webgl.js b/lib/make/webgl.js index 5941cb9..3a54814 100644 --- a/lib/make/webgl.js +++ b/lib/make/webgl.js @@ -57,7 +57,7 @@ class webgl extends make { return random.item(sources) } - match (shader, regex, group = 1) { + static match (shader, regex, group = 1) { let matches = [] let match while (match = regex.exec(shader)) { @@ -68,33 +68,33 @@ class webgl extends make { static parseUniforms (shader, group = 1) { /* Todo: Parse their individual data types into categories. */ - return match(shader, /uniform .+? (\w+)(?=[\[;])/gm, group) + return webgl.match(shader, /uniform .+? (\w+)(?=[\[;])/gm, group) } static parseAttributes (shader, group = 1) { - return match(shader, /attribute .+? (\w+)(?=;)/gm, group) + return webgl.match(shader, /attribute .+? (\w+)(?=;)/gm, group) } static parseVaryings (shader, group = 1) { - return match(shader, /varying .+? (\w+)(?=;)/gm, group) + return webgl.match(shader, /varying .+? (\w+)(?=;)/gm, group) } static parseFragDatav2 (shader, group = 1) { // #version 200 - return match(shader, /(gl_Frag[^[ =]+)/gm, group) + return webgl.match(shader, /(gl_Frag[^[ =]+)/gm, group) } static parseFragDatav3 (shader, group = 1) { // #version 300 - return match(shader, /out .+? (\w+)(?=[\[;])/gm, group) + return webgl.match(shader, /out .+? (\w+)(?=[\[;])/gm, group) } static parseFrag (shader, group = 1) { - let matches = parseFragDatav2(shader) + let matches = webgl.parseFragDatav2(shader) if (matches.length) { return matches } - return parseFragDatav3(shader) + return webgl.parseFragDatav3(shader) } static randomBitmask () {