Struct piston_window::PistonWindow [] [src]

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,
}

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

Fields

The window.

GFX encoder.

GFX device.

Output frame buffer.

Output stencil buffer.

Gfx2d.

Event loop state.

The factory that was created along with the device.

Methods

impl<W> PistonWindow<W> where
    W: Window
[src]

[src]

Creates a new piston window.

[src]

Renders 2D graphics.

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

[src]

Renders 3D graphics.

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

[src]

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

[src]

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

Trait Implementations

impl<W> BuildFromWindowSettings for PistonWindow<W> where
    W: Window + OpenGLWindow + BuildFromWindowSettings
[src]

[src]

Builds the window from a WindowSettings object. Read more

impl<W> Window for PistonWindow<W> where
    W: Window
[src]

[src]

Returns true if the window should close.

[src]

Tells the window to close or stay open.

[src]

Gets the size of the window.

[src]

Gets the draw size of the window. Read more

[src]

Swaps render buffers. Read more

[src]

Wait indefinitely for an input event to be available from the window.

[src]

Wait for an input event to be available from the window or for the specified timeout to be reached. Read more

[src]

Polls an input event from the window. Read more

impl<W> AdvancedWindow for PistonWindow<W> where
    W: AdvancedWindow
[src]

[src]

Gets a copy of the title of the window.

[src]

Sets the title of the window.

[src]

Gets whether to exit when pressing esc. Read more

[src]

Sets whether to exit when pressing esc. Read more

[src]

Sets whether to capture/grab the cursor. Read more

[src]

Shows the window. Read more

[src]

Hides the window. Read more

[src]

Gets the position of window. Read more

[src]

Sets the position of window. Read more

[src]

Sets title on window. Read more

[src]

Sets whether to exit when pressing the Esc button. Read more

[src]

Sets whether to capture/grab the cursor. Read more

[src]

Sets the position of window. Read more

impl<W> EventLoop for PistonWindow<W> where
    W: Window
[src]

[src]

Returns event loop settings.

[src]

Sets event loop settings.

[src]

The number of updates per second Read more

[src]

The number of updates per second Read more

[src]

The number of delayed updates before skipping them to catch up. When set to 0, it will always try to catch up. Read more

[src]

The number of delayed updates before skipping them to catch up. When set to 0, it will always try to catch up. Read more

[src]

The maximum number of frames per second Read more

[src]

The maximum number of frames per second Read more

[src]

Enable or disable automatic swapping of buffers.

[src]

Enable or disable automatic swapping of buffers.

[src]

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

[src]

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

[src]

Enable or disable rendering only when receiving input. When enabled, update events are disabled. Idle events are emitted while receiving input. Read more

[src]

Enable or disable rendering only when receiving input. When enabled, update events are disabled. Idle events are emitted while receiving input. Read more