zuil
ZUIL
[!CAUTION] WIP
[!IMPORTANT] NOT TESTED ON WINDOWS
thebuild.ziglinks some libraries as system libraries
which i assume doesnt work on windows
ZUIL (Zig UI Library)
retained mode gui framework written in zig
using sdl3, zopengl, plutosvg, harfbuzz and freetype libs

current plan
rendering:
replace renderer with a painter interface system and allow casting to the actual backend if its a know type for more advanced stuff
examples
widgets
widgets are created using builder functions
// .c for common builder functions
widgets.container()
.c.size(.{.dp = 1200}, .{.percentage = 1})
.color(colors.WHITE)
.child(
widgets.list()
.c.size(.fill, .fill) // fill is same as .{.percentage = 1}
.direction(.vertical)
.spacing(1)
.children(.{
widgets.icon()
.c.size(.{.dp = 200}, .{.dp = 200})
.c.keepSizeRatio(true)
.icon("icon.svg")
.build(),
widgets.container()
.c.size(.{.dp = 50}, .{.dp = 30})
.c.eventCallback(containerClick) // fn (*ZWidget, *const ZEvent) callconv(.c) c_int
.color(colors.rgb(0, 1.0, 0.5))
.build(),
widgets.container()
.c.size(.{.pixel = 50}, .{.dp = 30})
.build(),
widgets.container()
.c.size(.{.mm = 50}, .{.dp = 30})
.build(),
widgets.container()
.c.size(.{.percentage = 0.5}, .{.dp = 30})
.build(),
})
.build()
)
.build();
test project
there is a test/example project in the test directory
keybinds:
space: change the background colorF1: spawn a new window
project structure
directories in src dir:
corehas the base widget systemapphas sdl3 specific things and can be used to create windows that use the core widget systemwidgetshas the default widgets