summaryrefslogtreecommitdiff
path: root/WebInterface/wasm/webhogg/loader.js
blob: 51c43545e71655ffbafe842501b43b69eb6f81a9 (plain)
1
2
3
4
5
6
7
8
9
let canvas = document.getElementById('canvas');

let game_logic = new Worker(
    './game_logic.js',
    {type: 'module', credentials: 'include'}
);

let ofc = canvas.transferControlToOffscreen();
game_logic.postMessage({canvas: ofc}, [ofc]);