First working version of hot-reloading feature

This commit is contained in:
Riyyi
2026-09-06 23:35:21 +02:00
parent 6edcce16c6
commit 80bad9aad5
7 changed files with 314 additions and 43 deletions
+19 -5
View File
@@ -17,24 +17,38 @@ main :: proc() {
defer hot_reload.hot_reload_destroy(&hr)
api := hot_reload.active_lib(&hr)
api.init()
settings := api.settings()
// Initialize Window
os_init()
os_init(settings)
os_set_monitor(settings)
defer os_destroy()
// Initialize GPU resources
instance_init()
defer instance_destroy()
gt: f32
api.init_once()
api.init()
gt: f64 = 0
dt: f32
for !os_should_close() && !hot_reload.should_close(&hr) {
start := time.tick_now()
os_poll_events()
frame(gt)
api.update(dt)
gt = f32(time.duration_seconds(time.tick_since(start)))
frame(dt)
dt = f32(time.duration_seconds(time.tick_since(start)))
gt += f64(dt)
// Hot reload
api, err = hot_reload.reload_game_lib(&hr)
if err != nil do break
}
api.destroy()
}