Skip to content

How can I configure it to ensure the FPS is not affected by the mouse's movement? #4956

Closed Answered by YgorSouza
247gzs asked this question in Q&A
Discussion options

You must be logged in to vote

You can't, at least not with eframe. The app always repaints on user interaction. The request_repaint methods are just to ensure it keeps updating when the user isn't doing anything, if the UI might change for some other reason. There is #4880 which aims to skip the repaint if the hovered widget isn't interactive, but it hasn't been reviewed yet.

Generally you should assume that your UI code will be run at 60fps, because it will be whenever the user is interacting or an animation is in progress. If the problem is that the code is too expensive to run that often, you have to cache the results between frames. Egui provides the cache module to help with that. You can also use the time field …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@247gzs
Comment options

Answer selected by 247gzs
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