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

Reactive draw mode #24

Open
parasyte opened this issue Dec 19, 2021 · 0 comments
Open

Reactive draw mode #24

parasyte opened this issue Dec 19, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@parasyte
Copy link
Owner

The GUI currently redraws every frame at the display's refresh rate (e.g. 180 fps on my 180 Hz monitor). Even if there are no changes between frames.

We can easily switch to a reactive mode by only redrawing when egui requests it:

cartunes/src/framework.rs

Lines 150 to 155 in 2a3b989

// End the egui frame and create all paint jobs to prepare for rendering.
// TODO: Handle output.needs_repaint to avoid game-mode continuous redraws.
let (output, paint_commands) = self.egui_ctx.end_frame();
self.egui_state
.handle_output(window, &self.egui_ctx, output);
self.paint_jobs = self.egui_ctx.tessellate(paint_commands);

@parasyte parasyte added enhancement New feature or request good first issue Good for newcomers labels Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant