Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
O

opengl-canvas-wasm

> 编程语言
Open source

Minimal example of animating the HTML5 canvas from C++ using OpenGL through WebAssembly

366 stars0 likes2 views
WebsiteGitHub

About

Minimal example of animating the HTML5 canvas from C++ using OpenGL through WebAssembly

Live demo: https://timhutton.github.io/opengl-canvas-wasm/

Instructions:

  1. Install Emscripten:

    http://emscripten.org

  2. Clone this repo:

    git clone https://github.com/timhutton/opengl-canvas-wasm.git

    cd opengl-canvas-wasm

  3. Build index.js and index.wasm:

    emcc main.cpp -std=c++11 -s WASM=1 -s USE_SDL=2 -O3 -o index.js

  4. 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:

    http://localhost:8080/

MIT license:

…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言