2024-11-13 17:08:20 -06:00
|
|
|
.{log} := @use("../../../libraries/stn/src/lib.hb")
|
2024-11-10 12:57:48 -06:00
|
|
|
sunset := @use("../../../libraries/sunset_proto/src/lib.hb")
|
2024-11-11 15:48:43 -06:00
|
|
|
render := @use("../../../libraries/render/src/lib.hb")
|
2024-11-10 12:57:48 -06:00
|
|
|
|
2024-11-14 10:43:23 -06:00
|
|
|
bmp := @embed("../../../assets/mini.bmp")
|
|
|
|
|
2024-11-10 12:57:48 -06:00
|
|
|
main := fn(): void {
|
2024-11-11 15:48:43 -06:00
|
|
|
sunset.client.find_server()
|
2024-11-14 10:43:23 -06:00
|
|
|
|
2024-11-14 15:28:21 -06:00
|
|
|
image := render.image.bmp.from(@bitcast(&bmp))
|
2024-11-14 10:43:23 -06:00
|
|
|
if image == null {
|
|
|
|
log.error("got no image\0")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2024-11-14 15:28:21 -06:00
|
|
|
window := sunset.client.new(.(.(100, 100), .(200, 200), "Hello,\0"))
|
|
|
|
|
2024-11-13 11:03:31 -06:00
|
|
|
if window == null {
|
|
|
|
log.error("got no window\0")
|
2024-11-10 12:57:48 -06:00
|
|
|
return
|
|
|
|
}
|
2024-11-13 17:08:20 -06:00
|
|
|
x := 0
|
|
|
|
loop {
|
2024-11-14 15:28:21 -06:00
|
|
|
render.clear(window.surface, render.black)
|
2024-11-14 10:43:23 -06:00
|
|
|
render.put_surface(window.surface, image, .(image.width + x % window.data.props.dimensions.x, 20), false)
|
2024-11-14 15:28:21 -06:00
|
|
|
_ = sunset.client.send_frame(window)
|
2024-11-13 17:08:20 -06:00
|
|
|
x += 1
|
2024-11-11 15:48:43 -06:00
|
|
|
}
|
2024-11-10 12:57:48 -06:00
|
|
|
}
|