examples(webgl): stop using old window static methods

These were removed and replaced with normal methods on window and a standalone
function to get the global window.
This commit is contained in:
Nick Fitzgerald 2018-09-19 13:18:48 -07:00
parent b36708fd85
commit 0c41c0b432

View File

@ -8,7 +8,7 @@ use web_sys::{WebGlProgram, WebGlRenderingContext, WebGlShader};
#[wasm_bindgen]
pub fn draw() {
let document = web_sys::Window::document().unwrap();
let document = web_sys::window().unwrap().document().unwrap();
let canvas = document.get_element_by_id("canvas").unwrap();
let canvas: web_sys::HtmlCanvasElement = canvas
.dyn_into::<web_sys::HtmlCanvasElement>()