retro_set_initial_image_t

Type Alias retro_set_initial_image_t 

Source
pub type retro_set_initial_image_t = Option<unsafe extern "C" fn(index: c_uint, path: *const c_char) -> bool>;
Expand description

Sets initial image to insert in drive when calling core_load_game(). Since we cannot pass the initial index when loading content (this would require a major API change), this is set by the frontend before calling the core’s retro_load_game()/retro_load_game_special() implementation. A core should therefore cache the index/path values and handle them inside retro_load_game()/retro_load_game_special().

  • If ‘index’ is invalid (index >= get_num_images()), the core should ignore the set value and instead use 0
  • ‘path’ is used purely for error checking - i.e. when content is loaded, the core should verify that the disk specified by ‘index’ has the specified file path. This is to guard against auto selecting the wrong image if (for example) the user should modify an existing M3U playlist. We have to let the core handle this because set_initial_image() must be called before loading content, i.e. the frontend cannot access image paths in advance and thus cannot perform the error check itself. If set path and content path do not match, the core should ignore the set ‘index’ value and instead use 0 Returns ‘false’ if index or ‘path’ are invalid, or core does not support this functionality

Aliased Type§

pub enum retro_set_initial_image_t {
    None,
    Some(unsafe extern "C" fn(u32, *const i8) -> bool),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(u32, *const i8) -> bool)

Some value of type T.