1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Style/visuals tweaks

This commit is contained in:
Emil Ernerfeldt
2020-05-17 17:44:29 +02:00
parent d123d7e9c6
commit 8f43d38e38
3 changed files with 7 additions and 38 deletions

View File

@@ -88,10 +88,10 @@ fn main() {
while running {
{
// Keep smooth frame rate. TODO: proper vsync
// Keep smooth frame rate because vsync doesn't work on mac
let frame_duration = frame_start.elapsed();
if frame_duration < Duration::from_millis(33) {
std::thread::sleep(Duration::from_millis(33) - frame_duration);
if frame_duration < Duration::from_millis(16) {
std::thread::sleep(Duration::from_millis(16) - frame_duration);
}
frame_start = Instant::now();
}