Struct rust_libretro::contexts::LoadGameSpecialContext
source · [−]pub struct LoadGameSpecialContext<'a> {
pub(crate) environment_callback: &'a retro_environment_t,
}Expand description
Functions that are safe to be called in Core::on_load_game_special
Fields
environment_callback: &'a retro_environment_tImplementations
sourceimpl<'a> LoadGameSpecialContext<'a>
impl<'a> LoadGameSpecialContext<'a>
pub fn new(environment_callback: &'a retro_environment_t) -> Self
sourceimpl LoadGameSpecialContext<'_>
impl LoadGameSpecialContext<'_>
sourcepub fn set_frame_time_callback(&self, data: retro_frame_time_callback) -> bool
pub fn set_frame_time_callback(&self, data: retro_frame_time_callback) -> bool
Lets the core know how much time has passed since last
invocation of Core::on_run.
The frontend can tamper with the timing to fake fast-forward,
slow-motion, frame stepping, etc.
In this case the delta time will use the reference value
in retro_frame_time_callback.
sourceimpl LoadGameSpecialContext<'_>
impl LoadGameSpecialContext<'_>
sourcepub fn get_game_info_ext(&self) -> Option<retro_game_info_ext>
pub fn get_game_info_ext(&self) -> Option<retro_game_info_ext>
Allows an implementation to fetch extended game
information, providing additional content path
and memory buffer status details.
This function may only be called inside
Core::on_load_game or Core::on_load_game_special.
If callback returns false, extended game information
is unsupported by the frontend. In this case, only
regular retro_game_info will be available.
get_game_info_ext is guaranteed
to return true if set_content_info_override
returns true.
‘data’ points to an array of [retro_game_info_ext structs].
For struct member descriptions, see the definition of
struct retro_game_info_ext.
- If function is called inside
Core::on_load_game, theretro_game_info_extarray is guaranteed to have a size of 1 - i.e. the returned pointer may be used to access directly the members of the firstretro_game_info_extstruct, for example:
struct retro_game_info_ext *game_info_ext;
if (environ_cb(RETRO_ENVIRONMENT_GET_GAME_INFO_EXT, &game_info_ext))
printf("Content Directory: %s\n", game_info_ext->dir);- If the function is called inside
Core::on_load_game_special, theretro_game_info_extarray is guaranteed to have a size equal to thenum_infoargument passed toCore::on_load_game_special
Trait Implementations
sourceimpl<'a> From<&'_ LoadGameSpecialContext<'a>> for GenericContext<'a>
impl<'a> From<&'_ LoadGameSpecialContext<'a>> for GenericContext<'a>
sourcefn from(other: &LoadGameSpecialContext<'a>) -> GenericContext<'a>
fn from(other: &LoadGameSpecialContext<'a>) -> GenericContext<'a>
Performs the conversion.
sourceimpl<'a> From<&'_ mut LoadGameSpecialContext<'a>> for GenericContext<'a>
impl<'a> From<&'_ mut LoadGameSpecialContext<'a>> for GenericContext<'a>
sourcefn from(other: &mut LoadGameSpecialContext<'a>) -> GenericContext<'a>
fn from(other: &mut LoadGameSpecialContext<'a>) -> GenericContext<'a>
Performs the conversion.
Auto Trait Implementations
impl<'a> RefUnwindSafe for LoadGameSpecialContext<'a>
impl<'a> Send for LoadGameSpecialContext<'a>
impl<'a> Sync for LoadGameSpecialContext<'a>
impl<'a> Unpin for LoadGameSpecialContext<'a>
impl<'a> UnwindSafe for LoadGameSpecialContext<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
