audio-vis/raw/javascript/app.js
2020-08-01 21:51:54 +02:00

32 lines
798 B
JavaScript

const shaderHandler = new ShaderHandler(null),
audioHandler = new AudioHandler(),
gui = new GUI(),
visual = new VisualDrawer(),
template = new Template(),
player = new Player(),
config = new Config();
let c = null,
gl = null;
async function startUP() {
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", "water"], 'shaders/');
await audioHandler.init();
await player.init();
await visual.init();
await gui.init();
await initHandler();
}
startUP().then(r => {
setTimeout(e => {
$('.loading-screen').remove();
}, 100)
});