Skip to content

Commit 4164498

Browse files
committed
full screen it!!
1 parent 9e09042 commit 4164498

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ fn main() -> Result<(), String> {
99
// let audio_subsystem = sdl_context.audio()?;
1010

1111
// create window
12-
let window = video_subsystem.window("frontend-sdl2-rust", 800, 600)
12+
// get screen dimensions
13+
let mut display_index = 0;
14+
let display_mode = video_subsystem.desktop_display_mode(display_index)?;
15+
let mut window_width = display_mode.w as u32;
16+
let mut window_height = display_mode.h as u32;
17+
let window = video_subsystem.window("frontend-sdl2-rust", window_width, window_height)
1318
.position_centered()
1419
.build()
1520
.expect("could not initialize video subsystem");

0 commit comments

Comments
 (0)