0.1.0-0-pre.5-fix.1
This commit is contained in:
@@ -1,14 +1,30 @@
|
||||
// file: crates/apps/game-snake-poc-desktop/src/main.rs
|
||||
// version: 3
|
||||
// version: 4
|
||||
|
||||
use engine_v1_sdl::SdlRuntime;
|
||||
use game_snake_poc::SnakeGame;
|
||||
#![warn(missing_docs)]
|
||||
#![deny(unreachable_pub)]
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
fn main() -> Result<(), String> {
|
||||
let _guard = game_logging_lib::init_default_tracing("games::runner").map_err(|error| error.to_string())?;
|
||||
tracing::info!(game = "snake", "desktop SDL3 runner started");
|
||||
//! SDL3 Desktop development runner for the Snake POC game library.
|
||||
|
||||
let runtime = SdlRuntime::new("Snake POC", 720, 1280, 16);
|
||||
let mut game = SnakeGame::default();
|
||||
return runtime.run(&mut game);
|
||||
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 = "snake", "desktop SDL3 runner started");
|
||||
let _monetization = engine_v1_platform_api::MonetizationCapabilities::disabled();
|
||||
let runtime = engine_v1_sdl::SdlRuntime::new("Snake POC", 720, 1280, std::time::Duration::from_millis(16));
|
||||
let mut state = game_snake_poc::SnakeState::new();
|
||||
match runtime.run(&mut state) {
|
||||
std::result::Result::Ok(()) => {},
|
||||
std::result::Result::Err(error) => {
|
||||
tracing::error!(target: "games::runner", game = "snake", %error, "desktop SDL3 runner failed");
|
||||
eprintln!("Snake POC desktop runner failed: {error}");
|
||||
},
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user