Skip to main content

FrameOutput

Struct FrameOutput 

Source
#[non_exhaustive]
pub struct FrameOutput<'a, V> { pub buffer: &'a GlyphBuffer, pub quit: bool, pub audio: &'a [AudioRequest<V>], pub music: &'a [MusicCommand], pub music_volume: f32, pub sound_volume: f32, pub fullscreen: bool, pub voice_volume: f32, pub frame_cap: FrameCap, pub frame_cap_serial: u32, }
Expand description

The result of one frame. V is the game’s voice clip variant. Only Game::frame builds one, so a field may come without breaking a game (ADR-0039).

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§buffer: &'a GlyphBuffer

What to show.

§quit: bool

Whether the game has asked to quit (it then ignores further input).

§audio: &'a [AudioRequest<V>]

Every audio request screens made this frame, in order. The platform plays the sounds; the music requests are already turned into music.

§music: &'a [MusicCommand]

What to do to the music this frame.

§music_volume: f32

The player’s music volume, 0–1: the platform multiplies the music’s own volume by it, also for a track already playing.

§sound_volume: f32

The player’s sound volume, 0–1: the platform multiplies every sound’s own volume by it.

§fullscreen: bool

Whether the game should fill the screen (the Fullscreen setting); the platform switches when this changes.

§voice_volume: f32

How loud voice clips play, 0–1 (Settings::voice_volume). The platform applies it to the voice that is playing too.

§frame_cap: FrameCap

The most frames a second to show (the player’s frame cap): the platform paces its frames to it from the next.

§frame_cap_serial: u32

The serial of the cap’s latest change (Ctx::frame_cap_serial): the platform reports it back once it has applied the cap (Game::set_pacing).

Trait Implementations§

Source§

impl<'a, V: Clone> Clone for FrameOutput<'a, V>

Source§

fn clone(&self) -> FrameOutput<'a, V>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, V: Copy> Copy for FrameOutput<'a, V>

Source§

impl<'a, V: Debug> Debug for FrameOutput<'a, V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, V> !Send for FrameOutput<'a, V>

§

impl<'a, V> !Sync for FrameOutput<'a, V>

§

impl<'a, V> Freeze for FrameOutput<'a, V>

§

impl<'a, V> RefUnwindSafe for FrameOutput<'a, V>
where V: RefUnwindSafe,

§

impl<'a, V> Unpin for FrameOutput<'a, V>

§

impl<'a, V> UnsafeUnpin for FrameOutput<'a, V>

§

impl<'a, V> UnwindSafe for FrameOutput<'a, V>
where V: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.