Struct three::window::Window
[−]
[src]
pub struct Window { pub input: Input, pub renderer: Renderer, pub factory: Factory, pub scene: Scene, pub reset_input: bool, // some fields omitted }
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
.
Methods
impl Window
[src]
pub fn new<T: Into<String>>(title: T) -> Self
[src]
Create a new window with default parameters.
pub fn builder<T: Into<String>>(title: T) -> Builder
[src]
Create new Builder
with standard parameters.
pub fn update(&mut self) -> bool
[src]
update
method returns false
if the window was closed.
pub fn render(&mut self, camera: &Camera)
[src]
Render the current scene with specific Camera
.
pub fn size(&self) -> Vector2<f32>
[src]
Get current window size in pixels.
pub fn set_cursor_state(&self, state: CursorState)
[src]
Sets how the cursor should be handled.
See the documentation for CursorState
for the possible cursor states.
Note that if you use CursorState::Grab
, you should use Input::mouse_delta_raw
for
detecting mouse movement, as Input::mouse_delta
will only report movement of the cursor
within the window.
pub fn glutin_window(&self) -> &GlWindow
[src]
Returns underlaying glutin::GlWindow
.