gl-wiretap
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -30,2 +30,3 @@ export interface IGLWiretapOptions { | ||
toString(): string; | ||
getContextVariableName(value: any): string; | ||
} | ||
@@ -32,0 +33,0 @@ |
@@ -34,2 +34,3 @@ /** | ||
case 'toString': return toString; | ||
case 'getContextVariableName': return getContextVariableName; | ||
} | ||
@@ -203,2 +204,10 @@ if (typeof gl[property] === 'function') { | ||
} | ||
function getContextVariableName(value) { | ||
const i = contextVariables.indexOf(value); | ||
if (i !== -1) { | ||
return `${contextName}Variable${i}`; | ||
} | ||
return null; | ||
} | ||
} | ||
@@ -205,0 +214,0 @@ |
{ | ||
"name": "gl-wiretap", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "A gl debugger that listens and replays gl (WebGL, WebGL2, and HeadlessGL) gpu commands", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -68,2 +68,17 @@ # gl-wiretap | ||
### glWiretap().getReadPixelsVariableName() | ||
Gets the last internal variable name used as a target value for `gl.readPixels()` | ||
### glWiretap().insertVariable(name, value) | ||
Insert a value into the `glWiretap()` playback string. | ||
### glWiretap().reset() | ||
Reset the playback string. | ||
### glWiretap().setIndent(spaces) | ||
Set the playback indentation. Useful for formatting results. | ||
### glWiretap().getContextVariableName(value) | ||
Get a variable name from the context. Useful for adding additional functionality to, for example, textures, etc. | ||
## glWiretap options | ||
@@ -70,0 +85,0 @@ * contextName: String - A string that refers to the gl context for `glWiretap().toString()` |
19710
388
95