-
Notifications
You must be signed in to change notification settings - Fork 29
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
Running in Browser #16
Comments
Running a specific application is a case of adding the appropriate parameter(s) to the URL:
You might like to look at how the direct links to the browser demos here do it. |
wow thanks, this is awesome! |
When trying to build src for the browser using the makefile in the wasm folder I got an error when trying to build Box2D231.o. Is this some external dependency? |
It's the Box2D physics engine; it's only needed for the demos in the examples/physics directory. Why do you need to build the browser edition yourself, can't you use use the one installed at wasm.bbcbasic.co.uk? That's already configured to work with Firefox (i.e. it supports the COOP and COEP headers). |
I'm just tinkering with the repo, but I am interested in building the browser edition myself in case I wanted to try and embed a project built with it in a website. I could always use something like an Iframe I suppose |
Fair enough. Obviously if you do that it will be your responsibility to re-build it if there are bug fixes or other important updates, whereas the version at wasm.bbcbasic.co.uk should always be up-to-date. I've just noticed that the Box2D object file isn't in the repo because it's excluded by the .gitignore rules, I wonder if there's a way I can override them for that particular file. Apart from that dependency (which you can remove) you should be able to build it yourself but I know there are issues with some versions of Emscripten/SDL and multi-threading. I had to choose which version of Emscripten to use with some care. |
Ok great, I think I'll try removing the dependency. I've compiled other C++ using threads with Emscripten before with no problems but I'll keep an eye for for when trying to build. Thanks again! |
The symptom to watch out for is a deadlock during start up, see here. |
I successfully compiled it with some additional tweaks modifying files that use Box2D. When launching index.html it takes me to the immediate mode interpreter, but when going to bbcbasic.co.uk/bbcsdl.html without any additional link it goes to the resources folder, how was this done? Does bbcsdl direct you to a specific directory? |
Oh I see, sorry, you mentioned it is in lib/autorun.bbc in the forum link above, I'll look into that |
During initialisation it looks for the file lib/autorun.bbc and if found runs it automatically rather than entering the immediate mode command loop. In the version installed at wasm.bbcbasic.co.uk this program handles the URL parameters I listed previously, and if none are present it CHAINs examples/tools/touchide.bbc. Generally, anything that can be done with a BASIC program is done that way rather than bloating the interpreter. The GUI interfaces provided by the desktop, mobile and browser editions of BBC BASIC are all themselves BASIC programs (examples/tools/SDLIDE.bbc for the desktop editions, examples/tools/touchide.bbc for the mobile and browser editions). Incidentally I forgot one of the available URL parameters, which was added later to support running a program short enough to be included in its entirety in the URL:
|
Is there a way to configure a particular file to run on startup so we can run applications in the browser without the user having to select the file via the gui editor?
Thank you for this project, it is very cool!
The text was updated successfully, but these errors were encountered: