Skip to content

Commit 0772363

Browse files
fredmorcosCobrand
authored andcommitted
Implement sdl::get_platform()
1 parent 8a3fd3b commit 0772363

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/sdl2/sdl.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,14 @@ impl Drop for EventPump {
294294
}
295295
}
296296

297+
/// Get platform name
298+
#[inline]
299+
pub fn get_platform() -> &'static str {
300+
unsafe {
301+
CStr::from_ptr(sys::SDL_GetPlatform()).to_str().unwrap()
302+
}
303+
}
304+
297305
/// Initializes the SDL library.
298306
/// This must be called before using any other SDL function.
299307
///

0 commit comments

Comments
 (0)