;;;; The raylib package's five begin/end macros, expanded. ;;;; ;;;; They cannot be *run* here. Every one of them brackets calls that need a ;;;; window and a GL context, so a headless case can only assert what the ;;;; expansion is, not what it draws — which is the whole of what a macro ;;;; over a pair can get wrong. The four examples/ uses of with-drawing and ;;;; friends already prove they compile; what this adds is with-scissor-mode, ;;;; which no example can use (examples/core-scissor-test.flan turns its ;;;; scissor on and off from a flag, so its Begin and its End sit inside two ;;;; separate `when`s and there is no body to wrap). The arity refusals are ;;;; rl-with-reject.flan, beside this. ;;;; ;;;; [frame] is deliberately not reached from [main]. lib/reach.ml answers the ;;;; link from the checked program, so an unreachable frame means this case ;;;; needs no libraylib to run and goes in the suite unconditionally — while ;;;; [check] still walks every line of it, which is where a wrong expansion ;;;; would show. (import rl "vendor:raylib") (defn frame [cam rl/Camera2D cam3 rl/Camera3D target rl/RenderTexture2D] () (rl/with-drawing (rl/clear-background rl/raywhite) (rl/with-mode-2d cam (rl/draw-rectangle 0 0 10 10 rl/red)) (rl/with-mode-3d cam3 (rl/draw-fps 0 0)) (rl/with-scissor-mode 10 10 100 100 (rl/draw-rectangle 0 0 320 240 rl/blue) (rl/draw-text "clipped" 20 20 10 rl/black)) (rl/draw-fps 10 10)) ;; Off-screen, outside the frame, which is where a render texture belongs. (rl/with-texture-mode target (rl/clear-background rl/blank))) (defn main [] i32 (println "expanded") 0)