shoosh
shoosh

Reputation: 78914

using WebGL through emscripten on an html5 canvas

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?

Upvotes: 3

Views: 1243

Answers (1)

Michal Charemza
Michal Charemza

Reputation: 26982

You can set the canvas element of the module object,

var Module = {
  canvas: myCanvasDomElement
};

Upvotes: 1

Related Questions