Skip to main content

Environment

Struct Environment 

Source
pub struct Environment<'a> { /* private fields */ }
Expand description

Typed wrapper around libretro environment commands.

Use this during Core::on_set_environment, Core::init, and through Runtime::environment for runtime-safe commands. Methods retain backing storage when libretro allows the frontend to keep pointers after a call.

Implementations§

Source§

impl Environment<'_>

Source

pub fn set_rotation(&mut self, rotation: VideoRotation) -> bool

Source

pub fn overscan(&mut self) -> Option<bool>

Source

pub fn can_dupe_frames(&mut self) -> Option<bool>

Source

pub fn shutdown(&mut self) -> bool

Source

pub fn set_system_av_info(&mut self, info: SystemAvInfo) -> bool

Source

pub fn extended_game_info(&mut self) -> Option<ExtendedGameInfo<'_>>

Source

pub fn extended_game_infos( &mut self, count: usize, ) -> Option<Vec<ExtendedGameInfo<'_>>>

Source

pub fn set_performance_level(&mut self, level: PerformanceLevel) -> bool

Source

pub fn perf_interface(&mut self) -> Option<PerfInterface>

Source

pub fn system_directory(&mut self) -> Option<String>

Source

pub fn libretro_path(&mut self) -> Option<String>

Source

pub fn core_assets_directory(&mut self) -> Option<String>

Source

pub fn content_directory(&mut self) -> Option<String>

Source

pub fn save_directory(&mut self) -> Option<String>

Source

pub fn username(&mut self) -> Option<String>

Source

pub fn playlist_directory(&mut self) -> Option<String>

Source

pub fn file_browser_start_directory(&mut self) -> Option<String>

Source

pub fn language(&mut self) -> Option<Language>

Source

pub fn jit_capable(&mut self) -> Option<bool>

Source

pub fn set_support_achievements(&mut self, supported: bool) -> bool

Source

pub fn audio_video_enable(&mut self) -> Option<AvEnableFlags>

Source

pub fn fastforwarding(&mut self) -> Option<bool>

Source

pub fn fastforwarding_override_supported(&mut self) -> bool

Source

pub fn set_fastforwarding_override( &mut self, override_: FastForwardingOverride, ) -> bool

Source

pub fn target_refresh_rate(&mut self) -> Option<RefreshRateHz>

Source

pub fn target_sample_rate(&mut self) -> Option<AudioSampleRateHz>

Source

pub fn throttle_state(&mut self) -> Option<ThrottleState>

Source

pub fn savestate_context(&mut self) -> Option<SavestateContext>

Source

pub fn set_memory_maps( &mut self, descriptors: &[MemoryMapDescriptor<'_>], ) -> bool

Source

pub fn set_controller_info(&mut self, ports: &[ControllerInfo]) -> bool

Source

pub fn set_proc_address_callback(&mut self) -> bool

Source

pub fn set_subsystem_info(&mut self, subsystems: &[SubsystemInfo]) -> bool

Source

pub fn disk_control_interface_version( &mut self, ) -> Option<DiskControlInterfaceVersion>

Source

pub fn set_disk_control_interface(&mut self) -> bool

Source

pub fn clear_disk_control_interface(&mut self) -> bool

Source

pub fn set_disk_control_ext_interface(&mut self) -> bool

Source

pub fn clear_disk_control_ext_interface(&mut self) -> bool

Source

pub fn set_netpacket_interface( &mut self, protocol_version: Option<&str>, ) -> bool

Source

pub fn clear_netpacket_interface(&mut self) -> bool

Source

pub fn current_software_framebuffer( &mut self, request: SoftwareFramebufferRequest, ) -> Option<SoftwareFramebuffer>

Source

pub fn set_minimum_audio_latency( &mut self, latency: Option<AudioLatencyMillis>, ) -> bool

Source

pub fn set_audio_buffer_status_callback(&mut self, enabled: bool) -> bool

Source

pub fn audio_callback_available(&mut self) -> bool

Source

pub fn set_audio_callback(&mut self) -> bool

Source

pub fn clear_audio_callback(&mut self) -> bool

Source

pub fn set_frame_time_callback(&mut self, reference: FrameTime) -> bool

Source

pub fn clear_frame_time_callback(&mut self) -> bool

Source

pub fn message_interface_version(&mut self) -> Option<u32>

Source

pub fn set_message_ext(&mut self, message: ExtendedMessage) -> bool

Source

pub fn input_device_capabilities(&mut self) -> Option<InputDeviceCapabilities>

Source

pub fn supports_joypad_bitmasks(&mut self) -> bool

Source

pub fn set_keyboard_callback(&mut self) -> bool

Source

pub fn set_input_descriptors(&mut self, descriptors: &[InputDescriptor]) -> bool

Source

pub fn input_max_users(&mut self) -> Option<u32>

Source

pub fn led_interface(&mut self) -> Option<LedInterface>

Source

pub fn rumble_interface(&mut self) -> Option<RumbleInterface>

Source

pub fn device_power(&mut self) -> Option<DevicePower>

Source

pub fn netplay_client_index(&mut self) -> Option<NetplayClientId>

Source

pub fn sensor_interface(&mut self) -> Option<SensorInterface>

Source

pub fn camera_interface( &mut self, request: CameraRequest, ) -> Option<CameraInterface>

Source

pub fn location_interface(&mut self) -> Option<LocationInterface>

Source

pub fn microphone_interface(&mut self) -> Option<MicrophoneInterface>

Source

pub fn midi_interface_available(&mut self) -> bool

Source

pub fn midi_interface(&mut self) -> Option<MidiInterface>

Source

pub fn set_serialization_quirks( &mut self, quirks: SerializationQuirks, ) -> Option<SerializationQuirks>

Source§

impl<'a> Environment<'a>

Source

pub fn logger(&mut self) -> Logger

Source

pub fn set_support_no_game(&mut self, enabled: bool) -> bool

Source

pub fn set_message(&mut self, message: impl AsRef<str>, frames: u32) -> bool

Source

pub fn set_variables(&mut self, variables: &[VariableDefinition]) -> bool

Source

pub fn core_options_version(&mut self) -> CoreOptionsVersion

Source

pub fn set_core_options( &mut self, options: &CoreOptions, ) -> Result<bool, CoreOptionsBuildError>

Source

pub fn set_core_options_legacy( &mut self, options: &CoreOptions, ) -> Result<bool, CoreOptionsBuildError>

Source

pub fn set_core_options_v1( &mut self, definitions: &[CoreOptionDefinition], ) -> Result<bool, CoreOptionsBuildError>

Source

pub fn set_core_options_v1_intl( &mut self, us: &[CoreOptionDefinition], local: Option<&[CoreOptionDefinition]>, ) -> Result<bool, CoreOptionsBuildError>

Source

pub fn set_core_options_v2( &mut self, options: &CoreOptions, ) -> Result<bool, CoreOptionsBuildError>

Source

pub fn set_core_options_v2_intl( &mut self, us: &CoreOptions, local: Option<&CoreOptions>, ) -> Result<bool, CoreOptionsBuildError>

Source

pub fn set_core_option_display(&mut self, display: CoreOptionDisplay) -> bool

Source

pub fn set_core_options_update_display_callback(&mut self) -> bool

Source

pub fn set_variable(&mut self, key: &str, value: Option<&str>) -> bool

Source

pub fn vfs_interface( &mut self, version: VfsInterfaceVersion, ) -> Option<VfsInterface>

Source

pub fn set_content_info_overrides( &mut self, overrides: &[ContentInfoOverride], ) -> bool

Source

pub fn set_pixel_format(&mut self, format: PixelFormat) -> bool

Source

pub fn set_geometry(&mut self, geometry: GameGeometry) -> bool

Source

pub fn set_hw_render(&mut self, config: HwRenderConfig) -> bool

Source

pub fn set_hw_shared_context(&mut self) -> bool

Source

pub fn hw_render_interface(&mut self) -> Option<HwRenderInterface<'_>>

Source

pub fn hw_render_context_negotiation_interface_support( &mut self, interface_type: HwRenderContextNegotiationInterfaceType, ) -> Option<u32>

Source

pub fn set_hw_render_context_negotiation_interface( &mut self, interface: HwRenderContextNegotiationInterface, ) -> bool

Source

pub fn preferred_hw_render(&mut self) -> Option<PreferredHwRender>

Source

pub fn set_hw_render_from_candidates( &mut self, candidates: &[HwRenderConfig], ) -> Option<HwRenderConfig>

Source

pub fn get_variable(&mut self, key: &str) -> Option<String>

Source

pub fn variables_updated(&mut self) -> bool

Auto Trait Implementations§

§

impl<'a> Freeze for Environment<'a>

§

impl<'a> !RefUnwindSafe for Environment<'a>

§

impl<'a> Send for Environment<'a>

§

impl<'a> !Sync for Environment<'a>

§

impl<'a> Unpin for Environment<'a>

§

impl<'a> UnsafeUnpin for Environment<'a>

§

impl<'a> !UnwindSafe for Environment<'a>

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.