Struct rust_libretro::contexts::LoadGameContext
source · [−]pub struct LoadGameContext<'a> { /* private fields */ }Implementations
pub fn new(
environment_callback: &'a retro_environment_t,
camera_interface: &'a mut Option<retro_camera_callback>,
perf_interface: &'a mut Option<retro_perf_callback>,
location_interface: &'a mut Option<retro_location_callback>,
rumble_interface: &'a mut Option<retro_rumble_interface>,
sensor_interface: &'a mut Option<retro_sensor_interface>
) -> Self
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 noticeand 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 noticeand 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.
pub unsafe fn get_camera_interface(
&self,
data: retro_camera_callback
) -> Option<retro_camera_callback>
pub unsafe fn get_camera_interface(
&self,
data: retro_camera_callback
) -> Option<retro_camera_callback>
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 noticeand 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 noticeand no guarantees about its stability can be made.
pub unsafe fn set_hw_render_context_negotiation_interface(
&self,
interface_type: retro_hw_render_context_negotiation_interface_type,
interface_version: c_uint
) -> bool
pub unsafe fn set_hw_render_context_negotiation_interface(
&self,
interface_type: retro_hw_render_context_negotiation_interface_type,
interface_version: c_uint
) -> bool
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 noticeand 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.
- If function is called inside
Core::on_load_game, theretro_game_info_extarray is guaranteed to have a size of 1 - i.e. the returned pointer may be used to access directly the members of the firstretro_game_info_extstruct, for example:
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);- If the function is called inside
Core::on_load_game_special, theretro_game_info_extarray is guaranteed to have a size equal to thenum_infoargument passed toCore::on_load_game_special
Trait Implementations
Performs the conversion.
Performs the conversion.
