Skip to content

Retained mode PaintCallbacks within egui #3650

Answered by Wumpf
tgross35 asked this question in Q&A
Discussion options

You must be logged in to vote

(This question may be old but maybe answering is still useful for someone out there!)

Since egui has to redraw the entire screen and doesn't keep draw results for single rectangles around this isn't easily possible. Also, this would need an elaborate mechanism to determine when a redraw is necessary. However, you can implement this yourself by drawing to a texture that you keep around and only update when needed. Then inside the CallbackTrait you (always) composite that texture to egui

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tgross35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants