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

webgl-debug

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webgl-debug

WebGL Debug Utils

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

webgl-debug

stable

WebGL Debug Utils. This is a node port of WebGLDeveloperTools by Khronos Group.

Usage

NPM

var WebGLDebugUtil = require('webgl-debug');

Examples

Get error code string representation.

var WebGLDebugUtil = require('webgl-debug');

var str = WebGLDebugUtil.glEnumToString(gl.getError());

Create debug context that will throw error on invalid WebGL operation.

var WebGLDebugUtil = require('webgl-debug');

function throwOnGLError(err, funcName, args) {
   throw WebGLDebugUtils.glEnumToString(err) 
   + "was caused by call to " 
   + funcName;
};


gl = WebGLDebugUtils.makeDebugContext(gl, throwOnGLError);

Tutorial

WebGL Wiki: Debugging

API

init()

Initializes this module. Safe to call more than once.

mightBeEnum(value)

Returns true or false if value matches any WebGL enum

glEnumToString(value)

Gets an string version of an WebGL enum.

glFunctionArgToString(functionName, numArgs, argumentIndx, value)

Converts the argument of a WebGL function to a string

glFunctionArgsToString(functionName, args)

Converts the arguments of a WebGL function to a string.

makeDebugContext(ctx, onErrorCb, onFuncCallCb)

returns a wrapped context that calls gl.getError after every command and calls a function if the result is not NO_ERROR

makeLostContextSimulatingCanvas(canvas)

returns a wrapped canvas element that will simulate lost context

resetToInitialState(gl)

Resets a context to the initial state

License

MIT, see LICENSE.md for details.

Keywords

FAQs

Package last updated on 23 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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