Skip to content

Allows inspecting the Draw State#895

Open
sebosp wants to merge 3 commits intonannou-org:masterfrom
sebosp:master
Open

Allows inspecting the Draw State#895
sebosp wants to merge 3 commits intonannou-org:masterfrom
sebosp:master

Conversation

@sebosp
Copy link
Copy Markdown

@sebosp sebosp commented Nov 13, 2022

This is so that existing rendering libraries/binaries can re-use nannou/lyon heavy lifting and migrate to it in progression.

As an example, alacritty already has its rendering context, but the rendering of polygons and paths for decorations (i.e. background effects) could use nannou's logic.

While the vertices from certain shapes work without this PR (i.e. draw.ellipse()), when one attempts to use a draw.path(), this is behind several private layers: the Draw .state, the .intermediary_state and finally the .path_event_buffer where the vertices are located for bezier curves and such.

By exporting these immutable references of the state, other projects can start calling draw.<shape>()... and the project can have a function similar to nannou::draw::renderer::Renderer::fill() in which the draw commands are drained and primitives are rendered in the existing project rendering context.

Signed-off-by: Seb Ospina kraige@gmail.com

…se nannou/lyon heavy lifting

Signed-off-by: Seb Ospina <kraige@gmail.com>
@sebosp
Copy link
Copy Markdown
Author

sebosp commented Dec 21, 2022

This allows rendering nannou primitives for example in alacritty (or chartacritty on my fork):
nannou polar clock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant