mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-18 21:40:29 +00:00
Start scaffolding web_canvas backend
This commit is contained in:
@@ -13,21 +13,24 @@
|
||||
}
|
||||
};
|
||||
|
||||
fetch('ghostty-term.wasm').then(response =>
|
||||
fetch('ghostty-wasm.wasm').then(response =>
|
||||
response.arrayBuffer()
|
||||
).then(bytes =>
|
||||
WebAssembly.instantiate(bytes, importObject)
|
||||
).then(results => {
|
||||
const {
|
||||
terminal_new,
|
||||
terminal_free,
|
||||
terminal_print,
|
||||
atlas_new,
|
||||
atlas_free,
|
||||
atlas_reserve,
|
||||
free,
|
||||
memory,
|
||||
} = results.instance.exports;
|
||||
|
||||
const term = terminal_new(80, 80);
|
||||
console.log(term);
|
||||
terminal_free(term);
|
||||
terminal_print('a');
|
||||
const atlas = atlas_new(512, 0);
|
||||
const reg = atlas_reserve(atlas, 10, 10);
|
||||
console.log(reg);
|
||||
free(reg);
|
||||
atlas_free(atlas);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user