ableos/sysdata/programs/horizon_testing_program/src/main.hb

42 lines
1.3 KiB
Plaintext

stn := @use("../../../libraries/stn/src/lib.hb");
.{string, memory, buffer, log} := stn
horizon_api := @use("../../../libraries/horizon_api/src/lib.hb");
.{create_window} := horizon_api
ignim := @use("../../../libraries/ignim/src/lib.hb");
.{errors} := ignim
psf := @embed("../../../consolefonts/tamsyn/10x20r.psf")
main := fn(): int {
x := 0
// loop if x > 10000 break else x += 1
windowing_system_buffer := buffer.search("XHorizon\0")
// TODO: get WindowID
wid := create_window(windowing_system_buffer)
if false {
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)
app_info := ignim.application.new_application_info(program_name, program_version, engine_name, engine_version, api_version)
create_info := ignim.instance.new_create_info(&app_info)
instance := ignim.instance.void_instance()
// // TODO: recursively follow this https://vulkan-tutorial.com/Drawing_a_triangle/Setup/Instance
ret := ignim.instance.create_instance(&create_info, 0, &instance)
if ret == errors.IncompatibleDriver {
log.error("Driver Incompatible with Vulkan\0")
}
}
// TODO: get window from the window system and draw to the surface
return 0
}