2024-09-18 03:38:49 -05:00
|
|
|
software := @use("software.hb")
|
2024-10-13 17:38:43 -05:00
|
|
|
image := @use("image.hb")
|
2024-09-13 16:41:31 -05:00
|
|
|
|
|
|
|
// default mode
|
|
|
|
mode := software
|
|
|
|
|
|
|
|
init := mode.init
|
|
|
|
doublebuffer := mode.doublebuffer
|
2024-10-17 09:31:42 -05:00
|
|
|
Surface := mode.Surface
|
|
|
|
new_surface := mode.new_surface
|
|
|
|
surface_from_ptr := mode.surface_from_ptr
|
|
|
|
clone_surface := mode.clone_surface
|
|
|
|
free_surface := mode.free_surface
|
2024-10-19 09:54:19 -05:00
|
|
|
index := mode.index
|
|
|
|
indexptr := mode.indexptr
|
2024-10-14 19:24:29 -05:00
|
|
|
|
2024-09-13 16:41:31 -05:00
|
|
|
// Colours
|
2024-10-13 17:38:43 -05:00
|
|
|
Color := packed struct {b: u8, g: u8, r: u8, a: u8}
|
|
|
|
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)
|
2024-09-13 16:41:31 -05:00
|
|
|
|
|
|
|
// 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
|
2024-10-14 19:24:29 -05:00
|
|
|
put_surface := mode.put_surface
|
2024-10-13 17:38:43 -05:00
|
|
|
// thanks peony for these three!
|
|
|
|
put_trirect := mode.put_trirect
|
|
|
|
put_vline := mode.put_vline
|
|
|
|
put_hline := mode.put_hline
|
2024-09-13 16:41:31 -05:00
|
|
|
|
|
|
|
// Display
|
2024-10-13 17:38:43 -05:00
|
|
|
sync := mode.sync
|