;;;; Every binding called here came out of raylib's header, not out of ;;;; raylib.flan. The package binds none of these four by hand, so if this ;;;; program runs at all the importer produced working declarations — and ;;;; what it prints pins rather more than that. ;;;; ;;;; Needs FLAN_RAYLIB_H pointing at a raylib 5.5 header; the acceptance case ;;;; skips without it. (import rl "vendor:raylib") (defn main [] i32 ;; A scalar in, a scalar out. Seeded, and a range of one, so the answer is ;; the bound rather than anything random. (rl/set-random-seed 12345) (println (rl/get-random-value 10 10)) ;; A string parameter. A Flan string is ptr+len and never NUL-terminated, so ;; this only answers 5 if the generated wrapper made the terminated copy. (println (rl/text-length "hello")) ;; A struct by value in, a scalar out. 0x11223344 is 287454020, and it is ;; the four fields read in r,g,b,a order — swap any two and the number ;; changes, which a round trip could not have told us. (println (rl/color-to-int (rl/Color {.r 17 .g 34 .b 51 .a 68}))) ;; A struct in and a struct out, which is the whole flattening path: the ;; argument goes by pointer and the result comes back through an ;; out-parameter. Tinting by white is the identity, so the four bytes come ;; back separately and in order. (let [t (rl/color-tint (rl/Color {.r 255 .g 255 .b 255 .a 255}) (rl/Color {.r 17 .g 34 .b 51 .a 68}))] (println (.r t)) (println (.g t)) (println (.b t)) (println (.a t))) 0)