;; open this dll
(bind-func static godot_gdnative_init
(lambda (options:godot_gdnative_init_options*)
(printf "XTL godot_gdnative_init\n")
(printf "GDNATIVE_EXT_NATIVESCRIPT = %d\n" GDNATIVE_EXT_NATIVESCRIPT)
(let ((api (tref options 7))
(extensions:godot_gdnative_api_struct** (tref api 4))
(num (tref api 3))
(i 0:i32))
(set! gdnative_api api)
(printf "The gdnative_api is set to [%p]\n" gdnative_api)
(dotimes (i num)
(if (= (tref (pref extensions i) 0) GDNATIVE_EXT_NATIVESCRIPT)
(set! nativescript_api (cast (pref extensions i) godot_gdnative_ext_nativescript_api_struct*))))
(printf "The nativescript api is set to [%p]\n" nativescript_api)
;; this is the xtlang init (not a godot init just to be confusing)
;; it's name 'godot_test1'_init is based off the xtm file name
;; load this after nativescript_api and gdnative_api are bound
(godot_test1_init)
void)))