ludus/postlude.ld

26 lines
673 B
Plaintext
Raw Permalink Normal View History

2024-06-06 03:23:47 +00:00
& this file runs after any given interpretation
& even if the original interpretation panics
& the goal is to output any global state held in Ludus
& this does not have base loaded into it, only prelude: must be pure Ludus
if turtle_state () :visible? then render_turtle! () else nil
reset_turtle! ()
2024-06-06 20:14:04 +00:00
& let console_msgs = flush! ()
2024-06-06 03:23:47 +00:00
let (r, g, b, a) = unbox (bgcolor)
2024-06-06 20:14:04 +00:00
store! (bgcolor, colors :black)
2024-06-06 03:23:47 +00:00
let draw_calls = unbox (p5_calls)
store! (p5_calls, [])
#{
& :result result is provided elsewhere
& :errors [] & if we get here there are no errors
2024-06-06 20:14:04 +00:00
& :console console_msgs
2024-06-06 03:23:47 +00:00
:draw concat (
[(:background, r, g, b, a), (:stroke, 255, 255, 255, 255)]
draw_calls)
}