IO.Foreign
in arcade v0.1.0
v0.1.0 is the oldest version of arcade that was analysed, so there is nothing to compare it against. IO.Foreign is a first sighting, not a change.
lib/arcade/web/audio.march:13View on github ↗
10 -- Until then a command is dropped, as a cue would only play late, but the
11 -- rumble and drum levels are tracked, and restored the moment the synth
12 -- comes up. If the browser has no audio the game plays silent.
13 needs IO.Foreign
14
15 -- What the game decides about its speakers: the AudioContext's sample rate
16 -- (the synth's own, Arcade.Synth.rate()), the output gain, the URL of its
lib/arcade/web/canvas2d.march:5View on github ↗
2
3 -- The Canvas 2D calls that Js.Canvas lacks, backed by arcade_canvas2d.mjs
4 -- (march copies it beside the build). Each is one platform call.
5 needs IO.Foreign
6
7 extern "./arcade_canvas2d.mjs" : Cap(IO.Foreign) do
8 fn canvas2d_set_transform(ctx : Js.Canvas.Context, a : Float, b : Float, c : Float, d : Float, e : Float, f : Float) : Unit
lib/arcade/web/cell.march:7View on github ↗
4 -- shell keeps between events (its model and browser handles), so that event
5 -- callbacks and the frame loop act on the same value. One cell per JS realm;
6 -- a shell puts before it gets, and keeps one type in it.
7 needs IO.Foreign
8
9 extern "./arcade_cell.mjs" : Cap(IO.Foreign) do
10 fn cell_put(s : a) : Unit
lib/arcade/web/glue.march:10View on github ↗
7 -- fields, and one JSON POST. Each is one platform call; none decides
8 -- anything about the game. Pointers and the tap queue are Arcade.Web.Input,
9 -- the shell's state cell is Arcade.Web.Cell.
10 needs IO.Foreign
11
12 extern "./arcade_glue.mjs" : Cap(IO.Foreign) do
13 fn glue_now() : Float
lib/arcade/web/input.march:7View on github ↗
4 -- beside the build): one pointer followed on a canvas, drag handles and
5 -- text fields in a DOM overlay, and a queue of taps (codes queued by DOM
6 -- buttons or Enter in a field, drained once a frame). Platform calls only.
7 needs IO.Foreign
8
9 extern "./arcade_input.mjs" : Cap(IO.Foreign) do
10 fn input_on_pointer(canvas : Js.Dom.Node, down : List((Float, Float, Float)) -> (), move : List((Float, Float, Float)) -> (), up : List((Float, Float, Float)) -> (), cancel : () -> ()) : Unit
lib/arcade/web/runtime.march:18View on github ↗
15 -- Effects go to the game's `perform` in the order its update returned them.
16 -- Times are on one clock, performance.now() / 1000 (rAF's time and every
17 -- event's timeStamp); positions are CSS pixels.
18 needs IO.Foreign
19
20 -- A game's side of the shell. model is its model, msg its messages, fx its
21 -- effects. Give a record model a one-constructor box: the JS backend names
lib/arcade/web/synth_host.march:7View on github ↗
4 -- the audio worklet's, or the main thread's when the fallback plays. `serve`
5 -- is the whole audio callback, one Arcade.SynthFeed.block with the game's
6 -- cue table; the glue only copies its samples out.
7 needs IO.Foreign
8
9 extern "./arcade_synth_cell.mjs" : Cap(IO.Foreign) do
10 fn synth_cell_get() : Synth
lib/arcade/web/synth_worklet.march:7View on github ↗
4 -- arcade_worklet.mjs. The game's worklet entry calls `register` once, in the
5 -- AudioWorkletGlobalScope, with the processor name its main build asks
6 -- Arcade.Web.Audio for, the synth's rate, and SynthHost's reset and serve.
7 needs IO.Foreign
8
9 extern "./arcade_worklet.mjs" : Cap(IO.Foreign) do
10 fn worklet_register(processor : String, rate : Float, reset : () -> (), serve : List(AudioCmd(cue)) -> List(Float)) : Unit