RE ADD CONTEXT

This commit is contained in:
2025-12-15 21:50:53 -05:00
parent dc2be7f688
commit 0b8a93c5ce
39 changed files with 925 additions and 713 deletions

View File

@@ -1,14 +1,22 @@
use iris::prelude::*;
use winit::event_loop::ActiveEventLoop;
fn main() {
DefaultApp::<State>::run();
App::<State>::run();
}
struct State;
#[derive(HasUi, HasUiState)]
struct State {
ui: Ui<Self>,
ui_state: UiState<Self>,
}
impl DefaultAppState for State {
fn new(ui: &mut Ui, _state: &UiState, _proxy: Proxy<Self::Event>) -> Self {
rect(Color::RED).set_root(ui);
Self
fn new(event_loop: &ActiveEventLoop, _proxy: Proxy<Self::Event>) -> Self {
let mut ui = Ui::new();
let window = event_loop.create_window(Default::default()).unwrap();
let ui_state = UiState::new(window);
rect(Color::RED).set_root(&mut ui);
Self { ui, ui_state }
}
}