Skip to content

Commit

Permalink
Implement sdl::get_platform()
Browse files Browse the repository at this point in the history
  • Loading branch information
fredmorcos authored and Cobrand committed Jun 9, 2018
1 parent 8a3fd3b commit 0772363
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sdl2/sdl.rs
Expand Up @@ -294,6 +294,14 @@ impl Drop for EventPump {
}
}

/// Get platform name
#[inline]
pub fn get_platform() -> &'static str {
unsafe {
CStr::from_ptr(sys::SDL_GetPlatform()).to_str().unwrap()
}
}

/// Initializes the SDL library.
/// This must be called before using any other SDL function.
///
Expand Down

0 comments on commit 0772363

Please sign in to comment.