Socket
Socket
Sign inDemoInstall

webgl-framework

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webgl-framework - npm Package Compare versions

Comparing version 2.0.1-beta to 2.0.2-beta

25

dist/lib/BaseShader.js

@@ -9,4 +9,4 @@ "use strict";

this.gl = gl;
this.vertexShaderCode = "";
this.fragmentShaderCode = "";
this.vertexShaderCode = '';
this.fragmentShaderCode = '';
this.fillCode();

@@ -25,3 +25,3 @@ this.initShader();

if (!shader) {
console.warn("Error creating shader.");
console.warn('Error creating shader.');
return undefined;

@@ -38,12 +38,18 @@ }

/**
* Get shader unform location
* Get shader unform location.
*
* @param uniform Uniform name
* @return Uniform location
* @param uniform Uniform name.
* @return Uniform location.
*/
getUniform(uniform) {
if (this.program === undefined) {
throw new Error("No program for shader.");
throw new Error('No program for shader.');
}
return this.gl.getUniformLocation(this.program, uniform);
const result = this.gl.getUniformLocation(this.program, uniform);
if (result !== null) {
return result;
}
else {
throw new Error(`Cannot get uniform "${uniform}".`);
}
}

@@ -58,3 +64,3 @@ /**

if (this.program === undefined) {
throw new Error("No program for shader.");
throw new Error('No program for shader.');
}

@@ -104,3 +110,2 @@ return this.gl.getAttribLocation(this.program, attrib);

exports.BaseShader = BaseShader;
;
//# sourceMappingURL=BaseShader.js.map

8

dist/types/BaseShader.d.ts

@@ -27,8 +27,8 @@ export declare abstract class BaseShader {

/**
* Get shader unform location
* Get shader unform location.
*
* @param uniform Uniform name
* @return Uniform location
* @param uniform Uniform name.
* @return Uniform location.
*/
getUniform(uniform: string): WebGLUniformLocation | null;
getUniform(uniform: string): WebGLUniformLocation;
/**

@@ -35,0 +35,0 @@ * Get shader attribute location

@@ -154,4 +154,4 @@ class FullScreenUtils {

this.gl = gl;
this.vertexShaderCode = "";
this.fragmentShaderCode = "";
this.vertexShaderCode = '';
this.fragmentShaderCode = '';
this.fillCode();

@@ -170,3 +170,3 @@ this.initShader();

if (!shader) {
console.warn("Error creating shader.");
console.warn('Error creating shader.');
return undefined;

@@ -183,12 +183,18 @@ }

/**
* Get shader unform location
* Get shader unform location.
*
* @param uniform Uniform name
* @return Uniform location
* @param uniform Uniform name.
* @return Uniform location.
*/
getUniform(uniform) {
if (this.program === undefined) {
throw new Error("No program for shader.");
throw new Error('No program for shader.');
}
return this.gl.getUniformLocation(this.program, uniform);
const result = this.gl.getUniformLocation(this.program, uniform);
if (result !== null) {
return result;
}
else {
throw new Error(`Cannot get uniform "${uniform}".`);
}
}

@@ -203,3 +209,3 @@ /**

if (this.program === undefined) {
throw new Error("No program for shader.");
throw new Error('No program for shader.');
}

@@ -206,0 +212,0 @@ return this.gl.getAttribLocation(this.program, attrib);

@@ -160,4 +160,4 @@ (function (global, factory) {

this.gl = gl;
this.vertexShaderCode = "";
this.fragmentShaderCode = "";
this.vertexShaderCode = '';
this.fragmentShaderCode = '';
this.fillCode();

@@ -176,3 +176,3 @@ this.initShader();

if (!shader) {
console.warn("Error creating shader.");
console.warn('Error creating shader.');
return undefined;

@@ -189,12 +189,18 @@ }

/**
* Get shader unform location
* Get shader unform location.
*
* @param uniform Uniform name
* @return Uniform location
* @param uniform Uniform name.
* @return Uniform location.
*/
getUniform(uniform) {
if (this.program === undefined) {
throw new Error("No program for shader.");
throw new Error('No program for shader.');
}
return this.gl.getUniformLocation(this.program, uniform);
const result = this.gl.getUniformLocation(this.program, uniform);
if (result !== null) {
return result;
}
else {
throw new Error(`Cannot get uniform "${uniform}".`);
}
}

@@ -209,3 +215,3 @@ /**

if (this.program === undefined) {
throw new Error("No program for shader.");
throw new Error('No program for shader.');
}

@@ -212,0 +218,0 @@ return this.gl.getAttribLocation(this.program, attrib);

{
"name": "webgl-framework",
"version": "2.0.1-beta",
"version": "2.0.2-beta",
"description": "Basic low-level WebGL framework",

@@ -5,0 +5,0 @@ "author": "Oleksandr Popov (github.com/keaukraine/)",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc