added underdeveloped but working image support (no freeing or samplers)

This commit is contained in:
2025-08-22 23:07:31 -04:00
parent bde929b05a
commit 7dbdcbba42
26 changed files with 1256 additions and 155 deletions

View File

@@ -1,8 +1,8 @@
use std::sync::Arc;
use app::App;
use gui::*;
use render::Renderer;
use ui::*;
use winit::{event::WindowEvent, event_loop::ActiveEventLoop, window::Window};
use crate::testing::input::Input;
@@ -76,6 +76,8 @@ impl Client {
let span_add_test = ui.add(Span::empty(Dir::RIGHT).id(&span_add));
let main: WidgetId<Regioned> = ui.id();
let image_test = ui.add(image(include_bytes!("assets/sungals.png")));
fn switch_button<To>(
color: UiColor,
main: &WidgetId<Regioned>,
@@ -104,8 +106,9 @@ impl Client {
switch_button(UiColor::RED, &main, &pad_test),
switch_button(UiColor::GREEN, &main, &span_test),
switch_button(UiColor::BLUE, &main, &span_add_test),
switch_button(UiColor::MAGENTA, &main, &image_test),
)
.span(Dir::RIGHT, [1, 1, 1]),
.span(Dir::RIGHT, [1, 1, 1, 1]),
);
let test_button = Rect::new(Color::PURPLE)
.radius(30)
@@ -156,8 +159,8 @@ impl Client {
match event {
WindowEvent::CloseRequested => event_loop.exit(),
WindowEvent::RedrawRequested => {
let primitives = ui.update(self);
self.renderer.update(primitives);
let updates = ui.update(self);
self.renderer.update(updates);
self.renderer.draw()
}
WindowEvent::Resized(size) => self.renderer.resize(&size),