Skip to content

Commit

Permalink
glium: Skip frames if more than one is enqueued
Browse files Browse the repository at this point in the history
  • Loading branch information
dcz-self committed Oct 9, 2024
1 parent d1a48c9 commit a59b1c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/glium.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ fn main() -> io::Result<()> {
.run_app(&mut LoopHandler {
user_event: move |_event| {
let t0 = Instant::now();
let data = rx.recv().unwrap();
let mut data = rx.recv().unwrap();
while let Ok(frame) = rx.try_recv() {
data = frame;
}
let data = data;
let t1 = Instant::now();

let image = glium::texture::RawImage2d::from_raw_rgb_reversed(
Expand Down

0 comments on commit a59b1c5

Please sign in to comment.