pub struct PistonWindow<W: Window = GlutinWindow> {
    pub window: W,
    pub encoder: GfxEncoder,
    pub device: Device,
    pub output_color: RenderTargetView<Resources, Srgba8>,
    pub output_stencil: DepthStencilView<Resources, DepthStencil>,
    pub g2d: Gfx2d<Resources>,
    pub events: Events,
    pub factory: Factory,
}
Expand description

Contains everything required for controlling window, graphics, event loop.

Fields

window: W

The window.

encoder: GfxEncoder

GFX encoder.

device: Device

GFX device.

output_color: RenderTargetView<Resources, Srgba8>

Output frame buffer.

output_stencil: DepthStencilView<Resources, DepthStencil>

Output stencil buffer.

g2d: Gfx2d<Resources>

Gfx2d.

events: Events

Event loop state.

factory: Factory

The factory that was created along with the device.

Implementations

Creates a new piston window.

Renders 2D graphics.

Calls the closure on render events. There is no need to filter events manually, and there is no overhead.

Renders 3D graphics.

Calls the closure on render events. There is no need to filter events manually, and there is no overhead.

Returns next event. Cleans up after rendering and resizes frame buffers.

Let window handle new event. Cleans up after rendering and resizes frame buffers.

Trait Implementations

Gets a copy of the title of the window.
Sets the title of the window.
Gets whether to exit when pressing esc. Read more
Sets whether to exit when pressing esc. Read more
Sets whether to capture/grab the cursor. Read more
Shows the window. Read more
Hides the window. Read more
Gets the position of window. Read more
Sets the position of window. Read more
Sets the window size. Read more
Sets title on window. Read more
Sets whether to exit when pressing the Esc button. Read more
Sets whether to capture/grab the cursor. Read more
Sets the position of window. Read more
Builds the window from a WindowSettings object. Read more
Returns event loop settings.
Sets event loop settings.
The number of updates per second Read more
The number of updates per second Read more
The number of delayed updates before skipping them to catch up. When set to 0, it will always try to catch up. Read more
The number of delayed updates before skipping them to catch up. When set to 0, it will always try to catch up. Read more
The maximum number of frames per second Read more
The maximum number of frames per second Read more
Enable or disable automatic swapping of buffers.
Enable or disable automatic swapping of buffers.
Enable or disable benchmark mode. When enabled, it will render and update without sleep and ignore input. Used to test performance by playing through as fast as possible. Requires lazy to be set to false. Read more
Enable or disable benchmark mode. When enabled, it will render and update without sleep and ignore input. Used to test performance by playing through as fast as possible. Requires lazy to be set to false. Read more
Enable or disable rendering only when receiving input. When enabled, update events are disabled. Idle events are emitted while receiving input. Read more
Enable or disable rendering only when receiving input. When enabled, update events are disabled. Idle events are emitted while receiving input. Read more
Returns true if the window should close.
Tells the window to close or stay open.
Gets the size of the window.
Gets the draw size of the window. Read more
Swaps render buffers. Read more
Wait indefinitely for an input event to be available from the window.
Wait for an input event to be available from the window or for the specified timeout to be reached. Read more
Polls an input event from the window. 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 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
Sets value as a parameter of self.
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.