This repository is an adaptation of the Learn OpenGL
website's OpenGL tutorial, adapted to use Rust's WASM backend through
wasm-bindgen. The original tutorial documentation is written in C++, using GLFW
and GLEW to create a window and expose an OpenGL context; this repository
replaces this approach with an in-browser frontend with Rust/WASM and WebGL. The
Rust/WASM implementation is largely based on examples from the Rust and
WebAssembly book on github, and the WebGL
Example in
the Rust WASM book's
The mechanics are largely the same, and many of the odds an ends specific to C++
can be pretty directly translated to Rust, however there are some inconsistencies
that needed to be addressed such as the way WebGL interprets GLSL files
(particularly their pragmas and preprocessor directives). One of the sticking
points at the moment is the synchronicity of the rendering cycle. Typically,
graphical applications have an FPS-locked loop performing updates of internal
logic, and rendering the results of those updates afterward, with a framewise
timeout to save a few milliseconds of compute and cut down on unnecessary
processing time. However the WebGL example on the EBook has an asynchronous flow built on the
Regardless, this approach shows potential in my opinion, and long-term could open the door to in-browser game development using WASM. If there is any goal for this repository it is exactly that; to make a framework for building small, in-browser games that are high-performance and can run anywhere. Once I find a better mechanism for handling event-driven programming and concurrency via in-browser Rust, I'll solidify this repo into a more streamlined API or Framework.