diff options
-rw-r--r-- | src/desktop/window.rs | 6 | ||||
-rw-r--r-- | src/main.rs | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/desktop/window.rs b/src/desktop/window.rs index 78a7c42..2fea3e5 100644 --- a/src/desktop/window.rs +++ b/src/desktop/window.rs @@ -35,13 +35,13 @@ fn draw(frame: &mut [u8], fb: &[u32; 160 * 144]) { } impl<'a> DesktopWindow<'a> { - pub fn new() -> Result<Self, Error> { + pub fn new(title: impl Into<String>) -> Result<Self, Error> { let event_loop = EventLoop::new().unwrap(); let input = WinitInputHelper::new(); let window = Arc::new({ - let size = LogicalSize::new(WIDTH as f64, HEIGHT as f64); + let size = LogicalSize::new((WIDTH * 4) as f64, (HEIGHT * 4) as f64); WindowBuilder::new() - .with_title("Gameboy Emulator") + .with_title(title.into()) .with_inner_size(size) .with_min_inner_size(size) .build(&event_loop) diff --git a/src/main.rs b/src/main.rs index cee08f2..20bfc9c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,6 +62,10 @@ struct Cli { /// Dump state to files on stop #[arg(long, default_value_t = false)] stop_dump_state: bool, + + /// Window title + #[arg(long, default_value = "Gameboy Emulator")] + title: String } fn main() { @@ -70,7 +74,7 @@ fn main() { println!("Starting {:?}...", &cli.rom); let serial = desktop::serial::UnconnectedSerial {}; - let window = desktop::window::DesktopWindow::new().unwrap(); + let window = desktop::window::DesktopWindow::new(cli.title).unwrap(); let mut gamepad: Box<dyn Input> = if let Some(record_file) = cli.replay_input { Box::new(GamepadReplay::new(record_file)) |