+;; We use a hash table to store foreign irrlicht methods related with their
+;; classes
+;; This is needed because we need to "simulate" C++ inheritance
+(define remote-proc-table (make-hash-table))
+
+(define (get-irrlicht-proc proc-name . objects)
+ (let* ((name (if (null? objects)
+ proc-name
+ (let ((classes (map irr-class objects)))
+ (string-join (cons (car classes) (cons proc-name (cdr classes))) "_"))))
+ (proc (hash-ref remote-proc-table name)))
+ (cond ((not proc)
+ (load-extension "libguile-irrlicht" "init_guile_irrlicht")
+ (let ((new-proc (eval-string name)))
+ (hash-set! remote-proc-table name new-proc)
+ new-proc))
+ (else
+ proc))))
+
+(define (null-object? object)
+ (eq? (irr-pointer object) %null-pointer))