Is there any way of accessing canvas 2D context under C++ when using emscripten?
I'd like to be able to draw simple shapes/paths using canvas' api functions like lineTo
, fillRect
1d done, etc. (so basically use any of the functions listed here.
I will point out that I would prefer not to rely on SDL, but if it's the only reliable approach then is there a way to force it to compile to JavaScript so that the result won't use WebGL, but basic canvas api?
Or should I maybe do a simple mapping of the api functions following this suggestion: Calling JavaScript From C/C++ ?
Until anyone shares a better solution I will most likely do the mapping and share it here as soon as I'm done with it.