This commit is contained in:
agra
2026-03-02 19:47:25 +02:00
parent 812bc6d6ec
commit e63c946116
33 changed files with 32185 additions and 202 deletions

View File

@@ -9,6 +9,7 @@
UIPipeline :: struct {
renderer: UIRenderer;
render_tree: RenderTree;
font: FontAtlas;
screen_width: f32;
screen_height: f32;
root: ViewChild;
@@ -22,8 +23,14 @@ UIPipeline :: struct {
self.has_root = false;
}
init_font :: (self: *UIPipeline, path: [:0]u8, size: f32) {
self.font.init(path, size);
upload_font_texture(@self.font);
set_global_font(@self.font);
}
set_root :: (self: *UIPipeline, view: View) {
self.root = ViewChild.make(view);
self.root = ViewChild.{ view = view };
self.has_root = true;
}
@@ -51,6 +58,7 @@ UIPipeline :: struct {
origin = Point.zero(),
size = root_size
};
print("tick: computed_frame=({},{},{},{})\n", self.root.computed_frame.origin.x, self.root.computed_frame.origin.y, self.root.computed_frame.size.width, self.root.computed_frame.size.height);
self.root.view.layout(self.root.computed_frame);
// Render to tree