webblender/
lib.rs

1use wasm_bindgen::prelude::*;
2use web_sys::{WebGl2RenderingContext, WebGlProgram};
3use std::rc::Rc;
4
5pub mod prelude{
6    pub use crate::app::App;
7    pub use crate::util::*;
8}
9use crate::prelude::*;
10
11pub mod gl;
12#[macro_use]
13pub mod util;
14pub mod app;
15
16#[allow(dead_code)]
17#[wasm_bindgen]
18pub struct WebGlView {
19    app: Rc<App>,
20    gl: Rc<WebGl2RenderingContext>,
21    program: Option<WebGlProgram>,
22}
23
24#[wasm_bindgen]
25impl WebGlView {
26    #[wasm_bindgen(constructor)]
27    pub fn new(gl: WebGl2RenderingContext) -> Self {
28        WebGlView {
29            app: Rc::new(App::new()),
30            gl: Rc::new(gl),
31            program: None
32        }
33    }
34    pub fn start(&self) {
35
36    }
37    pub fn update(&self){
38
39    }
40    pub fn render(&self){
41
42    }
43}