register_class   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/contrib/libgodot.xtm

Implementation

;   void (void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func);
;; the api does not ask for references to structs
;; but NOT passing references fails (args d & e)
;; I think this is really a calling convention ABI issue
;; at least, for me, for now, passing refs works
;; so HERE BE DRAGONS
(bind-func register_class
  (lambda (a:i8* b:i8* c:i8* d:godot_instance_create_func* e:godot_instance_destroy_func*)
    (let ((fptr (cast (tref nativescript_api 3) [void,i8*,i8*,i8*,godot_instance_create_func*,godot_instance_destroy_func*]*)))
      ;; (println "XTL register_class" d e "fptr" (cast fptr i8*))
      (fptrcall fptr a b c d e)
      (println "Class registerd!")
      void)))


Back to Index

Similar Entries