emilk / emilk/egui

Feature to get target refresh rate

Open
#4,416 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

**Is your feature request related to a problem? Please describe.**
Hi, I'm developing an emulator that uses egui for its front end. I'm currently experiencing an issue where I need to synchronise emulation with when egui repaints the screen. Currently, I'm utilizing the `request_repaint` function, but it's proving quite a struggle to work without knowing the framerate this function is targeting.

**Describe the solution you'd like**
A way to know the refresh rate/frame rate egui/eframe targets when using `request_repaint` (or even without it, say if the user was just moving their cursor around or doing something that would require a repaint)

**Describe alternatives you've considered**
I've tried implementing a similar method as showcased egui.rs, where on the backend tab, if you set the Mode to Continuous, it will calculate the FPS. However, this value is not entirely accurate because if the window loses focus (either via minimizing or switching tabs), it stops painting and ruins the average time between each frame.

**Additional context**

Contributor guide

Open the contributing guide

Research direction

Start by reviewing request_repaint and the egui.rs backend tab's Continuous mode, which the issue identifies as related behavior. Determine how egui/eframe chooses repaint timing and what value should be exposed to applications. Done means an application can reliably obtain the target refresh or frame rate, including when repainting is event-driven.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.