0.1.0-0-pre.5
This commit is contained in:
@@ -1,21 +1,18 @@
|
||||
# file: crates/apps/game-reflex-poc-desktop/Cargo.toml
|
||||
# version: 3
|
||||
# version: 2
|
||||
|
||||
[package]
|
||||
name = "game-reflex-poc-desktop"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
repository.workspace = true
|
||||
authors.workspace = true
|
||||
publish.workspace = true
|
||||
|
||||
[dependencies]
|
||||
engine-v1-sdl = { path = "../../engines/engine-v1-sdl" }
|
||||
game-logging-lib = { path = "../../common/game-logging-lib" }
|
||||
tracing.workspace = true
|
||||
engine-v1-common = { path = "../../engines/engine-v1-common" }
|
||||
engine-v1-platform-api = { path = "../../engines/engine-v1-platform-api" }
|
||||
game-reflex-poc = { path = "../../games/game-reflex-poc" }
|
||||
tracing.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
[lints.rust]
|
||||
missing_docs = "warn"
|
||||
unsafe_code = "forbid"
|
||||
|
||||
@@ -1,31 +1,14 @@
|
||||
// file: crates/apps/game-reflex-poc-desktop/src/main.rs
|
||||
// version: 3
|
||||
|
||||
#![warn(missing_docs)]
|
||||
#![deny(unreachable_pub)]
|
||||
#![forbid(unsafe_code)]
|
||||
use engine_v1_sdl::SdlRuntime;
|
||||
use game_reflex_poc::ReflexGame;
|
||||
|
||||
//! Desktop development runner for the Reflex POC game library.
|
||||
//!
|
||||
//! This binary exercises the platform-independent fixed-step loop. SDL3 windowing and physical input mapping are introduced in the next dedicated delta.
|
||||
fn main() -> Result<(), String> {
|
||||
let _guard = game_logging_lib::init_default_tracing("games::runner").map_err(|error| error.to_string())?;
|
||||
tracing::info!(game = "reflex", "desktop SDL3 runner started");
|
||||
|
||||
fn main() {
|
||||
let _logging_guard = match game_logging_lib::init_console_tracing() {
|
||||
std::result::Result::Ok(guard) => guard,
|
||||
std::result::Result::Err(error) => {
|
||||
eprintln!("failed to initialize tracing: {error}");
|
||||
return;
|
||||
},
|
||||
};
|
||||
tracing::info!(target: "games::runner", game = "reflex", "desktop POC runner started");
|
||||
let _monetization = engine_v1_platform_api::MonetizationCapabilities::disabled();
|
||||
let input = engine_v1_common::InputState::none().with_action(engine_v1_common::GameAction::Primary, true);
|
||||
let mut runner = engine_v1_common::FixedStepRunner::new(std::time::Duration::from_millis(16));
|
||||
let mut state = game_reflex_poc::ReflexState::new();
|
||||
for _ in 0..3 {
|
||||
runner.tick(&mut state, input);
|
||||
}
|
||||
tracing::info!(target: "games::runner", game = "reflex", frames = runner.next_frame_index(), "desktop POC runner completed");
|
||||
println!("Reflex POC desktop runner: score={} frames={}", state.score(), runner.next_frame_index());
|
||||
return;
|
||||
let runtime = SdlRuntime::new("Reflex POC", 720, 1280, 16);
|
||||
let mut game = ReflexGame::default();
|
||||
return runtime.run(&mut game);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user