memononen / nanovg

Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations.
zlib License
5.06k stars 767 forks source link

Layer based drawing #647

Open prashant-saxena opened 1 year ago

prashant-saxena commented 1 year ago

Hi, The current implementation draws everything sequentially on top of last drawing shape. Is it possible to create a layer based approach? It's like you will store all the drawing call to a layer and draw it later. For example:

  1. Draw Rectangle
  2. Store Circle
  3. Draw Rectangle
  4. Draw stored circle

Cheers

mulle-nat commented 1 year ago

Have a look at the example_fbo.c in the nanovg project. It does something like that,

xiangwencheng1994 commented 1 year ago

Vertex based cache, we wanted.

mulle-nat commented 1 year ago

AFAIK there is no way to do this in nanovg as is.