Module Graph.Graph

module Graph: sig .. end

An implementation of Renderer using the OCaml Graphics library as a backend. This renderer is lacking some p5ml features and mainly exists in case GTK+ or cairo2 are not available.


type buffer = {
   mouse_pressed : bool Stdlib.ref;
   mouse_coords_prev : Renderer.mouse_coords Stdlib.ref;
   window_dim_prev : (int * int) Stdlib.ref;
   pen_down : Math.vector option Stdlib.ref;
}
val create_buffer : 'a -> [< `FullScreen | `Size of int * int ] -> buffer
val begin_draw : buffer -> unit
val end_draw : 'a -> unit
val clear : 'a -> unit
val width : 'a -> int
val height : 'a -> int
val transform_coords : 'a * int -> 'a * int
val transform_coords_f : float * float -> int * int
val get_mouse_coords : unit -> Renderer.mouse_coords
val event_queue : buffer -> Renderer.event list
val transform_color : Color.color -> Graphics.color
val stroke_action : Paint.paint -> (unit -> unit) -> unit
val fill_action : Paint.paint -> (unit -> unit) -> unit
val uncurry : (int -> int -> 'a) -> float * float -> 'a
val handle_vertex : buffer -> Paint.paint -> Shape.vertex -> unit
val handle_shape : buffer -> Paint.paint -> Shape.t -> unit
val render : buffer -> Shape.t -> unit