Struct RetroInstance

Source
pub struct RetroInstance<T: RetroCore> {
    pub system: Option<T>,
    pub system_info: Option<RetroSystemInfo>,
    pub system_av_info: Option<RetroSystemAvInfo>,
    pub audio_sample: retro_audio_sample_t,
    pub audio_sample_batch: retro_audio_sample_batch_t,
    pub environment: Option<RetroEnvironment>,
    pub input_poll: retro_input_poll_t,
    pub input_state: retro_input_state_t,
    pub video_refresh: retro_video_refresh_t,
}
Expand description

This is the glue layer between a RetroCore implementation, and the libretro API.

Fields§

§system: Option<T>§system_info: Option<RetroSystemInfo>§system_av_info: Option<RetroSystemAvInfo>§audio_sample: retro_audio_sample_t§audio_sample_batch: retro_audio_sample_batch_t§environment: Option<RetroEnvironment>§input_poll: retro_input_poll_t§input_state: retro_input_state_t§video_refresh: retro_video_refresh_t

Implementations§

Source§

impl<T: RetroCore> RetroInstance<T>

Source

pub fn on_get_system_info(&mut self, info: &mut retro_system_info)

Invoked by a libretro frontend, with the retro_get_system_info API call.

Source

pub fn on_get_system_av_info(&self, info: &mut retro_system_av_info)

Invoked by a libretro frontend, with the retro_get_system_av_info API call.

Source

pub fn on_init(&mut self)

Invoked by a libretro frontend, with the retro_init API call.

Source

pub fn on_deinit(&mut self)

Invoked by a libretro frontend, with the retro_deinit API call.

Source

pub fn on_set_environment(&mut self, cb: retro_environment_t)

Invoked by a libretro frontend, with the retro_set_environment API call.

Source

pub fn on_set_audio_sample(&mut self, cb: retro_audio_sample_t)

Invoked by a libretro frontend, with the retro_set_audio_sample API call.

Source

pub fn on_set_audio_sample_batch(&mut self, cb: retro_audio_sample_batch_t)

Invoked by a libretro frontend, with the retro_set_audio_sample_batch API call.

Source

pub fn on_set_input_poll(&mut self, cb: retro_input_poll_t)

Invoked by a libretro frontend, with the retro_set_input_poll API call.

Source

pub fn on_set_input_state(&mut self, cb: retro_input_state_t)

Invoked by a libretro frontend, with the retro_set_input_state API call.

Source

pub fn on_set_video_refresh(&mut self, cb: retro_video_refresh_t)

Invoked by a libretro frontend, with the retro_set_video_refresh API call.

Source

pub fn on_set_controller_port_device(&mut self, port: c_uint, device: c_uint)

Invoked by a libretro frontend, with the retro_set_controller_port_device API call.

Source

pub fn on_reset(&mut self)

Invoked by a libretro frontend, with the retro_reset API call.

Source

pub fn on_run(&mut self)

Invoked by a libretro frontend, with the retro_run API call.

Source

pub fn on_serialize_size(&self) -> size_t

Invoked by a libretro frontend, with the retro_serialize_size API call.

Source

pub fn on_serialize(&self, data: *mut (), size: size_t) -> bool

Invoked by a libretro frontend, with the retro_serialize API call.

Source

pub fn on_unserialize(&mut self, data: *const (), size: size_t) -> bool

Invoked by a libretro frontend, with the retro_unserialize API call.

Source

pub fn on_cheat_reset(&mut self)

Invoked by a libretro frontend, with the retro_cheat_reset API call.

Source

pub fn on_cheat_set( &mut self, index: c_uint, enabled: bool, code: *const c_char, )

Invoked by a libretro frontend, with the retro_cheat_set API call.

Source

pub fn on_load_game(&mut self, game: &retro_game_info) -> bool

Invoked by a libretro frontend, with the retro_load_game API call.

Source

pub fn on_load_game_special( &mut self, game_type: c_uint, info: &retro_game_info, num_info: size_t, ) -> bool

Invoked by a libretro frontend, with the retro_load_game_special API call.

Source

pub fn on_unload_game(&mut self)

Invoked by a libretro frontend, with the retro_unload_game API call.

Source

pub fn on_get_region(&self) -> c_uint

Invoked by a libretro frontend, with the retro_get_region API call.

Source

pub fn on_get_memory_data(&mut self, id: c_uint) -> *mut ()

Invoked by a libretro frontend, with the retro_get_memory_data API call.

Source

pub fn on_get_memory_size(&mut self, id: c_uint) -> size_t

Invoked by a libretro frontend, with the retro_get_memory_size API call.

Auto Trait Implementations§

§

impl<T> Freeze for RetroInstance<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for RetroInstance<T>
where T: RefUnwindSafe,

§

impl<T> Send for RetroInstance<T>
where T: Send,

§

impl<T> Sync for RetroInstance<T>
where T: Sync,

§

impl<T> Unpin for RetroInstance<T>
where T: Unpin,

§

impl<T> UnwindSafe for RetroInstance<T>
where T: UnwindSafe,

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.