INNER CODE UNIT · Rust
ctx
shawnscode/crayon · modules/audio/src/lib.rs:113
pub fn ctx() -> &'static AudioSystem {
unsafe {
debug_assert!(
!CTX.is_null(),
"audio system has not been initialized properly."
);
&*CTX
}
}
/// Setup the world system.
pub fn setup() -> Result<(), failure::Error> {
unsafe {
debug_assert!(CTX.is_null(), "duplicated setup of audio system.");
let ctx = AudioSystem::new()?;
CTX = Box::into_raw(Box::new(ctx));