Struct rust_libretro::core_wrapper::CoreWrapper
source · [−]pub(crate) struct CoreWrapper {Show 20 fields
pub(crate) environment_set: bool,
pub(crate) environment_callback: retro_environment_t,
pub(crate) video_refresh_callback: retro_video_refresh_t,
pub(crate) audio_sample_callback: retro_audio_sample_t,
pub(crate) audio_sample_batch_callback: retro_audio_sample_batch_t,
pub(crate) input_poll_callback: retro_input_poll_t,
pub(crate) input_state_callback: retro_input_state_t,
pub(crate) rumble_interface: Option<retro_rumble_interface>,
pub(crate) sensor_interface: Option<retro_sensor_interface>,
pub(crate) camera_interface: Option<retro_camera_callback>,
pub(crate) perf_interface: Option<retro_perf_callback>,
pub(crate) location_interface: Option<retro_location_callback>,
pub(crate) can_dupe: bool,
pub(crate) had_frame: bool,
pub(crate) last_width: u32,
pub(crate) last_height: u32,
pub(crate) last_pitch: u64,
pub(crate) supports_bitmasks: bool,
pub(crate) frame_delta: Option<i64>,
pub(crate) core: Box<dyn Core>,
}Expand description
Holds the core instance as well as runtime information from the libretro frontend.
This struct gets used in the code generated by the retro_core!()-macro.
Fields
environment_set: boolenvironment_callback: retro_environment_tvideo_refresh_callback: retro_video_refresh_tRender a frame. Pixel format is 15-bit 0RGB1555 native endian
unless changed (see RETRO_ENVIRONMENT_SET_PIXEL_FORMAT).
Width and height specify dimensions of buffer. Pitch specifices length in bytes between two lines in buffer.
For performance reasons, it is highly recommended to have a frame
that is packed in memory, i.e. pitch == width * byte_per_pixel.
Certain graphic APIs, such as OpenGL ES, do not like textures
that are not packed in memory.
audio_sample_callback: retro_audio_sample_tRenders a single audio frame. Should only be used if implementation generates a single sample at a time. Format is signed 16-bit native endian.
audio_sample_batch_callback: retro_audio_sample_batch_tRenders multiple audio frames in one go.
One frame is defined as a sample of left and right channels, interleaved.
I.e. int16_t buf[4] = { l, r, l, r }; would be 2 frames.
Only one of the audio callbacks must ever be used.
input_poll_callback: retro_input_poll_tPolls input.
input_state_callback: retro_input_state_tQueries for input for player port. device will be masked with
RETRO_DEVICE_MASK.
Specialization of devices such as RETRO_DEVICE_JOYPAD_MULTITAP that
have been set with Core::on_set_controller_port_device
will still use the higher level RETRO_DEVICE_JOYPAD to request input.
rumble_interface: Option<retro_rumble_interface>sensor_interface: Option<retro_sensor_interface>camera_interface: Option<retro_camera_callback>perf_interface: Option<retro_perf_callback>location_interface: Option<retro_location_callback>can_dupe: boolhad_frame: boollast_width: u32last_height: u32last_pitch: u64supports_bitmasks: boolframe_delta: Option<i64>core: Box<dyn Core>The wrapped Core implementation.
Implementations
sourceimpl CoreWrapper
impl CoreWrapper
pub(crate) fn new<C: 'static + Core>(core: C) -> Self
pub(crate) fn on_set_video_refresh(&mut self, arg1: retro_video_refresh_t)
pub(crate) fn on_set_audio_sample(&mut self, arg1: retro_audio_sample_t)
pub(crate) fn on_set_audio_sample_batch(
&mut self,
arg1: retro_audio_sample_batch_t
)
pub(crate) fn on_set_input_poll(&mut self, arg1: retro_input_poll_t)
pub(crate) fn on_set_input_state(&mut self, arg1: retro_input_state_t)
Auto Trait Implementations
impl !RefUnwindSafe for CoreWrapper
impl !Send for CoreWrapper
impl !Sync for CoreWrapper
impl Unpin for CoreWrapper
impl !UnwindSafe for CoreWrapper
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
