Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Print Text In Web Assembly

Tags:

webassembly

Is there any way to print text onto the window directly in web assembly instead of having to pass string data into javascript, or print to the console?

like image 358
Cpp plus 1 Avatar asked Jul 07 '17 16:07

Cpp plus 1


3 Answers

No. WebAssembly can't directly manipulate the DOM yet. For now you must use Javascript glue. It is a planned future feature however.

like image 134
Ghillie Avatar answered Oct 21 '22 02:10

Ghillie


You may try to draw text with OpenGL, by using OGLFT or similar library.

like image 38
roof Avatar answered Oct 21 '22 04:10

roof


The answer is still no, and it will remain no. It is central to the design of Wasm that it does not have any built-in functionality that depends on a given environment (because it is intended to be embeddable in many different environments) or that gives Wasm code the capability to manipulate its environment other than through explicit imports (because that would break the ability to sandbox a Wasm module).

like image 1
Andreas Rossberg Avatar answered Oct 21 '22 04:10

Andreas Rossberg