[−][src]Struct kiss3d::window::Canvas
An abstract structure representing a window for native applications, and a canvas for web applications.
Methods
impl Canvas
[src]
pub fn open(
title: &str,
hide: bool,
width: u32,
height: u32,
canvas_setup: Option<CanvasSetup>,
out_events: Sender<WindowEvent>
) -> Self
[src]
title: &str,
hide: bool,
width: u32,
height: u32,
canvas_setup: Option<CanvasSetup>,
out_events: Sender<WindowEvent>
) -> Self
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 hidpi_factor(&self) -> f64
[src]
The high-dpi 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]
&mut self,
icon: impl GenericImage<Pixel = impl Pixel<Subpixel = u8>>
)
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 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
impl !RefUnwindSafe for Canvas
impl !Send for Canvas
impl !Sync for Canvas
impl Unpin for Canvas
impl !UnwindSafe for Canvas
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,