Graphics

`sig exception Graphic_failure of string val open_graph : string -> unit val close_graph : unit -> unit val set_window_title : string -> unit val resize_window : int -> int -> unit external clear_graph : unit -> unit = "caml_gr_clear_graph" external size_x : unit -> int = "caml_gr_size_x" external size_y : unit -> int = "caml_gr_size_y" type color = int val rgb : int -> int -> int -> Graphics.color external set_color : Graphics.color -> unit = "caml_gr_set_color" val background : Graphics.color val foreground : Graphics.color val black : Graphics.color val white : Graphics.color val red : Graphics.color val green : Graphics.color val blue : Graphics.color val yellow : Graphics.color val cyan : Graphics.color val magenta : Graphics.color external plot : int -> int -> unit = "caml_gr_plot" val plots : (int * int) array -> unit external point_color : int -> int -> Graphics.color = "caml_gr_point_color" external moveto : int -> int -> unit = "caml_gr_moveto" val rmoveto : int -> int -> unit external current_x : unit -> int = "caml_gr_current_x" external current_y : unit -> int = "caml_gr_current_y" val current_point : unit -> int * int external lineto : int -> int -> unit = "caml_gr_lineto" val rlineto : int -> int -> unit val curveto : int * int -> int * int -> int * int -> unit val draw_rect : int -> int -> int -> int -> unit val draw_poly_line : (int * int) array -> unit val draw_poly : (int * int) array -> unit val draw_segments : (int * int * int * int) array -> unit val draw_arc : int -> int -> int -> int -> int -> int -> unit val draw_ellipse : int -> int -> int -> int -> unit val draw_circle : int -> int -> int -> unit val set_line_width : int -> unit external draw_char : char -> unit = "caml_gr_draw_char" external draw_string : string -> unit = "caml_gr_draw_string" external set_font : string -> unit = "caml_gr_set_font" val set_text_size : int -> unit external text_size : string -> int * int = "caml_gr_text_size" val fill_rect : int -> int -> int -> int -> unit external fill_poly : (int * int) array -> unit = "caml_gr_fill_poly" val fill_arc : int -> int -> int -> int -> int -> int -> unit val fill_ellipse : int -> int -> int -> int -> unit val fill_circle : int -> int -> int -> unit type image val transp : Graphics.color external make_image : Graphics.color array array -> Graphics.image = "caml_gr_make_image" external dump_image : Graphics.image -> Graphics.color array array = "caml_gr_dump_image" external draw_image : Graphics.image -> int -> int -> unit = "caml_gr_draw_image" val get_image : int -> int -> int -> int -> Graphics.image external create_image : int -> int -> Graphics.image = "caml_gr_create_image" external blit_image : Graphics.image -> int -> int -> unit = "caml_gr_blit_image" type status = { mouse_x : int; mouse_y : int; button : bool; keypressed : bool; key : char; } type event = Button_down | Button_up | Key_pressed | Mouse_motion | Poll external wait_next_event : Graphics.event list -> Graphics.status = "caml_gr_wait_event" val loop_at_exit : Graphics.event list -> (Graphics.status -> unit) -> unit val mouse_pos : unit -> int * int val button_down : unit -> bool val read_key : unit -> char val key_pressed : unit -> bool external sound : int -> int -> unit = "caml_gr_sound" val auto_synchronize : bool -> unit external synchronize : unit -> unit = "caml_gr_synchronize" external display_mode : bool -> unit = "caml_gr_display_mode" external remember_mode : bool -> unit = "caml_gr_remember_mode" end`