使用 OpenGL 通过 WebAssembly 从 C++ 为 HTML5 画布进行动画的最小示例
Live demo: https://timhutton.github.io/opengl-canvas-wasm/
Install Emscripten:
Clone this repo:
git clone https://github.com/timhutton/opengl-canvas-wasm.git
cd opengl-canvas-wasm
Build index.js and index.wasm:
emcc main.cpp -std=c++11 -s WASM=1 -s USE_SDL=2 -O3 -o index.js
Open index.html in a web browser. You should see a colorful animated triangle:
Chrome doesn't support file:// XHR requests, so you need to first start a webserver, e.g.:
with Python 2: python -m SimpleHTTPServer 8080
with Python 3: python -m http.server 8080
and then open this URL:
…
暂无开放 Issues,或尚未同步最近议题。