FPS locked to 61 in glium
As I was messing around with Glium, I made an FPS counter to appear in the terminal, but it seems locked to 61 FPS.
I tried lowering the number of rendered objects, but the result was the same. At first, I thought it was somewhat related to my 60Hz monitor or some embedded VSync feature in glium, but I recently changed my monitor, and the result was the same.]
let mut start = Instant::now();
let mut elapsed = start.elapsed();
let mut frame_counter = 0;
#[allow(deprecated)]
event_loop.run(move |ev, window_target| {
match ev {
glium::winit::event::Event::WindowEvent { event, .. } => match event {
glium::winit::event::WindowEvent::CloseRequested => {
window_target.exit();
},
glium::winit::event::WindowEvent::RedrawRequested => {
// frame counter code
frame_counter += 1;
elapsed = start.elapsed();
if elapsed.as_millis() > 1000{
println!("{}", frame_counter);
frame_counter = 0;
start = Instant::now();
}
// drawing objects
let mut target = display.draw();
target.clear_color(0.0, 0.05, 0.1, 1.0);
let uniforms = uniform! {
matrix: player.get_matrix(),
tex: player.texture
};
target.draw(&vertex_buffer, &indices, &program, &uniforms,
&Default::default()).unwrap();
target.finish().unwrap();
},
// ...
_ => (),
}})
.unwrap();