wasm-webgl.NET
Live demo: https://malciin.github.io/wasm-webgl.net/
Proof of concept of .NET webassembly app (without blazor) that uses WebGL to draw 3d triangle (tetrahedron).
.NET Wasm project was created using wasmbrowser
template:
dotnet workload install wasm-tools
dotnet workload install wasm-experimental
dotnet new wasmbrowser
See: https://devblogs.microsoft.com/dotnet/use-net-7-from-any-javascript-app-in-net-7/
webgl
bindings (JS
+ C#
) are autogenerated using T4 based on webgl.spec.xml
file thats written manually by me based on following resources:
- https://github.com/glfw/glfw/blob/master/deps/glad/gl.h
- https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext
Its just a quick proof of concept, only some of webgl methods are binded, other things like textures would require adding proper definition to webgl.spec.xml
.