24 lines
616 B
JavaScript
24 lines
616 B
JavaScript
|
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)
|
||
|
});
|