Skip to content

Instantly share code, notes, and snippets.

@gtk2k
Created March 26, 2021 11:09
Show Gist options
  • Save gtk2k/01f1fed49fb6ca561262bd975a66a19f to your computer and use it in GitHub Desktop.
Save gtk2k/01f1fed49fb6ca561262bd975a66a19f to your computer and use it in GitHub Desktop.
jslib_test_snippet
mergeInto(LibraryManager.library, {
binaryInit: function (ptrArray, size) {
Module.refByteArray = new Uint8Array(buffer, ptrArray, size);
setInterval(function () {
Module.refByteArray[1] += 2;
if (Module.refByteArray[1] >= 200)
Module.refByteArray[1] = 0;
}, 1000);
},
consoleLog: function (val) {
console.log(Module.refByteArray[0], val);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment