Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webglew

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webglew - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

7

package.json
{
"name": "webglew",
"version": "0.0.0",
"version": "1.0.0",
"description": "WebGL extension wrangler",

@@ -26,3 +26,6 @@ "main": "webglew.js",

"readmeFilename": "README.md",
"gitHead": "c561ef237cb3b66576b0e9e599f729628a209649"
"gitHead": "c561ef237cb3b66576b0e9e599f729628a209649",
"dependencies": {
"weakmap": "0.0.6"
}
}
webglew
=======
*WebGL* *E*xtension *W*rangler. Manages WebGL extensions so you don't have to.
**WebGL** **E** xtension **W** rangler. Manages WebGL extensions so you don't have to.

@@ -5,0 +5,0 @@ Usage

"use strict";
var VENDOR_PREFIX = [
"WEBKIT_",
"MOZ_"
];
var WeakMap = WeakMap || require("weakmap")
var WebGLEWStruct = new WeakMap()
function baseName(ext_name) {
for(var i=0; i<VENDOR_PREFIX.length; ++i) {
var prefix = VENDOR_PREFIX[i];
if(ext_name.indexOf(prefix) === 0) {
return ext_name.slice(prefix.length);
}
}
return ext_name;
return ext_name.replace(/^[A-Z]+_/, "")
}
function initWebGLEW(gl) {
if(gl._webglew_struct) {
return gl._webglew_struct;
var struct = WebGLEWStruct.get(gl)
if(struct) {
return struct
}
var extensions = {};
var supported = gl.getSupportedExtensions();
var extensions = {}
var supported = gl.getSupportedExtensions()
for(var i=0; i<supported.length; ++i) {
var ext = gl.getExtension(supported[i]);
var extName = supported[i]
var ext = gl.getExtension(supported[i])
if(!ext) {
continue;
continue
}
extensions[supported[i]] = ext;
extensions[baseName(supported[i])] = ext; //Add version without VENDOR
while(true) {
extensions[extName] = ext
var base = baseName(extName)
if(base === extName) {
break
}
extName = base
}
}
gl._webglew_struct = extensions;
return extensions;
WebGLEWStruct.set(gl, extensions)
return extensions
}
module.exports = initWebGLEW;
module.exports = initWebGLEW
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