Image noise/OCaml/Alleg: Difference between revisions

no edit summary
m (libheader template)
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 2:
{{libheader|OCaml-Allegro}}
 
<syntaxhighlight lang="ocaml">
<lang ocaml>(* modified/adapted from the sample program exdbuf.c by Shawn Hargreaves,
from the Allegro library, which is provided under the giftware licence. *)
open Allegro
Line 58 ⟶ 59:
 
(* release the memory buffer *)
destroy_bitmap buffer</lang>
</syntaxhighlight>
 
Run that as a script with the command: <code>ocaml -I $(ocamlfind query allegro) allegro.cma noise_fps_alleg.ml</code>
ocaml -I +allegro allegro.cma noise_fps_alleg.ml
 
This is a work in progress version, it only prints the number of frames displayed, but we could still use the command time and make the calculus with the ocaml top-level.