Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #687: Add OwnedDrawData for deep cloning DrawData #721

Merged
merged 2 commits into from Apr 3, 2023
Merged

Issue #687: Add OwnedDrawData for deep cloning DrawData #721

merged 2 commits into from Apr 3, 2023

Conversation

jbrd
Copy link
Contributor

@jbrd jbrd commented Mar 29, 2023

Introduce an OwnedDrawData struct that holds a cheaply-cloned ImDrawData structure that has been allocated and cloned on the heap. Designed for cases where you need to keep hold of the draw data so it can be evaluated at a later point in time (for instance, in multithreaded renderers where rendering the previous frame is overlapped with updating the next frame). It leverages ImDrawList::CloneOutput for cloning the underlying draw lists, and all allocations are made via ImGui, which has a nice consequence of them being tracked in the IO object's allocation metrics. The OwnedDrawData struct provides an accessor to the underlying DrawData struct, so that it can still be passed to renderers without modifying them.

As discussed in Issue #687

@dbr
Copy link
Contributor

dbr commented Apr 3, 2023

Looks great, thanks!

@dbr dbr merged commit df331ba into imgui-rs:main Apr 3, 2023
8 checks passed
@jbrd
Copy link
Contributor Author

jbrd commented Apr 3, 2023

Excellent, thank you!

@jbrd jbrd deleted the OwnedDrawData-PR branch April 3, 2023 18:21
@dbr dbr mentioned this pull request Apr 5, 2023
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.

None yet

2 participants