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