mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
Implement stdweb backend for web platform
This commit is contained in:
@@ -1,6 +1,21 @@
|
||||
#[cfg(feature = "stdweb")]
|
||||
impl WindowExtStdweb for RootWindow {
|
||||
mod canvas;
|
||||
mod event;
|
||||
mod timeout;
|
||||
|
||||
pub use self::canvas::Canvas;
|
||||
pub use self::timeout::Timeout;
|
||||
|
||||
use crate::platform::web::WindowExtStdweb;
|
||||
use crate::window::Window;
|
||||
|
||||
use stdweb::web::html_element::CanvasElement;
|
||||
|
||||
pub fn throw(msg: &str) {
|
||||
js! { throw @{msg} }
|
||||
}
|
||||
|
||||
impl WindowExtStdweb for Window {
|
||||
fn canvas(&self) -> CanvasElement {
|
||||
self.window.canvas.clone()
|
||||
self.window.canvas().raw().clone()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user