#[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; pub use glam::Vec2; pub mod abi; pub mod draw; pub mod panel; pub mod widgets; use abi::UiPanel; use widgets::Widget; pub struct DummyPanel { panel: UiPanel, button: widgets::RoundButton, } impl DummyPanel { fn bind(panel: UiPanel) -> Self { Self { panel, button: widgets::RoundButton { pos: Vec2::new(0., 0.), }, } } } impl abi::PanelImpl for DummyPanel { fn update(&mut self, dt: f32) { self.button.update(dt); let ctx = draw::DrawContext::new(self.panel); self.button.draw(&ctx); } } #[repr(C)] #[derive(Copy, Clone, Debug)] pub struct Color { pub r: f32, pub g: f32, pub b: f32, pub a: f32, }