1
0
Fork 0
forked from AbleOS/ableos
ableos/sysdata/programs/horizon_testing_program/src/main.hb

37 lines
1.2 KiB
Plaintext
Raw Normal View History

2024-09-13 16:40:05 -05:00
stn := @use("../../../libraries/stn/src/lib.hb");
2024-09-14 00:31:35 -05:00
.{string, memory, buffer, log} := stn
2024-09-13 16:40:05 -05:00
horizon_api := @use("../../../libraries/horizon_api/src/lib.hb");
.{create_window} := horizon_api
2024-09-13 20:17:47 -05:00
ignim := @use("../../../libraries/ignim/src/lib.hb");
2024-09-14 00:31:35 -05:00
.{errors} := ignim
2024-09-13 20:17:47 -05:00
2024-09-13 16:40:05 -05:00
main := fn(): int {
2024-10-15 18:06:33 -05:00
x := 0
loop if x > 1000000 break else x += 1
2024-09-13 16:40:05 -05:00
2024-10-15 18:06:33 -05:00
windowing_system_buffer := buffer.search("XHorizon\0")
2024-09-13 20:17:47 -05:00
// TODO: get WindowID
2024-09-14 00:31:35 -05:00
create_window(windowing_system_buffer)
2024-10-15 18:06:33 -05:00
program_name := "Horizon Testing Program\0"
program_version := ignim.version.make_version(0, 1, 0)
engine_name := "None\0"
engine_version := ignim.version.make_version(0, 0, 0)
api_version := ignim.version.make_api_version(0, 1, 0, 0)
2024-09-14 00:31:35 -05:00
2024-10-15 18:06:33 -05:00
app_info := ignim.application.new_application_info(program_name, program_version, engine_name, engine_version, api_version)
2024-09-14 00:31:35 -05:00
2024-10-15 18:06:33 -05:00
create_info := ignim.instance.new_create_info(&app_info)
2024-09-14 00:31:35 -05:00
2024-10-15 18:06:33 -05:00
instance := ignim.instance.void_instance()
2024-09-14 00:31:35 -05:00
2024-10-15 17:25:11 -05:00
// // TODO: recursively follow this https://vulkan-tutorial.com/Drawing_a_triangle/Setup/Instance
2024-10-15 18:06:33 -05:00
ret := ignim.instance.create_instance(&create_info, 0, &instance)
if ret == errors.IncompatibleDriver {
// log.error("Driver Incompatible with Vulkan\0")
}
2024-09-13 20:17:47 -05:00
2024-09-13 16:40:05 -05:00
return 0
}