-
Notifications
You must be signed in to change notification settings - Fork 1
/
osx.html
56 lines (47 loc) · 1.16 KB
/
osx.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html charset=utf-8">
<style>
body {
background-color: #333;
color: #eee;
}
</style>
</head>
<body>
<div id="title">
Web layer for OSX
</div>
<script>
window.isOSX = true
window.Module = {
// In the web build, these bindings are generated by embind.
createBuffer: async function(bytes) {
const result = await _OSXcreateBuffer(bytes);
return result.pointer
},
sendMessageToCPP: (json) => {
_OSXsendMessageToCPP(json)
},
// and (in web) this utility is available directly.
HEAP8: {
set: (data, pointer) => {
const encodedData = btoa(Array.prototype.map.call(data, function (ch) {
return String.fromCharCode(ch);
}).join(''));
_OSXheap8Set(encodedData, pointer);
}
}
}
</script>
<!-- Call the app code as generated by TS -->
<script src='output/app.js'></script>
<script>
setInterval(() => {
document.getElementById('title').innerText += '.';
}, 500);
</script>
</body>
</html>