StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
616 B
29 lines
616 B
4 years ago
|
var shell = require("gl-now")()
|
||
|
var createStateStack = require("../savestate")
|
||
|
|
||
|
var stack
|
||
|
|
||
|
shell.on("gl-init", function() {
|
||
|
|
||
|
//Create stack for saving state
|
||
|
stack = createStateStack(shell.gl)
|
||
|
|
||
|
//Push variables onto stack here
|
||
|
stack.push()
|
||
|
//... clobber stuff here ...
|
||
|
shell.gl.clearColor(1, 0, 1, 0);
|
||
|
|
||
|
//Context states can also be nested
|
||
|
stack.push()
|
||
|
// ... clobbber more stuff
|
||
|
shell.gl.clearColor(0, 1, 0, 1)
|
||
|
stack.pop()
|
||
|
|
||
|
//Color back to previous value
|
||
|
console.log(shell.gl.getParameter(shell.gl.COLOR_CLEAR_VALUE))
|
||
|
|
||
|
//Restore state
|
||
|
stack.pop()
|
||
|
|
||
|
//Now state is completely restored
|
||
|
})
|