summaryrefslogtreecommitdiff
path: root/src/sdl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdl.rs')
-rw-r--r--src/sdl.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sdl.rs b/src/sdl.rs
index 74f2e77..056e8d8 100644
--- a/src/sdl.rs
+++ b/src/sdl.rs
@@ -714,6 +714,7 @@ extern "C" {
fn SDL_CloseAudioDevice(dev: SDL_AudioDeviceID);
fn SDL_GetClipboardText() -> *mut c_char;
fn SDL_SetClipboardText(text: *const c_char) -> c_int;
+ fn SDL_SetWindowFullscreen(window: *mut SDL_Window, flags: u32) -> c_int;
fn SDL_free(mem: *mut c_void);
}
@@ -1167,3 +1168,12 @@ pub unsafe fn set_clipboard_text(s: &str) -> Result<(), String> {
Err(get_err())
}
}
+
+pub unsafe fn set_window_fullscreen(win: *mut SDL_Window, flags: u32) -> Result<(), String> {
+ let result = SDL_SetWindowFullscreen(win, flags);
+ if result == 0 {
+ Ok(())
+ } else {
+ Err(get_err())
+ }
+}