For simple "immediate-mode GL"-like stuff (color or textured lines and 
triangles) you could check out my sokol_gl.h header, this sits on top of 
sokol_gfx.h, which in turn sits on top of WebGL, and it implements an API 
that's "heavily inspired" by OpenGL 1.x. Some examples (source code is 
under the "src" link):

https://floooh.github.io/sokol-html5/sgl-sapp.html

https://floooh.github.io/sokol-html5/sgl-lines-sapp.html

...and this microui backend is also entirely implemented with sokol_gl.h:

https://floooh.github.io/sokol-html5/sgl-microui-sapp.html

Cheers,
-Andre.
On Thursday, 22 July 2021 at 20:42:37 UTC+2 [email protected] wrote:

> I'm trying to get 2d vector rendering working in my custom C++/opengl 
> engine, I have vector data that I'm parsing from an SWF file.
>
> I'm currently drawing it using Skia, but I can't get GPU mode working on 
> HTML5, publicly available binaries aren't built with gpu mode enabled, and 
> when I try to build it I get weird artifacts, even in CPU mode.
>
> I figured since Canvas was "native" I should just do two render paths, one 
> Skia on Windows and Canvas in HTML5.
>
> The plan was to use EM_ASM to call ctx.lineTo() and such. Then at the end 
> of each frame call canvas.getImageData() and copy it into HEAP8[ptr], right 
> now I just get black image data.
>
> But it's also extremely slow, it makes me wonder if this is really gonna 
> work.
>
> Does anyone have advice about fast 2d path renderers? Doesn't necessarily 
> have to be GPU based, but I'm looking to transfer ~1600x900 at 30fps with 
> MSAA, or some other high quality AA.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/5aedea8d-cef2-45e6-8998-7e6c8b6c9cb4n%40googlegroups.com.

Reply via email to