1(window.onresize = () => {
2 canvas.width = innerWidth, canvas.height = innerHeight;
3})();
1function resize() {
2 canvas.width = window.innerWidth;
3 canvas.height = window.innerHeight;
4 render();
5}
6window.addEventListener('resize', resize, false); resize();
7function render() { // draw to screen here
8}