aboutsummaryrefslogtreecommitdiff
path: root/pixel-client/src/main.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-25 17:37:49 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-25 17:37:49 +0200
commit5bf5a200ada9ba03ca2a12c1503318a97166d7c7 (patch)
tree0936ea088efd11eaee00a88dcb368e7271fb985b /pixel-client/src/main.rs
parent3403fc2d55f510c29bf7e74d85433801cd99cbbc (diff)
downloadhurrycurry-5bf5a200ada9ba03ca2a12c1503318a97166d7c7.tar
hurrycurry-5bf5a200ada9ba03ca2a12c1503318a97166d7c7.tar.bz2
hurrycurry-5bf5a200ada9ba03ca2a12c1503318a97166d7c7.tar.zst
pc: show fps
Diffstat (limited to 'pixel-client/src/main.rs')
-rw-r--r--pixel-client/src/main.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/pixel-client/src/main.rs b/pixel-client/src/main.rs
index 8c231031..9ed0ebec 100644
--- a/pixel-client/src/main.rs
+++ b/pixel-client/src/main.rs
@@ -21,6 +21,7 @@ use game::Game;
use hurrycurry_protocol::glam::Vec2;
use menu::main::MainMenu;
use network::Network;
+use profiler::ProfilerOverlay;
use render::Renderer;
use sdl2::{event::Event, keyboard::KeyboardState, mouse::MouseState, pixels::Color};
use std::time::{Duration, Instant};
@@ -29,6 +30,7 @@ pub mod game;
pub mod helper;
pub mod menu;
pub mod network;
+pub mod profiler;
pub mod render;
pub mod tilemap;
pub mod ui;
@@ -95,8 +97,8 @@ fn main() {
};
let mut events = sdl_context.event_pump().unwrap();
-
let mut last_tick = Instant::now();
+ let mut profiler = ProfilerOverlay::new();
'mainloop: loop {
let (width, height) = canvas.output_size().unwrap();
@@ -126,6 +128,7 @@ fn main() {
State::Quit => (),
}
+ profiler.update(&mut renderer);
canvas.set_draw_color(Color::BLACK);
canvas.clear();
renderer.submit(&mut canvas);