[][src]Struct kiss3d::window::Canvas

pub struct Canvas { /* fields omitted */ }

An abstract structure representing a window for native applications, and a canvas for web applications.

Implementations

impl Canvas[src]

pub fn open(
    title: &str,
    hide: bool,
    width: u32,
    height: u32,
    canvas_setup: Option<CanvasSetup>,
    out_events: Sender<WindowEvent>
) -> Self
[src]

Open a new window, and initialize the OpenGL/WebGL context.

pub fn render_loop(data: impl FnMut(f64) -> bool + 'static)[src]

Run the platform-specific render loop.

pub fn poll_events(&mut self)[src]

Poll all events tha occurred since the last call to this method.

pub fn swap_buffers(&mut self)[src]

If double-buffering is supported, swap the buffers.

pub fn size(&self) -> (u32, u32)[src]

The size of the window.

pub fn cursor_pos(&self) -> Option<(f64, f64)>[src]

The current position of the cursor, if known.

This position may not be known if, e.g., the cursor has not been moved since the window was open.

pub fn scale_factor(&self) -> f64[src]

The scale factor.

pub fn set_title(&mut self, title: &str)[src]

Set the window title.

pub fn set_icon(
    &mut self,
    icon: impl GenericImage<Pixel = impl Pixel<Subpixel = u8>>
)
[src]

Set the window icon. See Window::set_icon for details.

pub fn set_cursor_grab(&self, grab: bool)[src]

Set the cursor grabbing behaviour.

pub fn set_cursor_position(&self, x: f64, y: f64)[src]

pub fn hide_cursor(&self, hide: bool)[src]

pub fn hide(&mut self)[src]

Hide the window.

pub fn show(&mut self)[src]

Show the window.

pub fn get_mouse_button(&self, button: MouseButton) -> Action[src]

The state of a mouse button.

pub fn get_key(&self, key: Key) -> Action[src]

The state of a key.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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