https://github.com/projectm-visualizer/examples-emscripten
Example code to show how to use projectM within WASM-based emscripten applications.
https://github.com/projectm-visualizer/examples-emscripten
beatdrop emscripten milkdrop projectm wasm
Last synced: 7 months ago
JSON representation
Example code to show how to use projectM within WASM-based emscripten applications.
- Host: GitHub
- URL: https://github.com/projectm-visualizer/examples-emscripten
- Owner: projectM-visualizer
- License: lgpl-2.1
- Created: 2022-02-13T21:48:12.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-28T15:11:42.000Z (about 2 years ago)
- Last Synced: 2025-01-14T03:39:07.488Z (9 months ago)
- Topics: beatdrop, emscripten, milkdrop, projectm, wasm
- Language: C++
- Size: 947 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
projectM Emscripten Example
===========================This application is a sample entry point for the emscripten-built version of projectM.
It's a very basic application without many features.
## Limitations
emscripten builds of projectM only support building as a static library. Shared libraries are only simulated and
basically identical to static libraries.Multithreading and OpenMP support are disabled due to the lack of real multithreading capabilities in
JavaScript/WebAssembly.The build will use OpenGL ES 3.0, using `FULL_ES2` compatibility only.
## Prepare for building
Download and build the emscripten SDK: https://emscripten.org/docs/getting_started/downloads.html
No other libraries are required as emscripten has everything built-in that is needed by projectM.
## Configure and compile projectM
CMake will auto-detect that emscripten is used for building as the toolchain sets `CMAKE_SYSTEM_NAME`
accordingly. No other options need to be set except `CMAKE_INSTALL_PREFIX` if you plan to install the build results for
further use.Running these commands in projectM's source dir will configure and build projectM for Emscripten:
```sh
mkdir cmake-build-emscripten
cd cmake-build-emscripten
emcmake ..
emmake
```If the build was successful, you will find the projectM_SDL_emscripten.html, .data, .js and .wasm files in
the `cmake-build-emscripten/src/projectM-emscripten`directory. The .data file includes all presets as a virtual
filesystem.