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.
The factory that was created along with the device.
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.
Returns event loop settings.
Sets event loop settings.
fn ups(self, frames: u64) -> Self | |
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.
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
Builds the window from a WindowSettings
object. Read more
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
Gets the position of window.
Sets whether to exit when pressing the Esc button. Read more
Sets whether to capture/grab the cursor. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
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
.