Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update function wglu-program.js #173

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions js/wglu/wglu-program.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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();
Expand All @@ -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);
Expand Down Expand Up @@ -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) {
Expand All @@ -124,7 +124,7 @@ var WGLUProgram = (function() {
}
}

Program.prototype.transformFeedbackVaryings = function(varyings, type) {
Program.prototype.transformFeedbackVaryings = (varyings, type) => {
gl.transformFeedbackVaryings(this.program, varyings, type);
}

Expand Down