pub struct LoadGameContext<'a> {
    pub(crate) environment_callback: &'a retro_environment_t,
    pub(crate) interfaces: Arc<RwLock<InterfaceList>>,
}
Expand description

Functions that are safe to be called in Core::on_load_game.

For a description of the callbacks see CoreWrapper.

Fields§

§environment_callback: &'a retro_environment_t§interfaces: Arc<RwLock<InterfaceList>>

Implementations§

The reference represents the time of one frame. It is computed as 1000000 / fps, but the implementation will resolve the rounding to ensure that framestepping, etc is exact.

Unstable

This feature is unstable and guarded by the unstable-env-commands feature flag.

Please be advised that this feature might change without further notice and no guarantees about its stability can be made.

Unstable

This feature is unstable and guarded by the unstable-env-commands feature flag.

Please be advised that this feature might change without further notice and no guarantees about its stability can be made.

Unstable

This feature is unstable and guarded by the unstable-env-commands feature flag.

Please be advised that this feature might change without further notice and no guarantees about its stability can be made.

Unstable

This feature is unstable and guarded by the unstable-env-commands feature flag.

Please be advised that this feature might change without further notice and no guarantees about its stability can be made.

Unstable

This feature is unstable and guarded by the unstable-env-commands feature flag.

Please be advised that this feature might change without further notice and no guarantees about its stability can be made.

Unstable

This feature is unstable and guarded by the unstable-env-commands feature flag.

Please be advised that this feature might change without further notice and no guarantees about its stability can be made.

Unstable

This feature is unstable and guarded by the unstable-env-commands feature flag.

Please be advised that this feature might change without further notice and no guarantees about its stability can be made.

Gives a hint to the frontend how demanding this implementation is on a system. E.g. reporting a level of 2 means this implementation should run decently on all frontends of level 2 and up.

It can be used by the frontend to potentially warn about too demanding implementations.

The levels are “floating”.

This function can be called on a per-game basis, as certain games an implementation can play might be particularly demanding.

Sets the internal pixel format used by the implementation. The default pixel format is retro_pixel_format::RETRO_PIXEL_FORMAT_0RGB1555. This pixel format however, is deprecated (see enum retro_pixel_format). If the call returns false, the frontend does not support this pixel format.

Sets an interface to let a libretro core render with hardware acceleration.

If successful, libretro cores will be able to render to a frontend-provided framebuffer. The size of this framebuffer will be at least as large as max_width/max_height provided in Core::on_get_av_info. If HW rendering is used, call either RunContext::draw_hardware_frame or RunContext::dupe_frame.

Lets the core know how much time has passed since last invocation of Core::on_run. The frontend can tamper with the timing to fake fast-forward, slow-motion, frame stepping, etc. In this case the delta time will use the reference value in retro_frame_time_callback.

Gets an interface which is used by a libretro core to set state of rumble motors in controllers. A strong and weak motor is supported, and they can be controlled indepedently. Should be called from either Core::on_init or Core::on_load_game. Should not be called from Core::on_set_environment. Returns false if rumble functionality is unavailable.

Unstable Gets an interface to a video camera driver. A libretro core can use this interface to get access to a video camera. New video frames are delivered in a callback in same thread as Core::on_run.

get_camera_interface should be called in Core::on_load_game.

Depending on the camera implementation used, camera frames will be delivered as a raw framebuffer, or as an OpenGL texture directly.

The core has to tell the frontend here which types of buffers can be handled properly. An OpenGL texture can only be handled when using a libretro GL core (set_hw_render). It is recommended to use a libretro GL core when using camera interface.

The camera is not started automatically. The retrieved start/stop functions must be used to explicitly

This feature is unstable and guarded by the unstable-env-commands feature flag.

Please be advised that this feature might change without further notice and no guarantees about its stability can be made.

Unstable This environment call lets a libretro core tell the frontend about the memory maps this core emulates. This can be used to implement, for example, cheats in a core-agnostic way.

Should only be used by emulators; it doesn’t make much sense for anything else. It is recommended to expose all relevant pointers through retro_get_memory_* as well.

Can be called from Core::on_init and Core::on_load_game.

This feature is unstable and guarded by the unstable-env-commands feature flag.

Please be advised that this feature might change without further notice and no guarantees about its stability can be made.

Unstable Sets an interface which lets the libretro core negotiate with frontend how a context is created. The semantics of this interface depends on which API is used in set_hw_render earlier. This interface will be used when the frontend is trying to create a HW rendering context, so it will be used after set_hw_render, but before the context_reset callback.

This feature is unstable and guarded by the unstable-env-commands feature flag.

Please be advised that this feature might change without further notice and no guarantees about its stability can be made.

Sets quirk flags associated with serialization. The frontend will zero any flags it doesn’t recognize or support.

Should be set in either Core::on_init or Core::on_load_game, but not both.

Allows an implementation to fetch extended game information, providing additional content path and memory buffer status details. This function may only be called inside Core::on_load_game or Core::on_load_game_special.

If callback returns false, extended game information is unsupported by the frontend. In this case, only regular retro_game_info will be available. get_game_info_ext is guaranteed to return true if set_content_info_override returns true.

‘data’ points to an array of [retro_game_info_ext structs].

For struct member descriptions, see the definition of struct retro_game_info_ext.

    struct retro_game_info_ext *game_info_ext;
    if (environ_cb(RETRO_ENVIRONMENT_GET_GAME_INFO_EXT, &game_info_ext))
     printf("Content Directory: %s\n", game_info_ext->dir);

Trait Implementations§

Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.