pub struct RetroEnvironment(/* private fields */);
Expand description
Exposes the retro_environment_t
callback in an idiomatic fashion. Each of the RETRO_ENVIRONMENT_*
keys will
eventually have a corresponding method here.
Until that is accomplished, the keys are available in libretro_rs::sys
and can be used manually with the get_raw
,
get
, get_str
and set_raw
functions.
Implementations§
Source§impl RetroEnvironment
impl RetroEnvironment
Sourcepub fn shutdown(&self) -> bool
pub fn shutdown(&self) -> bool
Requests that the frontend shut down. The frontend can refuse to do this, and return false.
pub fn set_pixel_format(&self, val: RetroPixelFormat) -> bool
pub fn set_support_no_game(&self, val: bool) -> bool
Sourcepub fn get_libretro_path(&self) -> Option<&str>
pub fn get_libretro_path(&self) -> Option<&str>
Queries the path where the current libretro core resides.
Sourcepub fn get_core_assets_directory(&self) -> Option<&str>
pub fn get_core_assets_directory(&self) -> Option<&str>
Queries the path of the “core assets” directory.
Sourcepub fn get_save_directory(&self) -> Option<&str>
pub fn get_save_directory(&self) -> Option<&str>
Queries the path of the save directory.
Sourcepub fn get_system_directory(&self) -> Option<&str>
pub fn get_system_directory(&self) -> Option<&str>
Queries the path of the system directory.
Sourcepub fn get_username(&self) -> Option<&str>
pub fn get_username(&self) -> Option<&str>
Queries the username associated with the frontend.
Sourcepub fn get_str<'a>(&'a self, key: u32) -> Option<&'a str>
pub fn get_str<'a>(&'a self, key: u32) -> Option<&'a str>
Queries a string slice from the environment. A null pointer (*const c_char
) is interpreted as None
.
Sourcepub unsafe fn get<T>(&self, key: u32) -> Option<*const T>
pub unsafe fn get<T>(&self, key: u32) -> Option<*const T>
Queries a struct from the environment. A null pointer (*const T
) is interpreted as None
.
Sourcepub unsafe fn get_raw<T>(&self, key: u32, output: *mut *const T) -> bool
pub unsafe fn get_raw<T>(&self, key: u32, output: *mut *const T) -> bool
Directly invokes the underlying retro_environment_t
in a “get” fashion.
pub fn set_bool(&self, key: u32, val: bool) -> bool
pub fn set_u32(&self, key: u32, val: u32) -> bool
Trait Implementations§
Source§impl Clone for RetroEnvironment
impl Clone for RetroEnvironment
Source§fn clone(&self) -> RetroEnvironment
fn clone(&self) -> RetroEnvironment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more