improve v0.1, and add docs

This commit is contained in:
Nilton Constantino
2026-01-12 18:37:53 +00:00
parent 41c93fa0a3
commit 552fa4e187
17 changed files with 3590 additions and 11 deletions
+7 -5
View File
@@ -29,7 +29,7 @@ struct PrometeuApp {
input_signals: InputSignals,
frame_dt: Duration,
frame_target_dt: Duration,
next_frame: Instant,
}
@@ -38,10 +38,12 @@ impl PrometeuApp {
Self {
window: None,
pixels: None,
input_signals: InputSignals::default(),
machine: Machine::new(),
frame_dt: Duration::from_nanos(1_000_000_000 / 60),
input_signals: InputSignals::default(),
frame_target_dt: Duration::from_nanos(1_000_000_000 / 60),
next_frame: Instant::now(),
}
}
@@ -67,7 +69,7 @@ impl PrometeuApp {
}
}
impl ApplicationHandler for PrometeuApp {
impl ApplicationHandler for PrometeuApp {
fn resumed(&mut self, event_loop: &ActiveEventLoop) {
let attrs = WindowAttributes::default()
.with_title("PROMETEU - host_desktop")
@@ -181,7 +183,7 @@ impl ApplicationHandler for PrometeuApp {
let now = Instant::now();
if now >= self.next_frame {
self.next_frame += self.frame_dt;
self.next_frame += self.frame_target_dt;
// executa 1 frame do PROMETEU
self.machine.step_frame(&self.input_signals);