Electron Example

110 views
Skip to first unread message

TH

unread,
Jun 22, 2022, 4:17:20 PM6/22/22
to emscripten-discuss
I am looking for an example of using a Vendor created Emscription js glue file and wasm file in Electron. I am fairly new to Electron Dev and I have not been able to find any recent  examples. Any help would be appreciated. Thanks. 

Floh

unread,
Jun 24, 2022, 10:57:01 AM6/24/22
to emscripten-discuss
It's almost too simple for a standalone example. First follow the getting Electron Quick Start guide (https://www.electronjs.org/docs/latest/tutorial/quick-start)  until you get to the point where an "npm start" gives you an Electron window with the "Hello World" message.

Next you need the three output files (.html, .js, wasm) from an Emscripten build, let's call them c64.html, c64.wasm and c64.js - you can download examples from here:


Put those files into the project root directory where the index.html file is.

Next, in the main.js file, where the index.html is loaded, replace index.html with c64.html:

win.loadFile('c64.html');

Next, run 'npm start'. Voilà, C64 emulator in Electron ;)

Screenshot 2022-06-24 at 16.53.54.png
Reply all
Reply to author
Forward
0 new messages