forked from AbleOS/ableos
koniifer
96c2bd5cd5
restructure render lib add peony's render api additions and example add image example fix some dubious bugs i had made in unused code in mem_serve.rs remove tetris stub (now in peony's fork) update hblang
50 lines
1.3 KiB
Plaintext
50 lines
1.3 KiB
Plaintext
svga := @use("svga.hb")
|
|
software := @use("software.hb")
|
|
image := @use("image.hb")
|
|
|
|
// default mode
|
|
mode := software
|
|
|
|
init := mode.init
|
|
doublebuffer := mode.doublebuffer
|
|
|
|
// Colours
|
|
Color := packed struct {b: u8, g: u8, r: u8, a: u8}
|
|
Image := image.Image
|
|
white := Color.(255, 255, 255, 255)
|
|
black := Color.(0, 0, 0, 255)
|
|
gray := Color.(127, 127, 127, 255)
|
|
red := Color.(0, 0, 205, 255)
|
|
green := Color.(0, 205, 0, 255)
|
|
yellow := Color.(0, 205, 205, 255)
|
|
blue := Color.(205, 0, 0, 255)
|
|
magenta := Color.(205, 0, 205, 255)
|
|
cyan := Color.(205, 205, 0, 255)
|
|
light_gray := Color.(229, 229, 229, 255)
|
|
light_red := Color.(0, 0, 255, 255)
|
|
light_green := Color.(0, 255, 0, 255)
|
|
light_yellow := Color.(0, 255, 255, 255)
|
|
light_blue := Color.(255, 0, 0, 255)
|
|
light_magenta := Color.(255, 0, 255, 255)
|
|
light_cyan := Color.(255, 255, 0, 255)
|
|
|
|
// Drawing
|
|
put_pixel := mode.put_pixel
|
|
put_rect := mode.put_rect
|
|
put_filled_rect := mode.put_filled_rect
|
|
put_line := mode.put_line
|
|
clear := mode.clear
|
|
put_image := mode.put_image
|
|
// thanks peony for these three!
|
|
put_trirect := mode.put_trirect
|
|
put_vline := mode.put_vline
|
|
put_hline := mode.put_hline
|
|
|
|
// Display
|
|
width := mode.width
|
|
height := mode.height
|
|
dimensions := mode.dimensions
|
|
set_height := mode.set_height
|
|
set_width := mode.set_width
|
|
set_dimensions := mode.set_dimensions
|
|
sync := mode.sync |