Minimal application for wgpu on native platforms (+web)
![image](https://private-user-images.githubusercontent.com/46521/298945109-fe603e35-4623-4131-b562-6e60bd706c2f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ2NDA4MzEsIm5iZiI6MTcyNDY0MDUzMSwicGF0aCI6Ii80NjUyMS8yOTg5NDUxMDktZmU2MDNlMzUtNDYyMy00MTMxLWI1NjItNmU2MGJkNzA2YzJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI2VDAyNDg1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIzMmQ2ODM0NDA1OWU5NDQ3ZjZiNTk0NjgzOTIxZjkzY2Q5MmQwMDI2ZDQ0YzYzZGE4MjY2MWZkZjhiYWZlNGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.gXXhXk4wRsidEm2RKZL2yrtDY6c30elnDbRF8kwBKq4)
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[1].
Just use Cmake to configure your project, 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.
If you want to use the same code, but targetting 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
[1] We Currently use a modified version of sokol_app to be able to create the WebGPU Context on windows without having to override the GL/DX Context created by sokol otherwise.