open Graphics2D let highlight = Fill.radial (vec2 0.4 0.5) (vec2 0.6 0.7) (vec2 0.1 0.8) Fill.white Fill.clear let geo = [Contour.Closed, [curve_to (-0.8) 0. (-0.8) 0. (-1.) 1.; line_to 1. 1.; curve_to 0.8 0. 0.8 0. 1. (-1.); line_to (-1.) (-1.)]] |> ContourGeometry.make let styles = [ Fill.flat Fill.red, Style.Interior `Odd; highlight, Style.Interior `Odd; Fill.Flat Fill.blue, Style.stroke ~joins:`Round 0.2 ] let portal = {view = Some(vec2 (-1.6) (-1.6), vec2 1.6 1.6); scene = Group [||]} let paint() = portal.scene <- Transform(rot(time()), Shape(styles, geo)) let () = let on_paint = Event.create() in Event.add paint on_paint; GUI.spawn ~on_paint portal