From 7ea0a7749e351f15120f462af004d927af7761f3 Mon Sep 17 00:00:00 2001 From: Muhammad Sheroz <52934734+sharozraees802@users.noreply.github.com> Date: Fri, 15 Dec 2023 16:01:32 +0500 Subject: [PATCH] Update function wglu-program.js --- js/wglu/wglu-program.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/wglu/wglu-program.js b/js/wglu/wglu-program.js index 911182edb..78bf72cc0 100644 --- a/js/wglu/wglu-program.js +++ b/js/wglu/wglu-program.js @@ -32,7 +32,7 @@ var WGLUProgram = (function() { "use strict"; // Attempts to allow the browser to asynchronously compile and link - var Program = function(gl) { + var Program = (gl) => { this.gl = gl; this.program = gl.createProgram(); this.attrib = null; @@ -43,7 +43,7 @@ var WGLUProgram = (function() { this._fragmentShader = null; } - Program.prototype.attachShaderSource = function(source, type) { + Program.prototype.attachShaderSource = (source, type) => { var gl = this.gl; var shader; @@ -66,7 +66,7 @@ var WGLUProgram = (function() { gl.compileShader(shader); } - Program.prototype.attachShaderSourceFromXHR = function(url, type) { + Program.prototype.attachShaderSourceFromXHR = (url, type) => { var self = this; return new Promise(function(resolve, reject) { var xhr = new XMLHttpRequest(); @@ -83,7 +83,7 @@ var WGLUProgram = (function() { }); } - Program.prototype.attachShaderSourceFromTag = function(tagId, type) { + Program.prototype.attachShaderSourceFromTag = (tagId, type) => { var shaderTag = document.getElementById(tagId); if (!shaderTag) { console.error("Shader source tag not found:", tagId); @@ -112,7 +112,7 @@ var WGLUProgram = (function() { this.attachShaderSource(src, type); } - Program.prototype.bindAttribLocation = function(attribLocationMap) { + Program.prototype.bindAttribLocation = (attribLocationMap) => { var gl = this.gl; if (attribLocationMap) { @@ -124,7 +124,7 @@ var WGLUProgram = (function() { } } - Program.prototype.transformFeedbackVaryings = function(varyings, type) { + Program.prototype.transformFeedbackVaryings = (varyings, type) => { gl.transformFeedbackVaryings(this.program, varyings, type); }