package ocamlsdl

  1. Overview
  2. Docs
exception Video_exn of string
type rect = {
  1. mutable r_x : int;
  2. mutable r_y : int;
  3. mutable r_w : int;
  4. mutable r_h : int;
}
val rect : x:int -> y:int -> w:int -> h:int -> rect
val copy_rect : rect -> rect
type pixel_format_info = {
  1. palette : bool;
  2. bits_pp : int;
  3. bytes_pp : int;
  4. rmask : int32;
  5. gmask : int32;
  6. bmask : int32;
  7. amask : int32;
  8. rshift : int;
  9. gshift : int;
  10. bshift : int;
  11. ashift : int;
  12. rloss : int;
  13. gloss : int;
  14. bloss : int;
  15. aloss : int;
  16. colorkey : int32;
  17. alpha : int;
}
type video_info = {
  1. hw_available : bool;
  2. wm_available : bool;
  3. blit_hw : bool;
  4. blit_hw_color_key : bool;
  5. blit_hw_alpha : bool;
  6. blit_sw : bool;
  7. blit_sw_color_key : bool;
  8. blit_sw_alpha : bool;
  9. blit_fill : bool;
  10. video_mem : int;
}
val get_video_info : unit -> video_info
val get_video_info_format : unit -> pixel_format_info
val driver_name : unit -> string
type video_flag = [
  1. | `ANYFORMAT
  2. | `ASYNCBLIT
  3. | `DOUBLEBUF
  4. | `FULLSCREEN
  5. | `HWPALETTE
  6. | `HWSURFACE
  7. | `NOFRAME
  8. | `OPENGL
  9. | `OPENGLBLIT
  10. | `RESIZABLE
  11. | `SWSURFACE
]
type modes =
  1. | NOMODE
  2. | ANY
  3. | DIM of (int * int) list
val list_modes : ?bpp:int -> video_flag list -> modes
val video_mode_ok : w:int -> h:int -> bpp:int -> video_flag list -> int
type surface
type surface_flags = [
  1. | `ANYFORMAT
  2. | `ASYNCBLIT
  3. | `DOUBLEBUF
  4. | `FULLSCREEN
  5. | `HWACCEL
  6. | `HWPALETTE
  7. | `HWSURFACE
  8. | `NOFRAME
  9. | `OPENGL
  10. | `OPENGLBLIT
  11. | `PREALLOC
  12. | `RESIZABLE
  13. | `RLEACCEL
  14. | `SRCALPHA
  15. | `SRCCOLORKEY
  16. | `SWSURFACE
]
type surface_info = {
  1. flags : surface_flags list;
  2. w : int;
  3. h : int;
  4. pitch : int;
  5. clip_rect : rect;
  6. refcount : int;
}
val surface_info : surface -> surface_info
val surface_format : surface -> pixel_format_info
val surface_dims : surface -> int * int * int
val surface_flags : surface -> surface_flags list
val surface_bpp : surface -> int
val get_video_surface : unit -> surface
val set_video_mode : w:int -> h:int -> ?bpp:int -> video_flag list -> surface
val update_rect : ?rect:rect -> surface -> unit
val update_rects : rect list -> surface -> unit
val flip : surface -> unit
val set_gamma : r:float -> g:float -> b:float -> unit
type color = int * int * int
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 use_palette : surface -> bool
val palette_ncolors : surface -> int
val get_palette_color : surface -> int -> color
type palette_flag =
  1. | LOGPAL
  2. | PHYSPAL
  3. | LOGPHYSPAL
val set_palette : surface -> ?flag:palette_flag -> ?firstcolor:int -> color array -> unit
val map_RGB : surface -> ?alpha:int -> color -> int32
val get_RGB : surface -> int32 -> color
val get_RGBA : surface -> int32 -> color * int
val create_RGB_surface : [ `ASYNCBLIT | `HWSURFACE | `SRCALPHA | `SRCCOLORKEY | `SWSURFACE ] list -> w:int -> h:int -> bpp:int -> rmask:int32 -> gmask:int32 -> bmask:int32 -> amask:int32 -> surface
val create_RGB_surface_format : surface -> [ `ASYNCBLIT | `HWSURFACE | `SRCALPHA | `SRCCOLORKEY | `SWSURFACE ] list -> w:int -> h:int -> surface
val create_RGB_surface_from_32 : (int32, Bigarray.int32_elt, Bigarray.c_layout) Bigarray.Array1.t -> w:int -> h:int -> pitch:int -> rmask:int32 -> gmask:int32 -> bmask:int32 -> amask:int32 -> surface
val create_RGB_surface_from_24 : (int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t -> w:int -> h:int -> pitch:int -> rmask:int -> gmask:int -> bmask:int -> amask:int -> surface
val create_RGB_surface_from_16 : (int, Bigarray.int16_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t -> w:int -> h:int -> pitch:int -> rmask:int -> gmask:int -> bmask:int -> amask:int -> surface
val create_RGB_surface_from_8 : (int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t -> w:int -> h:int -> pitch:int -> rmask:int -> gmask:int -> bmask:int -> amask:int -> surface
val must_lock : surface -> bool
val lock : surface -> unit
val unlock : surface -> unit
val get_pixel : surface -> x:int -> y:int -> int32
val get_pixel_color : surface -> x:int -> y:int -> color
val put_pixel : surface -> x:int -> y:int -> int32 -> unit
val put_pixel_color : surface -> x:int -> y:int -> color -> unit
val load_BMP : string -> surface
val load_BMP_from_mem : string -> surface
val save_BMP : surface -> string -> unit
val unset_color_key : surface -> unit
val set_color_key : surface -> ?rle:bool -> int32 -> unit
val get_color_key : surface -> int32
val unset_alpha : surface -> unit
val set_alpha : surface -> ?rle:bool -> int -> unit
val get_alpha : surface -> int
val unset_clip_rect : surface -> unit
val set_clip_rect : surface -> rect -> unit
val get_clip_rect : surface -> rect
val blit_surface : src:surface -> ?src_rect:rect -> dst:surface -> ?dst_rect:rect -> unit -> unit
val fill_rect : ?rect:rect -> surface -> int32 -> unit
val display_format : ?alpha:bool -> surface -> surface
OCaml

Innovation. Community. Security.