memononen / nanovg

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

Fixed Issue #631 #632

Open lochnessdragon opened 2 years ago

lochnessdragon commented 2 years ago

My idea to fix issue #631 is to have a list for vaos (like how textures are handled) that is updated each frame and a new vao is created when a valid one doesn't exist. Therefore, this fixes the problem by creating a vao for each context that doesn't already have one. However, I can see the potential problem that a vao handle that is valid in one context for the correct nvg vao could also be correct in a different context for a different vao. However, to solve this problem would require a major overhaul to the nanovg api. We'd need a way for users to separate shared context state from per-context state and such. Let me know your thoughts and I am open to any ideas.