• en

Module Graphics

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
val clear_graph : unit -> unit
val size_x : unit -> int
val size_y : unit -> int
type color = int
val rgb : int -> int -> int -> color
val set_color : color -> unit
val background : color
val foreground : color
val black : color
val white : color
val red : color
val green : color
val blue : color
val yellow : color
val cyan : color
val magenta : color
val plot : int -> int -> unit
val plots : (int * int) array -> unit
val point_color : int -> int -> color
val moveto : int -> int -> unit
val rmoveto : int -> int -> unit
val current_x : unit -> int
val current_y : unit -> int
val current_point : unit -> (int * int)
val lineto : int -> int -> unit
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
val draw_char : char -> unit
val draw_string : string -> unit
val set_font : string -> unit
val set_text_size : int -> unit
val text_size : string -> (int * int)
val fill_rect : int -> int -> int -> int -> unit
val fill_poly : (int * int) array -> unit
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 : color
val make_image : color array array -> image
val dump_image : image -> color array array
val draw_image : image -> int -> int -> unit
val get_image : int -> int -> int -> int -> image
val create_image : int -> int -> image
val blit_image : image -> int -> int -> unit
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
val wait_next_event : event list -> status
val loop_at_exit : event list -> status -> unit -> unit
val mouse_pos : unit -> (int * int)
val button_down : unit -> bool
val read_key : unit -> char
val key_pressed : unit -> bool
val sound : int -> int -> unit
val auto_synchronize : bool -> unit
val synchronize : unit -> unit
val display_mode : bool -> unit
val remember_mode : bool -> unit