Struct LoadGameSpecialContext

Source
pub struct LoadGameSpecialContext<'a> {
    pub(crate) environment_callback: &'a retro_environment_t,
    pub(crate) interfaces: Arc<RwLock<InterfaceList>>,
}
Expand description

Functions that are safe to be called in Core::on_load_game_special

Fields§

§environment_callback: &'a retro_environment_t§interfaces: Arc<RwLock<InterfaceList>>

Implementations§

Source§

impl<'a> LoadGameSpecialContext<'a>

Source

pub(crate) fn new( environment_callback: &'a retro_environment_t, interfaces: Arc<RwLock<InterfaceList>>, ) -> Self

Source§

impl LoadGameSpecialContext<'_>

Source

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.

Source§

impl LoadGameSpecialContext<'_>

Source

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.

    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);

Trait Implementations§

Source§

impl<'a> From<&LoadGameSpecialContext<'a>> for GenericContext<'a>

Source§

fn from(other: &LoadGameSpecialContext<'a>) -> GenericContext<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&LoadGameSpecialContext<'a>> for LoadGameContext<'a>

Source§

fn from(other: &LoadGameSpecialContext<'a>) -> LoadGameContext<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&mut LoadGameSpecialContext<'a>> for GenericContext<'a>

Source§

fn from(other: &mut LoadGameSpecialContext<'a>) -> GenericContext<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&mut LoadGameSpecialContext<'a>> for LoadGameContext<'a>

Source§

fn from(other: &mut LoadGameSpecialContext<'a>) -> LoadGameContext<'a>

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.