Skip to content

Instantly share code, notes, and snippets.

@Ohmnivore
Last active September 12, 2018 19:05
Show Gist options
  • Save Ohmnivore/8446263fe1a5b670aca2e5f3bf29c2a2 to your computer and use it in GitHub Desktop.
Save Ohmnivore/8446263fe1a5b670aca2e5f3bf29c2a2 to your computer and use it in GitHub Desktop.
Trials and tribulations (oryol + WASM)

Compiling

In fips/cmake-toolchains/emscripten.toolchain.cmake:

  • Change set(FIPS_EMSCRIPTEN_SDK_VERSION "incoming") for version (found in fips-sdks/win/emsdk-portable/emscripten)
  • Change option(FIPS_EMSCRIPTEN_ALLOW_MEMORY_GROWTH "emscripten: allow memory growth" OFF) to ON

The clang compiler will be less permissive than default msvc. Expect to fix some new compilation errors.

Watch out for implementation-specific features like strtok.

Use only webgl2 configurations if you can (webgl requires nonsense like power of two textures). Type fips list configs to view the full list. webgl2-emsc-ninja-debug is nice for debugging. webgl2-wasm-ninja-release for release.

Only ever use fips gen, never fips config.

Server

  • Note: I've found this to be unnecessary when testing locally on windows, just open the main .html file in a browser
  • cd to fips-deploy/<app name>/<config>
  • python -m http.server --bind 127.0.0.1 8000
  • Open http://127.0.0.1:8000/<app name>.html in browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment