This commit is contained in:
agra
2026-03-03 13:25:25 +02:00
parent 6ffe22acb0
commit 343ea4bf08
9 changed files with 736 additions and 169 deletions

View File

@@ -9,7 +9,7 @@
UIPipeline :: struct {
renderer: UIRenderer;
render_tree: RenderTree;
font: FontAtlas;
font: GlyphCache;
screen_width: f32;
screen_height: f32;
root: ViewChild;
@@ -23,9 +23,10 @@ UIPipeline :: struct {
self.has_root = false;
}
init_font :: (self: *UIPipeline, path: [:0]u8, size: f32) {
init_font :: (self: *UIPipeline, path: [:0]u8, size: f32, dpi_scale: f32) {
self.font.init(path, size);
upload_font_texture(@self.font);
self.font.set_dpi_scale(dpi_scale);
self.renderer.dpi_scale = dpi_scale;
set_global_font(@self.font);
}
@@ -58,7 +59,6 @@ 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