Struct Window

Source
pub struct Window {
    pub input: Input,
    pub renderer: Renderer,
    pub factory: Factory,
    pub scene: Scene,
    pub reset_input: bool,
    /* private fields */
}
Expand description

Window is the core entity of every three-rs application.

It provides user input, Factory and Renderer.

Fields§

§input: Input

See Input.

§renderer: Renderer

See Renderer.

§factory: Factory

See Factory.

§scene: Scene

See Scene.

§reset_input: bool

Reset input on each frame? See Input::reset.

Defaults to true.

Implementations§

Source§

impl Window

Source

pub fn new<T: Into<String>>(title: T) -> Self

Create a new window with default parameters.

Source

pub fn builder<T: Into<String>>(title: T) -> Builder

Create new Builder with standard parameters.

Source

pub fn update(&mut self) -> bool

update method returns false if the window was closed.

Source

pub fn render(&mut self, camera: &Camera)

Render the current scene with specific Camera.

Source

pub fn size(&self) -> Vector2<f32>

Get current window size in pixels.

Source

pub fn glutin_window(&self) -> &GlWindow

Returns underlaying glutin::GlWindow.

Source

pub fn is_fullscreen(&self) -> bool

Returns the current full screen mode.

Source

pub fn set_fullscreen(&mut self, fullscreen: bool)

Sets the full screen mode. If the window is already in full screen mode, does nothing.

Source

pub fn toggle_fullscreen(&mut self) -> bool

Toggles the full screen mode. Returns the new actual mode.

Auto Trait Implementations§

§

impl !Freeze for Window

§

impl !RefUnwindSafe for Window

§

impl !Send for Window

§

impl !Sync for Window

§

impl Unpin for Window

§

impl !UnwindSafe for Window

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> SetParameter for T

Source§

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

Sets value as a parameter of self.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Erased for T