Skip to content

Commit

Permalink
rename api executeC to callC
Browse files Browse the repository at this point in the history
  • Loading branch information
twiddlingbits committed Mar 26, 2024
1 parent cffbf14 commit cc98aba
Show file tree
Hide file tree
Showing 77 changed files with 267 additions and 267 deletions.
4 changes: 2 additions & 2 deletions azure/examples/balls/async.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h2>tiny-wasm-runtime</h2>

const mod=new twrWasmModuleAsync();
await mod.loadWasm('balls-a.wasm');
await mod.executeC(["bounce_balls_init", ballSpeed]);
await mod.callC(["bounce_balls_init", ballSpeed]);

let lastTime;

Expand All @@ -75,7 +75,7 @@ <h2>tiny-wasm-runtime</h2>
else
intervalTimeMs=timeStamp-lastTime;
lastTime=timeStamp;
mod.executeC(["bounce_balls_move", intervalTimeMs]).then(()=>{
mod.callC(["bounce_balls_move", intervalTimeMs]).then(()=>{
window.requestAnimationFrame(moveBalls);
});
}
Expand Down
2 changes: 1 addition & 1 deletion azure/examples/balls/dist/async.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"whatkey": "../../lib-js/whatkey.js"
}
}
</script></head><body style="background-color:#fff;font-family:Arial"> <div id="top"> <h1>Bouncing Balls</h1> <h2>tiny-wasm-runtime</h2> <div id="errorMsg" style="color:red"></div> <ul> <li>written in C++</li> <li>using 2D draw APIs which correspond to Javascript Canvas APIs</li> <li>source code: <a href="https://github.com/twiddlingbits/tiny-wasm-runtime/tree/main/examples/balls">here on github</a></li> <li>more <a href="https://twiddlingbits.dev/examples/index.html">examples here</a></li> </ul> <br> </div> <canvas id="twr_d2dcanvas" style="background-color:#fff"></canvas> <script type="module">let e;var r=globalThis,t={},n={},o=r.parcelRequire94c2;null==o&&((o=function(e){if(e in t)return t[e].exports;if(e in n){var r=n[e];delete n[e];var o={id:e,exports:{}};return t[e]=o,r.call(o.exports,o,o.exports),o.exports}var s=Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s}).register=function(e,r){n[e]=r},r.parcelRequire94c2=o),o.register;var s=o("4mNsm");"file:///async.html".startsWith("file:")&&!HTMLScriptElement.supports("importmap")&&(document.getElementById("errorMsg").innerHTML+="ERROR: This browser does not support script type='importmap'. These demos will not work. <br>"),window.WebAssembly||(document.getElementById("errorMsg").innerHTML+="ERROR: This browser does not support Web Assembly. <br>"),crossOriginIsolated||"file:"===window.location.protocol||(document.getElementById("errorMsg").innerHTML+="WARNING: twrWasmModuleAsync examples need crossOriginIsolated. See tiny-wasm-runtime or SharedArrayBuffer docs. <br>"),window.SharedArrayBuffer||(document.getElementById("errorMsg").innerHTML+="WARNING: twrWasmModuleAsync examples use SharedArrayBuffer but SharedArrayBuffer is not available in this browser. See tiny-wasm-runtime or SharedArrayBuffer docs. <br>");const i=document.getElementById("twr_d2dcanvas"),a=document.getElementById("top");let l=a.clientWidth-20,d=window.innerHeight-a.clientHeight-40;l>1200&&(l=1200),l<150&&(l=150),d>1200&&(d=1200),d<150&&(d=150),i.setAttribute("width",l),i.setAttribute("height",d);const m=new s.twrWasmModuleAsync;await m.loadWasm("balls-a.wasm"),await m.executeC(["bounce_balls_init",.3]);const u=r=>{let t;t=void 0===e?16:r-e,e=r,m.executeC(["bounce_balls_move",t]).then(()=>{window.requestAnimationFrame(u)})};window.requestAnimationFrame(u);</script> </body>
</script></head><body style="background-color:#fff;font-family:Arial"> <div id="top"> <h1>Bouncing Balls</h1> <h2>tiny-wasm-runtime</h2> <div id="errorMsg" style="color:red"></div> <ul> <li>written in C++</li> <li>using 2D draw APIs which correspond to Javascript Canvas APIs</li> <li>source code: <a href="https://github.com/twiddlingbits/tiny-wasm-runtime/tree/main/examples/balls">here on github</a></li> <li>more <a href="https://twiddlingbits.dev/examples/index.html">examples here</a></li> </ul> <br> </div> <canvas id="twr_d2dcanvas" style="background-color:#fff"></canvas> <script type="module">let e;var r=globalThis,t={},n={},o=r.parcelRequire94c2;null==o&&((o=function(e){if(e in t)return t[e].exports;if(e in n){var r=n[e];delete n[e];var o={id:e,exports:{}};return t[e]=o,r.call(o.exports,o,o.exports),o.exports}var s=Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s}).register=function(e,r){n[e]=r},r.parcelRequire94c2=o),o.register;var s=o("4mNsm");"file:///async.html".startsWith("file:")&&!HTMLScriptElement.supports("importmap")&&(document.getElementById("errorMsg").innerHTML+="ERROR: This browser does not support script type='importmap'. These demos will not work. <br>"),window.WebAssembly||(document.getElementById("errorMsg").innerHTML+="ERROR: This browser does not support Web Assembly. <br>"),crossOriginIsolated||"file:"===window.location.protocol||(document.getElementById("errorMsg").innerHTML+="WARNING: twrWasmModuleAsync examples need crossOriginIsolated. See tiny-wasm-runtime or SharedArrayBuffer docs. <br>"),window.SharedArrayBuffer||(document.getElementById("errorMsg").innerHTML+="WARNING: twrWasmModuleAsync examples use SharedArrayBuffer but SharedArrayBuffer is not available in this browser. See tiny-wasm-runtime or SharedArrayBuffer docs. <br>");const i=document.getElementById("twr_d2dcanvas"),a=document.getElementById("top");let l=a.clientWidth-20,d=window.innerHeight-a.clientHeight-40;l>1200&&(l=1200),l<150&&(l=150),d>1200&&(d=1200),d<150&&(d=150),i.setAttribute("width",l),i.setAttribute("height",d);const m=new s.twrWasmModuleAsync;await m.loadWasm("balls-a.wasm"),await m.callC(["bounce_balls_init",.3]);const u=r=>{let t;t=void 0===e?16:r-e,e=r,m.callC(["bounce_balls_move",t]).then(()=>{window.requestAnimationFrame(u)})};window.requestAnimationFrame(u);</script> </body>
2 changes: 1 addition & 1 deletion azure/examples/balls/dist/index.528b9ee5.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion azure/examples/balls/dist/index.528b9ee5.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion azure/examples/balls/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"whatkey": "../../lib-js/whatkey.js"
}
}
</script></head><body style="background-color:#fff;font-family:Arial"> <div id="top"> <h1>Bouncing Balls</h1> <h2>tiny-wasm-runtime</h2> <div id="errorMsg" style="color:red"></div> <ul> <li>written in C++</li> <li>using 2D draw APIs which correspond to Javascript Canvas APIs</li> <li>source code: <a href="https://github.com/twiddlingbits/tiny-wasm-runtime/tree/main/examples/balls">here on github</a></li> <li>more <a href="https://twiddlingbits.dev/examples/index.html">examples here</a></li> </ul> <br> </div> <canvas id="twr_d2dcanvas" style="background-color:#fff"></canvas> <script type="module">let e;var r=globalThis,t={},n={},o=r.parcelRequire94c2;null==o&&((o=function(e){if(e in t)return t[e].exports;if(e in n){var r=n[e];delete n[e];var o={id:e,exports:{}};return t[e]=o,r.call(o.exports,o,o.exports),o.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,r){n[e]=r},r.parcelRequire94c2=o),o.register;var i=o("4mNsm");"file:///index.html".startsWith("file:")&&!HTMLScriptElement.supports("importmap")&&(document.getElementById("errorMsg").innerHTML+="ERROR: This browser does not support script type='importmap'. These demos will not work. <br>"),window.WebAssembly||(document.getElementById("errorMsg").innerHTML+="ERROR: This browser does not support Web Assembly. <br>"),crossOriginIsolated||"file:"===window.location.protocol||(document.getElementById("errorMsg").innerHTML+="WARNING: twrWasmModuleAsync examples need crossOriginIsolated. See tiny-wasm-runtime or SharedArrayBuffer docs. <br>"),window.SharedArrayBuffer||(document.getElementById("errorMsg").innerHTML+="WARNING: twrWasmModuleAsync examples use SharedArrayBuffer but SharedArrayBuffer is not available in this browser. See tiny-wasm-runtime or SharedArrayBuffer docs. <br>");const s=document.getElementById("twr_d2dcanvas"),a=document.getElementById("top");let l=a.clientWidth-20,d=window.innerHeight-a.clientHeight-40;l>1200&&(l=1200),l<150&&(l=150),d>1200&&(d=1200),d<150&&(d=150),s.setAttribute("width",l),s.setAttribute("height",d);const m=new i.twrWasmModule;await m.loadWasm("balls.wasm"),await m.executeC(["bounce_balls_init",.3]);const u=r=>{let t;t=void 0===e?16:r-e,e=r,m.executeC(["bounce_balls_move",t]).then(()=>{window.requestAnimationFrame(u)})};window.requestAnimationFrame(u);</script> </body>
</script></head><body style="background-color:#fff;font-family:Arial"> <div id="top"> <h1>Bouncing Balls</h1> <h2>tiny-wasm-runtime</h2> <div id="errorMsg" style="color:red"></div> <ul> <li>written in C++</li> <li>using 2D draw APIs which correspond to Javascript Canvas APIs</li> <li>source code: <a href="https://github.com/twiddlingbits/tiny-wasm-runtime/tree/main/examples/balls">here on github</a></li> <li>more <a href="https://twiddlingbits.dev/examples/index.html">examples here</a></li> </ul> <br> </div> <canvas id="twr_d2dcanvas" style="background-color:#fff"></canvas> <script type="module">let e;var r=globalThis,t={},n={},o=r.parcelRequire94c2;null==o&&((o=function(e){if(e in t)return t[e].exports;if(e in n){var r=n[e];delete n[e];var o={id:e,exports:{}};return t[e]=o,r.call(o.exports,o,o.exports),o.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,r){n[e]=r},r.parcelRequire94c2=o),o.register;var i=o("4mNsm");"file:///index.html".startsWith("file:")&&!HTMLScriptElement.supports("importmap")&&(document.getElementById("errorMsg").innerHTML+="ERROR: This browser does not support script type='importmap'. These demos will not work. <br>"),window.WebAssembly||(document.getElementById("errorMsg").innerHTML+="ERROR: This browser does not support Web Assembly. <br>"),crossOriginIsolated||"file:"===window.location.protocol||(document.getElementById("errorMsg").innerHTML+="WARNING: twrWasmModuleAsync examples need crossOriginIsolated. See tiny-wasm-runtime or SharedArrayBuffer docs. <br>"),window.SharedArrayBuffer||(document.getElementById("errorMsg").innerHTML+="WARNING: twrWasmModuleAsync examples use SharedArrayBuffer but SharedArrayBuffer is not available in this browser. See tiny-wasm-runtime or SharedArrayBuffer docs. <br>");const s=document.getElementById("twr_d2dcanvas"),a=document.getElementById("top");let l=a.clientWidth-20,d=window.innerHeight-a.clientHeight-40;l>1200&&(l=1200),l<150&&(l=150),d>1200&&(d=1200),d<150&&(d=150),s.setAttribute("width",l),s.setAttribute("height",d);const m=new i.twrWasmModule;await m.loadWasm("balls.wasm"),await m.callC(["bounce_balls_init",.3]);const u=r=>{let t;t=void 0===e?16:r-e,e=r,m.callC(["bounce_balls_move",t]).then(()=>{window.requestAnimationFrame(u)})};window.requestAnimationFrame(u);</script> </body>
Loading

0 comments on commit cc98aba

Please sign in to comment.