#[non_exhaustive]pub struct GlRenderOptions {
pub block_for_target_time: bool,
pub advanced_control: bool,
}Expand description
Attach-time knobs for the OpenGL backend
(Engine::attach_gl_render). The
default is mpv’s stock behavior — right for a toolkit paint handler
(GTK GLArea); shells whose render loop must not stall override per
field. Attach-time on purpose: frame pacing is a property of the
shell’s render loop, not of any single frame.
Non-exhaustive so future knobs stay additive — which also forbids
struct expressions outside this crate (E0639, functional record
update included), so construct through the chainable setters:
GlRenderOptions::default().block_for_target_time(false).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.block_for_target_time: boolBlock inside render_gl until the
frame’s target display time — mpv’s default, and the right pacing
when the toolkit’s frame clock drives drawing. Set false for
render loops that must not stall (e.g. preparing inside a
compositor-thread pass, where blocking would hold up the whole
scene submit): mpv then returns immediately and frame pacing is
yours — do your own timing, or set the video-timing-offset
property to 0 (mpv’s documented alternative).
advanced_control: boolmpv’s MPV_RENDER_PARAM_ADVANCED_CONTROL: enables direct
rendering and GPU screenshots, but obligates the shell to follow
the render API threading rules strictly and to call
render_update promptly after
every update callback (optional when this is off).
Implementations§
Source§impl GlRenderOptions
impl GlRenderOptions
Sourcepub fn block_for_target_time(self, block: bool) -> Self
pub fn block_for_target_time(self, block: bool) -> Self
Set block_for_target_time,
chainable from default().
Sourcepub fn advanced_control(self, advanced: bool) -> Self
pub fn advanced_control(self, advanced: bool) -> Self
Set advanced_control, chainable
from default().
Trait Implementations§
Source§impl Clone for GlRenderOptions
impl Clone for GlRenderOptions
Source§fn clone(&self) -> GlRenderOptions
fn clone(&self) -> GlRenderOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more