jdryg / vg-renderer

A vector graphics renderer for bgfx, based on ideas from NanoVG and ImDrawList (Dear ImGUI)
BSD 2-Clause "Simplified" License
504 stars 55 forks source link

feat: reset view transform flag #36

Closed simsaens closed 1 month ago

simsaens commented 1 month ago

This adds an optional parameter to end to reset the view transform, changing its signature from:

void end(Context* ctx);

to

void end(Context* ctx, bool resetViewTransform = true);

We set this to false when integrating vg-renderer with our renderer, as resetting the view transform impacts the rendering state outside of vg-renderer in our integration.

We have tried to preserve the public API here, in that existing uses should not be affected. However I would be happy to move this setting elsewhere (like ContextConfig) if it seems more appropriate.

jdryg commented 1 month ago

Having this flag as an end() parameter implies that it can change between frames. Is this useful to your case? If not, I'd prefer to add this as a flag in ContextConfig as you suggested.

simsaens commented 1 month ago

Good point! I will move this to ContextConfig and put it back up for review