#[repr(C)]
pub struct retro_hw_render_callback { pub context_type: retro_hw_context_type, pub context_reset: retro_hw_context_reset_t, pub get_current_framebuffer: retro_hw_get_current_framebuffer_t, pub get_proc_address: retro_hw_get_proc_address_t, pub depth: bool, pub stencil: bool, pub bottom_left_origin: bool, pub version_major: c_uint, pub version_minor: c_uint, pub cache_context: bool, pub context_destroy: retro_hw_context_reset_t, pub debug_context: bool, }

Fields§

§context_type: retro_hw_context_type

Which API to use. Set by libretro core.

§context_reset: retro_hw_context_reset_t

Called when a context has been created or when it has been reset. An OpenGL context is only valid after context_reset() has been called.

When context_reset is called, OpenGL resources in the libretro implementation are guaranteed to be invalid.

It is possible that context_reset is called multiple times during an application lifecycle. If context_reset is called without any notification (context_destroy), the OpenGL context was lost and resources should just be recreated without any attempt to “free” old resources.

§get_current_framebuffer: retro_hw_get_current_framebuffer_t

Set by frontend. TODO: This is rather obsolete. The frontend should not be providing preallocated framebuffers.

§get_proc_address: retro_hw_get_proc_address_t

Set by frontend. Can return all relevant functions, including glClear on Windows.

§depth: bool

Set if render buffers should have depth component attached. TODO: Obsolete.

§stencil: bool

Set if stencil buffers should be attached. TODO: Obsolete.

§bottom_left_origin: bool

Use conventional bottom-left origin convention. If false, standard libretro top-left origin semantics are used. TODO: Move to GL specific interface.

§version_major: c_uint

Major version number for core GL context or GLES 3.1+.

§version_minor: c_uint

Minor version number for core GL context or GLES 3.1+.

§cache_context: bool

If this is true, the frontend will go very far to avoid resetting context in scenarios like toggling fullscreen, etc. TODO: Obsolete? Maybe frontend should just always assume this …

§context_destroy: retro_hw_context_reset_t

A callback to be called before the context is destroyed in a controlled way by the frontend.

§debug_context: bool

Creates a debug context.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.