We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e09042 commit 4164498Copy full SHA for 4164498
src/main.rs
@@ -9,7 +9,12 @@ fn main() -> Result<(), String> {
9
// let audio_subsystem = sdl_context.audio()?;
10
11
// create window
12
- let window = video_subsystem.window("frontend-sdl2-rust", 800, 600)
+ // 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)
18
.position_centered()
19
.build()
20
.expect("could not initialize video subsystem");
0 commit comments