summaryrefslogtreecommitdiff
path: root/webhogg/wasm/src/graphics.rs
blob: 8169a3c329f5e404481f1cbd78cd4c5838c153b2 (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() {
    logger::init_logger();
    info!("graphics: wasm entry-point reached");

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

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