36 lines
529 B
Odin
36 lines
529 B
Odin
package main
|
|
|
|
import game "../src"
|
|
import "base:runtime"
|
|
|
|
// ignored
|
|
main :: proc() {}
|
|
|
|
is_init: bool
|
|
|
|
init_hook :: proc() {
|
|
global_ctx := runtime.default_context_ptr()
|
|
game.init(global_ctx)
|
|
}
|
|
|
|
exit_hook :: proc() {
|
|
game.exit()
|
|
}
|
|
|
|
update_hook :: proc() -> bool {
|
|
return game.update()
|
|
}
|
|
|
|
@(export)
|
|
step :: proc(delta_time: f64) -> bool {
|
|
if !is_init {
|
|
init_hook()
|
|
is_init = true
|
|
}
|
|
|
|
keep_running := update_hook()
|
|
if !keep_running {
|
|
exit_hook()
|
|
}
|
|
return keep_running
|
|
} |