forked from AbleOS/ableos
46 lines
1.6 KiB
Plaintext
46 lines
1.6 KiB
Plaintext
|
.{log} := @use("../../../libraries/stn/src/lib.hb")
|
||
|
sunset := @use("../../../libraries/sunset_proto/src/lib.hb")
|
||
|
render := @use("../../../libraries/render/src/lib.hb")
|
||
|
stn := @use("../../../libraries/stn/src/lib.hb");
|
||
|
.{Vec2} := stn.math
|
||
|
psf := @embed("../../../assets/consolefonts/tamsyn/10x20r.psf")
|
||
|
|
||
|
horizon_api := @use("../../../libraries/horizon_api/src/lib.hb");
|
||
|
.{set_color, render_label_to_surface, Label} := horizon_api.widgets.label
|
||
|
|
||
|
main := fn(): void {
|
||
|
sunset.client.find_server()
|
||
|
|
||
|
window := sunset.client.new(.(.(400, 100), .(400, 300), "ableFetch!\0"))
|
||
|
font := @unwrap(render.text.font_from_psf2(@bitcast(&psf), false))
|
||
|
// pos := Vec2(uint).(1, 100)
|
||
|
|
||
|
if window == null {
|
||
|
log.error("got no window\0")
|
||
|
return
|
||
|
}
|
||
|
|
||
|
text_label := Label.new_label("kernel : akern 0.2.0\0", 300)
|
||
|
text_label.set_color(sunset.server.DECO_COLOUR, render.black)
|
||
|
|
||
|
text_label_2 := Label.new_label("os : ableos\0", 300)
|
||
|
text_label_2.set_color(sunset.server.DECO_COLOUR, render.black)
|
||
|
text_label_3 := Label.new_label("wm : sunset\0", 300)
|
||
|
text_label_3.set_color(sunset.server.DECO_COLOUR, render.black)
|
||
|
|
||
|
loop {
|
||
|
render.clear(window.surface, render.black)
|
||
|
// render.put_surface(window.surface, image, .(image.width + x % window.data.props.dimensions.x, 40), false)
|
||
|
pos := Vec2(uint).(1, 100)
|
||
|
|
||
|
render_label_to_surface(window.surface, text_label, font, pos)
|
||
|
pos = Vec2(uint).(1, 120)
|
||
|
|
||
|
render_label_to_surface(window.surface, text_label_2, font, pos)
|
||
|
|
||
|
pos = Vec2(uint).(1, 140)
|
||
|
render_label_to_surface(window.surface, text_label_3, font, pos)
|
||
|
|
||
|
_ = sunset.client.send_frame(window)
|
||
|
}
|
||
|
}
|