[][src]Struct nannou::frame::Frame

pub struct Frame { /* fields omitted */ }

A Frame to which the user can draw graphics before it is presented to the display.

Frames are delivered to the user for drawing via the user's view function.

See the RawFrame docs for more details on how the implementation works under the hood. The Frame type differs in that rather than drawing directly to the swapchain image the user may draw to an intermediary image. There are several advantages of drawing to an intermediary image.

Methods

impl Frame[src]

pub const DEFAULT_MSAA_SAMPLES: u32[src]

The default number of multisample anti-aliasing samples used if the window with which the Frame is associated supports it.

pub fn image(&self) -> &Arc<AttachmentImage>[src]

The image to which all graphics should be drawn this frame.

After the view function returns, this image will be resolved to the swapchain image for this frame and then that swapchain image will be presented to the screen.

pub fn image_is_new(&self) -> bool[src]

If the Frame's image is new because it is the first frame or because it was recently recreated to match the dimensions of the window's swapchain, this will return true.

This is useful for determining whether or not a user's framebuffer might need reconstruction in the case that it targets the frame's image.

pub fn image_format(&self) -> Format[src]

The color format of the Frame's intermediary image.

pub fn image_msaa_samples(&self) -> u32[src]

The number of MSAA samples of the Frame's intermediary image.

pub fn clear<C>(&self, color: C) where
    C: IntoRgba<f32>, 
[src]

Clear the image with the given color.

Methods from Deref<Target = RawFrame>

pub fn swapchain_image_is_new(&self) -> bool[src]

Returns whether or not this is the first time this swapchain image has been presented.

This will be true following each occurrence at which the swapchain has been recreated, which may occur during resize, loop mode switch, etc.

It is important to call this each frame to determine whether or not framebuffers associated with the swapchain need to be recreated.

pub fn add_commands(&self) -> AddCommands[src]

Add commands to be executed by the GPU once the RawFrame is returned.

pub fn window_id(&self) -> Id[src]

The Id of the window whose vulkan surface is associated with this frame.

pub fn nth(&self) -> u64[src]

The nth frame for the associated window since the application started.

E.g. the first frame yielded will return 0, the second will return 1, and so on.

pub fn swapchain_image(&self) -> &Arc<SwapchainImage>[src]

The swapchain image that will be the target for this frame.

NOTE: You should avoid using the returned SwapchainImage outside of the view function as it may become invalid at any moment. The reason we expose the Arc is that some of the vulkano API (including framebuffer creation) requires it to avoid some severe ownsership issues.

pub fn swapchain_image_index(&self) -> usize[src]

The index associated with the swapchain image that will be the target for this frame.

pub fn queue(&self) -> &Arc<Queue>[src]

The queue on which the swapchain image will be drawn.

Trait Implementations

impl Deref for Frame[src]

type Target = RawFrame

The resulting type after dereferencing.

Auto Trait Implementations

impl !Send for Frame

impl !Sync for Frame

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Content for T[src]

impl<T> SafeBorrow<T> for T[src]

impl<S> FromSample<S> for S[src]

impl<T, U> ToSample<U> for T where
    U: FromSample<T>, 
[src]

impl<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.