From 01f03cc4fc17133186d463a19e576a5e7572884a Mon Sep 17 00:00:00 2001 From: Cobrand Date: Fri, 3 Jun 2016 14:11:21 +0200 Subject: [PATCH] Added fullscreen_state to Window * Solves #457 --- examples/demo.rs | 1 - src/sdl2/video.rs | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/demo.rs b/examples/demo.rs index 71bbbae3..f1c39023 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -19,7 +19,6 @@ pub fn main() { renderer.set_draw_color(Color::RGB(255, 0, 0)); renderer.clear(); renderer.present(); - let mut event_pump = sdl_context.event_pump().unwrap(); 'running: loop { diff --git a/src/sdl2/video.rs b/src/sdl2/video.rs index a883d82f..5fd8ed76 100644 --- a/src/sdl2/video.rs +++ b/src/sdl2/video.rs @@ -1145,6 +1145,10 @@ impl WindowRef { unsafe { ll::SDL_RestoreWindow(self.raw()) } } + pub fn fullscreen_state(&self) -> FullscreenType { + FullscreenType::from_window_flags(self.window_flags()) + } + pub fn set_fullscreen(&mut self, fullscreen_type: FullscreenType) -> Result<(), String> { unsafe {