From ed7c8f20cb94b0f411d79de6ace1056661399be7 Mon Sep 17 00:00:00 2001 From: Able Date: Tue, 15 Oct 2024 17:06:38 -0500 Subject: [PATCH] animal crossing new Horizon beginnings --- sysdata/programs/horizon/src/main.hb | 28 ++++++++++++++++++++++++++++ sysdata/system_config.toml | 12 ++++++------ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/sysdata/programs/horizon/src/main.hb b/sysdata/programs/horizon/src/main.hb index 3c7c631..ada7eed 100644 --- a/sysdata/programs/horizon/src/main.hb +++ b/sysdata/programs/horizon/src/main.hb @@ -3,9 +3,37 @@ stn := @use("../../../libraries/stn/src/lib.hb"); horizon_api := @use("../../../libraries/horizon_api/src/lib.hb") +render := @use("../../../libraries/render/src/lib.hb"); +.{Vec2} := @use("../../../libraries/stn/src/lib.hb").math + +Window := struct { + // TODO: Replace this with widgets + // implicit_framebuffer: + width: int, + height: int, + x: int, + y: int, +} + main := fn(): int { a := buffer.create("XHorizon\0") + screen := render.init(true) + + image := render.new_surface(screen.width / 3, screen.height / 3) + + pos := Vec2(int).(100, 100) + loop { + // Clear the screen + render.clear(screen, render.black) + + // TODO: Get windows out of the hashmap + render.clear(image, render.white) + + // Apply the image to the screen + render.put_surface(screen, image, pos) + // Sync the screen + render.sync(screen) } return 0 diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index e5deef9..835b3fd 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -31,17 +31,17 @@ resolution = "1024x768x24" # [boot.limine.ableos.modules.diskio_driver] # path = "boot:///diskio_driver.hbf" -[boot.limine.ableos.modules.render_example] -path = "boot:///render_example.hbf" +# [boot.limine.ableos.modules.render_example] +# path = "boot:///render_example.hbf" # [boot.limine.ableos.modules.serial_driver_test] # path = "boot:///serial_driver_test.hbf" -# [boot.limine.ableos.modules.horizon] -# path = "boot:///horizon.hbf" +[boot.limine.ableos.modules.horizon] +path = "boot:///horizon.hbf" -# [boot.limine.ableos.modules.horizon_testing_program] -# path = "boot:///horizon_testing_program.hbf" +[boot.limine.ableos.modules.horizon_testing_program] +path = "boot:///horizon_testing_program.hbf" # [boot.limine.ableos.modules.dt_buffer_test] # path = "boot:///dt_buffer_test.hbf"