Struct nannou::frame::raw::RawFrame[][src]

pub struct RawFrame<'swap_chain> { /* fields omitted */ }
Expand description

Allows the user to draw a single RawFrame to the surface of a window.

The application’s view function is called each time the application is ready to retrieve a new image that will be displayed to a window. The RawFrame type can be thought of as the canvas to which you draw this image.

Under the hood - WGPU

RawFrame provides access to the wgpu::TextureViewHandle associated with the swap chain’s current target texture for a single window.

In the case that your view function is shared between multiple windows, can determine which window the RawFrame is associated with via the RawFrame::window_id method.

The user can draw to the swap chain texture by building a list of commands via a wgpu::CommandEncoder and submitting them to the wgpu::Queue associated with the wgpu::Device that was used to create the swap chain. It is important that the queue matches the device. In an effort to reduce the chance for errors to occur, RawFrame provides access to a wgpu::CommandEncoder whose commands are guaranteed to be submitted to the correct wgpu::Queue at the end of the view function.

Implementations

Access the command encoder in order to encode commands that will be submitted to the swap chain queue at the end of the call to view.

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

A Rect representing the full surface of the frame.

The returned Rect is equivalent to the result of calling Window::rect on the window associated with this Frame.

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.

The swap chain texture that will be the target for drawing this frame.

The texture format of the frame’s swap chain texture.

The device and queue on which the swap chain was created and which will be used to submit the RawFrame’s encoded commands.

This refers to the same DeviceQueuePair as held by the window associated with this frame.

Submit the frame to the GPU!

Specifically, this submits the encoded commands to the queue of the device that was used to create the swap chain texture.

Note: You do not need to call this manually as submission will occur automatically when the Frame is dropped.

Note: Be careful that you do not currently possess a lock to either the frame’s command encoder or the queue of the window associated with this frame or this method will lock and block forever.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Convert the source color to the destination color using the specified method Read more

Convert the source color to the destination color using the bradford method by default Read more

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert into T with values clamped to the color defined bounds Read more

Convert into T. The resulting color might be invalid in its color space Read more

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. 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.