pub struct Runtime<'a> { /* private fields */ }Expand description
Per-frame access to frontend callbacks and services.
Runtime is passed to Core::run, Core::load_game, and hardware context
hooks. It owns typed helpers for input polling, video/audio submission,
frontend messages, hardware framebuffers, memory maps, and service queries.
Implementations§
Source§impl<'a> Runtime<'a>
impl<'a> Runtime<'a>
pub fn environment(&mut self) -> Environment<'_>
pub fn logger(&mut self) -> Logger
pub fn poll_input(&self)
pub fn joypad_pressed( &self, port: impl Into<InputPort>, button: JoypadButton, ) -> bool
pub fn analog_axis( &self, port: impl Into<InputPort>, stick: AnalogStick, axis: AnalogAxis, ) -> i16
pub fn mouse_axis(&self, port: impl Into<InputPort>, axis: MouseAxis) -> i16
pub fn mouse_wheel_moved( &self, port: impl Into<InputPort>, direction: MouseWheel, ) -> bool
pub fn pointer_axis( &self, port: impl Into<InputPort>, index: impl Into<PointerIndex>, axis: PointerAxis, ) -> i16
pub fn pointer_pressed( &self, port: impl Into<InputPort>, index: impl Into<PointerIndex>, ) -> bool
pub fn pointer_count(&self, port: impl Into<InputPort>) -> i16
pub fn pointer_is_offscreen( &self, port: impl Into<InputPort>, index: impl Into<PointerIndex>, ) -> bool
pub fn lightgun_axis( &self, port: impl Into<InputPort>, axis: LightgunAxis, ) -> i16
pub fn lightgun_is_offscreen(&self, port: impl Into<InputPort>) -> bool
pub fn video_refresh_frame<T>( &self, pixels: &[T], width: u32, height: u32, pitch: usize, ) -> bool
pub fn video_refresh_frame_with_audio<T>( &self, pixels: &[T], width: u32, height: u32, pitch: usize, audio_frames: &[[i16; 2]], ) -> usize
pub fn video_refresh_hw(&self, width: u32, height: u32, pitch: usize)
pub fn video_refresh_hw_with_audio( &self, width: u32, height: u32, pitch: usize, audio_frames: &[[i16; 2]], ) -> usize
pub fn video_refresh_software_framebuffer( &self, framebuffer: SoftwareFramebuffer, )
pub fn video_refresh_software_framebuffer_with_audio( &self, framebuffer: SoftwareFramebuffer, audio_frames: &[[i16; 2]], ) -> usize
pub fn video_refresh_dupe(&self, width: u32, height: u32)
pub fn video_refresh_dupe_with_audio( &self, width: u32, height: u32, audio_frames: &[[i16; 2]], ) -> usize
pub fn set_geometry(&mut self, geometry: GameGeometry) -> bool
pub fn set_message(&mut self, message: impl AsRef<str>, frames: u32) -> bool
pub fn set_message_ext(&mut self, message: ExtendedMessage) -> bool
pub fn audio_sample(&self, left: i16, right: i16)
pub fn audio_sample_batch(&self, frames: &[[i16; 2]]) -> usize
pub fn current_framebuffer(&self) -> Option<u32>
pub fn hw_context_type(&self) -> Option<HwContextType>
pub fn hw_proc_address(&self, symbol: &str) -> Result<*const c_void, String>
Auto Trait Implementations§
impl<'a> Freeze for Runtime<'a>
impl<'a> !RefUnwindSafe for Runtime<'a>
impl<'a> Send for Runtime<'a>
impl<'a> !Sync for Runtime<'a>
impl<'a> Unpin for Runtime<'a>
impl<'a> UnsafeUnpin for Runtime<'a>
impl<'a> !UnwindSafe for Runtime<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more