Skip to content

Example code to show how to use projectM within WASM-based emscripten applications.

License

Notifications You must be signed in to change notification settings

projectM-visualizer/examples-emscripten

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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:

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-emscriptendirectory. The .data file includes all presets as a virtual filesystem.

About

Example code to show how to use projectM within WASM-based emscripten applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published