(bind-func xtm_light_view
(let ((lights:xtm_lights* null))
(lambda (light:i32 view:float*)
(set! lights (xtm_get_lights))
(set! light (- light 1))
(if (or (< light 0) (> light 9))
(begin (printf "No such light!\n") void)
(begin (fill_view_matrix (pref-ptr (tref lights 8) (* light 16))
(pref-ptr (tref lights 0) (* light 4)) ;; position
(pref-ptr (tref lights 1) (* light 4)) ;; target
(pref-ptr (tref lights 2) (* light 4))) ;; up
(if (not (null? view))
(mcopy (pref-ptr (tref lights 8) (* light 16)) 4 4 view))
void)))))