audio-vis/raw/javascript/app.js

24 lines
616 B
JavaScript
Raw Normal View History

2020-04-07 21:44:46 +02:00
const shaderHandler = new ShaderHandler(null),
audioHandler = new AudioHandler(),
gui = new GUI(),
player = new Player();
async function startUP() {
let c = document.body.querySelector('#c'),
gl = c.getContext("webgl2");
if (!gl) {
alert("SORRY THE BROWSER DOESN'T SUPPORT WEBGL2");
return false;
}
shaderHandler.setGL(gl)
await shaderHandler.loadArray(["wave", "sphere"], 'shaders/');
await audioHandler.init();
await player.init();
gui.init();
}
startUP().then(r => {
setTimeout(e => {
$('.loading-screen').remove();
}, 100)
});