Compare commits

..

No commits in common. "8849017db2b1fd305b5cbf87c8230bd08f83023a" and "5eff0facb17881dce3977b0c43016014c821c056" have entirely different histories.

12 changed files with 49 additions and 125 deletions

View file

@ -38,9 +38,9 @@ Label := struct {
} }
render_label_to_surface := fn(surface: Surface, label: Label, font: Font, pos: Vec2(uint)): void { render_label_to_surface := fn(surface: Surface, label: Label, font: Font, pos: Vec2(uint)): void {
// if label.is_dirty { if label.is_dirty {
render.clear(label.surface, label.bg) label.surface.clear(label.bg)
render.put_text(label.surface, font, .(0, 0), label.fg, label.text) label.surface.put_text(font, .(0, 0), label.fg, label.text)
// } }
render.put_surface(surface, label.surface, pos, false) surface.put_surface(label.surface, pos, false)
} }

View file

@ -11,7 +11,7 @@ horizon_api := @use("../../../libraries/horizon_api/src/lib.hb");
main := fn(): void { main := fn(): void {
sunset.client.find_server() sunset.client.find_server()
window := sunset.client.new(.(.(10, 10), .(400, 300), "ableFetch!\0")) window := sunset.client.new(.(.(400, 100), .(400, 300), "ableFetch!\0"))
font := @unwrap(render.text.font_from_psf2(@bitcast(&psf), false)) font := @unwrap(render.text.font_from_psf2(@bitcast(&psf), false))
// pos := Vec2(uint).(1, 100) // pos := Vec2(uint).(1, 100)
@ -21,27 +21,26 @@ main := fn(): void {
} }
text_label := Label.new_label("kernel : akern 0.2.0\0", 300) text_label := Label.new_label("kernel : akern 0.2.0\0", 300)
text_label_2 := Label.new_label("os : ableos\0", 300) text_label.set_color(sunset.server.DECO_COLOUR, render.BLACK)
text_label_3 := Label.new_label("wm : sunset\0", 300)
text_label.set_color(render.black, render.white)
text_label_2.set_color(render.black, render.white) text_label_2 := Label.new_label("os : ableos\0", 300)
text_label_3.set_color(render.black, render.white) 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)
pos1 := Vec2(uint).(1, 1)
pos2 := Vec2(uint).(1, 20)
pos3 := Vec2(uint).(1, 40)
// render.clear(window.surface, render.black)
render_label_to_surface(window.surface, text_label, font, pos1)
render_label_to_surface(window.surface, text_label_2, font, pos2)
render_label_to_surface(window.surface, text_label_3, font, pos3)
loop { loop {
// stn.log.info("AAAA\0") render.clear(window.surface, render.BLACK)
// render.put_text(text_label.surface, font, pos1, text_label.fg, text_label.text) // render.put_surface(window.surface, image, .(image.width + x % window.data.props.dimensions.x, 40), false)
// render.put_text(text_label_2.surface, font, pos2, text_label_2.fg, text_label_2.text) pos := Vec2(uint).(1, 100)
// render.put_text(text_label_3.surface, font, pos3, text_label_3.fg, text_label_3.text)
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) _ = sunset.client.send_frame(window)
// stn.sleep.sleep_until_interrupt(100)
} }
} }

View file

@ -1,5 +0,0 @@
# angels_halo
A Minix 3 style reincarnation service.
Running in the background restarting your drivers.

View file

@ -1,11 +0,0 @@
[package]
name = "angels_halo"
authors = ["able"]
[dependants.libraries]
[dependants.binaries]
hblang.version = "1.0.0"
[build]
command = "hblang src/main.hb"

View file

@ -1,7 +0,0 @@
(pkg angels-halo
(authors ("able"))
(version 0 1 0))
(dependencies
(libraries ())
(programs (hblang)))

View file

@ -1,20 +0,0 @@
stn := @use("stn");
.{log} := stn;
.{ProcessID} := stn.acs
Strategy := enum {
None,
Restart,
}
MonitoredProcess := struct {
pid: ProcessID,
}
main := fn(): int {
log.info("Angels Halo reincarnation server started.\0")
return 0
}

View file

@ -31,7 +31,7 @@ example := fn(): void {
window := @as(?sunset.Window, null) window := @as(?sunset.Window, null)
if USE_SUNSET { if USE_SUNSET {
sunset.client.find_server() sunset.client.find_server()
window = sunset.client.new(.(.(450, 140), .(400, 400), "Mandelbrot Set\0")) window = sunset.client.new(.(.(400, 140), .(400, 400), "Mandelbrot Set\0"))
if window == null { if window == null {
log.error("got no window\0") log.error("got no window\0")
return return

View file

@ -13,7 +13,7 @@ main := fn(): void {
return return
} }
window := sunset.client.new(.(.(400, 400), .(200, 200), "Hello\0")) window := sunset.client.new(.(.(100, 100), .(200, 200), "Hello,\0"))
if window == null { if window == null {
log.error("got no window\0") log.error("got no window\0")

View file

@ -2,7 +2,7 @@
sunset := @use("../../../libraries/sunset_proto/src/lib.hb") sunset := @use("../../../libraries/sunset_proto/src/lib.hb")
render := @use("../../../libraries/render/src/lib.hb") render := @use("../../../libraries/render/src/lib.hb")
bmp := @embed("../../../assets/mini.bmp") bmp := @embed("../../../assets/able.bmp")
main := fn(): void { main := fn(): void {
sunset.client.find_server() sunset.client.find_server()
@ -13,7 +13,7 @@ main := fn(): void {
return return
} }
window := sunset.client.new(.(.(100, 350), .(400, 240), "Sunset!\0")) window := sunset.client.new(.(.(400, 100), .(400, 240), "Sunset!\0"))
if window == null { if window == null {
log.error("got no window\0") log.error("got no window\0")

View file

@ -11,30 +11,6 @@ stn := @use("../../../libraries/stn/src/lib.hb");
psf := @embed("../../../assets/consolefonts/tamsyn/10x20r.psf") psf := @embed("../../../assets/consolefonts/tamsyn/10x20r.psf")
img := @embed("../../../assets/wallpaper.qoi") img := @embed("../../../assets/wallpaper.qoi")
Mouse := struct {
x: uint,
y: uint,
// TODO: Make this configurable via wm config
cursor_width: u8,
max_x: uint,
max_y: uint,
new := fn(max_x: uint, max_y: uint): Self {
center_x := max_x / 2
center_y := max_y / 2
return Self.(center_x, center_y, 3, max_x, max_y)
}
/*
center := fn(self: Self){
center_x := max_x / 2
center_y := max_y / 2
return Self.(center_x, center_y, 3, max_x, max_y)
}*/
}
main := fn(): int { main := fn(): int {
sunset.server.start() sunset.server.start()
defer { defer {
@ -51,11 +27,8 @@ main := fn(): int {
return 1 return 1
} }
// mouse_x := 100 mouse_x := 100
// mouse_y := 100 mouse_y := 100
mouse := Mouse.new(screen.width, screen.height)
//mouse.center()
text_label := Label.new_label("\0", 1024) text_label := Label.new_label("\0", 1024)
text_label.set_color(sunset.server.DECO_COLOUR, render.BLACK) text_label.set_color(sunset.server.DECO_COLOUR, render.BLACK)
@ -67,24 +40,24 @@ main := fn(): int {
change_x = change_x << 8 change_x = change_x << 8
change_x = change_x >> 8 change_x = change_x >> 8
mouse.x += change_x mouse_x += change_x
if mouse.x <= 0 { if mouse_x <= 0 {
mouse.x = 0 mouse_x = 0
} }
if mouse.x >= screen.width - 20 { if mouse_x >= screen.width - 20 {
mouse.x = @intcast(screen.width - 21) mouse_x = @intcast(screen.width - 21)
} }
change_y := @as(i16, mouse_event.y_change) change_y := @as(i16, mouse_event.y_change)
change_y = change_y << 8 change_y = change_y << 8
change_y = change_y >> 8 change_y = change_y >> 8
mouse.y -= change_y mouse_y -= change_y
if mouse.y < 0 { if mouse_y < 0 {
mouse.y = 1 mouse_y = 1
} }
if mouse.y >= screen.height - 20 { if mouse_y >= screen.height - 20 {
mouse.y = @intcast(screen.height - 21) mouse_y = @intcast(screen.height - 21)
} }
if mouse_event.left { if mouse_event.left {
@ -119,8 +92,8 @@ main := fn(): int {
// Mouse cursor // Mouse cursor
{ {
render.put_filled_circle(screen, .(mouse.x, mouse.y), mouse.cursor_width, sunset.server.DECO_COLOUR_DARKER) screen.put_filled_circle(.(mouse_x, mouse_y), 10, sunset.server.DECO_COLOUR_DARKER)
render.put_circle(screen, .(mouse.x, mouse.y), mouse.cursor_width, sunset.server.DECO_COLOUR) screen.put_circle(.(mouse_x, mouse_y), 10, sunset.server.DECO_COLOUR)
} }
screen.sync() screen.sync()

View file

@ -26,9 +26,8 @@ resolution = "1024x768x24"
[boot.limine.ableos.modules.render_example] [boot.limine.ableos.modules.render_example]
path = "boot:///render_example.hbf" path = "boot:///render_example.hbf"
# [boot.limine.ableos.modules.sunset_server]
[boot.limine.ableos.modules.sunset_server] # path = "boot:///sunset_server.hbf"
path = "boot:///sunset_server.hbf"
# [boot.limine.ableos.modules.ps2_mouse_driver] # [boot.limine.ableos.modules.ps2_mouse_driver]
# path = "boot:///ps2_mouse_driver.hbf" # path = "boot:///ps2_mouse_driver.hbf"
@ -39,15 +38,11 @@ path = "boot:///sunset_server.hbf"
# [boot.limine.ableos.modules.ps2_driver] # [boot.limine.ableos.modules.ps2_driver]
# path = "boot:///ps2_driver.hbf" # path = "boot:///ps2_driver.hbf"
# [boot.limine.ableos.modules.sunset_client_2] # [boot.limine.ableos.modules.sunset_client]
# path = "boot:///sunset_client_2.hbf" # path = "boot:///sunset_client.hbf"
[boot.limine.ableos.modules.ablefetch] # [boot.limine.ableos.modules.ablefetch]
path = "boot:///ablefetch.hbf" # path = "boot:///ablefetch.hbf"
# [boot.limine.ableos.modules.diskio_driver] # [boot.limine.ableos.modules.diskio_driver]
# path = "boot:///diskio_driver.hbf" # path = "boot:///diskio_driver.hbf"
#[boot.limine.ableos.modules.angels_halo]
#path = "boot:///angels_halo.hbf"