summaryrefslogtreecommitdiff
path: root/webhogg/wasm/src/graphics.rs
blob: a879c5eb00745a155d0d4d879e204dad3c040b82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use wasm_bindgen::prelude::*;
use log::*;
use crate::*;

#[wasm_bindgen]
pub fn start_graphics(canvas: web_sys::OffscreenCanvas) {
    logger::init_logger();
    info!("graphics: wasm entry-point reached");

    match context::graphics::GraphicsContext::from_canvas(canvas) {
        Ok(ctx) => context::set_graphics(ctx),
        Err(e) => error!("graphics {}", e)
    }
}

#[wasm_bindgen]
pub fn loop_graphics() {
    debug!("graphics: loopin'");
}