Skip to content

pplux/minimal-wgpu-native

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minimal-wgpu-native

Minimal application for wgpu on native platforms (+web)

video.webm

This is an example on how to set up a very minimal native app for Windows and MacOS using wgpu-native as backend. For the native window handling, we use sokol_app.

Demos

Compilation

Just use Cmake to configure your project, and the appropriate binary release of wgpu-native will be automatically downloaded as part of the project setup. Have a look at the CMakeLists.txt file for details.

Emscripten

Locally on linux, mac, WSL:

If you want to use the same code, but targeting the web with emscripten, you can compile on linux, mac, or WSL the project:

cd minimal-wgpu-native
mkdir build
cd build
source $HOME/<path-to-your-emsdk>/emsdk/emsdk_env.sh
cmake -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake ..
make -j

With Docker

You can use Docker to compile the wasm files with a script (buildWASM.py)

cd minimal-wgpu-native/wasm
python3 ./buildWASM.py

About

Minimal application for wgpu on native platforms

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages