aboutsummaryrefslogtreecommitdiff
path: root/src/main.ts
blob: c2359296e5a5d62f5c31dbbcd05f72d02d5bbfcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import * as Scene from 'view/scene'

let scene: Scene.State = Scene.init()

function loop(timestamp: number) {
  Scene.update(scene, timestamp)
  Scene.view(scene)
  window.requestAnimationFrame(loop)
}

window.requestAnimationFrame(loop)

window.onresize = () => Scene.resize(
  scene,
  { width: window.innerWidth,
    height: window.innerHeight
  }
)