I have an HTML page with a canvas I've already created and I want to draw on it using WebGL though emscripten. I want the compiled C++ code to make GL calls which will go to that canvas I created in the HTML.
All examples I've seen use SDL or OpenKODE to create the canvas. I haven't found any that take the canvas from outside.
What's the proper way to do this?
You can set the canvas element of the module object,
var Module = {
canvas: myCanvasDomElement
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With