2024-11-06 19:55:08 -06:00
|
|
|
.{log} := @use("../../../../libraries/stn/src/lib.hb")
|
2024-10-13 17:38:43 -05:00
|
|
|
render := @use("../../../../libraries/render/src/lib.hb")
|
|
|
|
|
|
|
|
/* expected result:
|
2024-11-06 19:55:08 -06:00
|
|
|
a cute qoi image and a cute bmp image */
|
2024-10-13 17:38:43 -05:00
|
|
|
|
2024-11-06 19:55:08 -06:00
|
|
|
qoi := @embed("./assets/mini.qoi")
|
|
|
|
bmp := @embed("./assets/mini.bmp")
|
2024-10-13 17:38:43 -05:00
|
|
|
|
|
|
|
example := fn(): void {
|
2024-10-19 09:54:19 -05:00
|
|
|
screen := render.init(true)
|
2024-11-06 19:55:08 -06:00
|
|
|
image_qoi := render.image.from(@bitcast(&qoi))
|
|
|
|
image_bmp := render.image.from(@bitcast(&bmp))
|
2024-10-13 17:38:43 -05:00
|
|
|
|
2024-11-06 19:55:08 -06:00
|
|
|
if image_qoi == null {
|
|
|
|
log.error("failed to load qoi image for whatever reason\0")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if image_bmp == null {
|
|
|
|
log.error("failed to load bmp image for whatever reason\0")
|
|
|
|
return
|
2024-10-13 17:38:43 -05:00
|
|
|
}
|
2024-11-06 19:55:08 -06:00
|
|
|
|
|
|
|
render.clear(screen, render.black)
|
|
|
|
render.put_surface(screen, image_bmp, .((screen.width - image_bmp.width * 3) / 2, (screen.height - image_bmp.height) / 2), false)
|
|
|
|
render.put_surface(screen, image_qoi, .((screen.width + image_qoi.width) / 2, (screen.height - image_qoi.height) / 2), false)
|
|
|
|
render.sync(screen)
|
2024-10-13 17:38:43 -05:00
|
|
|
return
|
|
|
|
}
|