Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple instances #357

Open
JSH32 opened this issue May 14, 2022 · 2 comments
Open

Multiple instances #357

JSH32 opened this issue May 14, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request Lib / JS Issues concerning the JS API of WasmBoy

Comments

@JSH32
Copy link

JSH32 commented May 14, 2022

According to the lib documentation, WasmBoy is a singleton. Is there a way to create multiple instances of a Gameboy emulator?

@torch2424 torch2424 self-assigned this May 22, 2022
@torch2424 torch2424 added the enhancement New feature or request label May 22, 2022
@torch2424
Copy link
Owner

@JSH32 Hello! My apologies for the late reply, I recently started a tech break, so I took a week or so away from Github 😄

But yes! WasmBoy is a single ton, your best bet to create multiple instances, is to use WasmBoyLib directly, to create your own WasmBoy object: https://github.com/torch2424/wasmboy/blob/master/lib/index.js

I was actually thinking of making it not a singleton, so hopefully whenever I get the time to pick this project back up, I'll go ahead and do that 😄

@torch2424 torch2424 added the Lib / JS Issues concerning the JS API of WasmBoy label May 22, 2022
@JSH32
Copy link
Author

JSH32 commented Aug 23, 2022

Seems that its just binding everything to WasmBoyLib and that its also a singleton... Ah I see the factory is the actual class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Lib / JS Issues concerning the JS API of WasmBoy
Projects
None yet
Development

No branches or pull requests

2 participants