-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathindex.html
36 lines (28 loc) · 864 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
</head>
<body>
<div id="webgl-water-tutorial"> </div>
<script src='/webgl_water_tutorial.js'></script>
<script>
window.addEventListener('load', function () {
window.wasm_bindgen('/webgl_water_tutorial_bg.wasm')
.then(function () {
// Start our rust application. You can find `WebClient` in `src/lib.rs`
const webClient = new window.wasm_bindgen.WebClient()
webClient.start()
let time = Date.now();
function render () {
const dt = Date.now() - time
webClient.update(dt)
webClient.render()
window.requestAnimationFrame(render)
time = Date.now()
}
render()
})
})
</script>
</body>
</html>