I spent a couple hours to integrate nanovg 
(https://github.com/memononen/nanovg) into the oryol engine, and it runs 
pretty well through emscripten (number of GL calls is pretty high):

http://floooh.github.io/oryol/TestNanoVG.html

nanovg (almost) didn't require any changes, one fix I did was to remove the 
fairly excessive calls to glGetError since this killed performance in 
Chrome, and non-power-of-2 textures didn't render because the 
GL_TEXTURE_WRAP_S/T modes need to be set to GL_CLAMP_TO_EDGE.

Another thing I had to fix in the demo scene was resource loading (fonts 
and images), nanovg either can load directly from file via 
fopen/fread/fclose, but also can create from file-data in memory. I used 
the create-from-memory functions and asynchronous resource loading to 
create fonts and images deferred, and skipped parts of the demo scene 
rendering if a required resource isn't available yet.

I think a really useful optimization for nanovg would be to try reducing 
the number of GL calls.

Cheers :)
-Floh.

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to