-
Notifications
You must be signed in to change notification settings - Fork 0
/
webgl.html
44 lines (36 loc) · 1.33 KB
/
webgl.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
<!DOCTYPE html>
<title>WebGL Demo</title>
<script src="../javascripts/linq.min.js"></script>
<script src="../javascripts/visualbasic.wasm.min.js"></script>
<script src="../javascripts/webgl.render.min.js"></script>
<body style="margin:0; overflow: hidden">
<canvas id="canvas" style="width: 100vw; height: 100vh; display:block;"></canvas>
</body>
<script>
vanilla.Wasm.showDebugMessage(false);
vanilla.Wasm.RunAssembly("../vbscripts/Elastic_collision.wasm", {
run: engine => {
var buffer = engine.memory.buffer;
var circleCount = engine.Algorithm.getCircleCount();
var arrayPtr = engine.Algorithm.getCircleDataOffset() + 8;
console.log(engine);
console.log(`${arrayPtr}/4=${arrayPtr/4}`)
//var circleData = new Float32Array(buffer, arrayPtr, circleCount * 3);
//var canvas = $ts("#canvas");
//var render = new webgl.render(
// canvas,
// engine.Algorithm.timeStep,
// engine.Algorithm.init,
/// circleData,
// circleCount
// );
engine.Algorithm.init(1920,1080);
WebAssembly.GarbageCollection.summary();
console.log(WebAssembly.ObjectManager.getObject(1176));
console.log(engine.GetMemorySize())
// render.run();
},
api: { console: true, text: true, array: true },
page: { init: 1024, max: 20480 }
});
</script>