sig
exception Video_exn of string
type rect = {
mutable r_x : int;
mutable r_y : int;
mutable r_w : int;
mutable r_h : int;
}
val rect : x:int -> y:int -> w:int -> h:int -> Sdlvideo.rect
val copy_rect : Sdlvideo.rect -> Sdlvideo.rect
type pixel_format_info = {
palette : bool;
bits_pp : int;
bytes_pp : int;
rmask : int32;
gmask : int32;
bmask : int32;
amask : int32;
rshift : int;
gshift : int;
bshift : int;
ashift : int;
rloss : int;
gloss : int;
bloss : int;
aloss : int;
colorkey : int32;
alpha : int;
}
type video_info = {
hw_available : bool;
wm_available : bool;
blit_hw : bool;
blit_hw_color_key : bool;
blit_hw_alpha : bool;
blit_sw : bool;
blit_sw_color_key : bool;
blit_sw_alpha : bool;
blit_fill : bool;
video_mem : int;
}
external get_video_info : unit -> Sdlvideo.video_info
= "ml_SDL_GetVideoInfo"
external get_video_info_format : unit -> Sdlvideo.pixel_format_info
= "ml_SDL_GetVideoInfo_format"
external driver_name : unit -> string = "ml_SDL_VideoDriverName"
type video_flag =
[ `ANYFORMAT
| `ASYNCBLIT
| `DOUBLEBUF
| `FULLSCREEN
| `HWPALETTE
| `HWSURFACE
| `NOFRAME
| `OPENGL
| `OPENGLBLIT
| `RESIZABLE
| `SWSURFACE ]
type modes = NOMODE | ANY | DIM of (int * int) list
external list_modes :
?bpp:int -> Sdlvideo.video_flag list -> Sdlvideo.modes
= "ml_SDL_ListModes"
external video_mode_ok :
w:int -> h:int -> bpp:int -> Sdlvideo.video_flag list -> int
= "ml_SDL_VideoModeOK"
type surface
type surface_flags =
[ `ANYFORMAT
| `ASYNCBLIT
| `DOUBLEBUF
| `FULLSCREEN
| `HWACCEL
| `HWPALETTE
| `HWSURFACE
| `NOFRAME
| `OPENGL
| `OPENGLBLIT
| `PREALLOC
| `RESIZABLE
| `RLEACCEL
| `SRCALPHA
| `SRCCOLORKEY
| `SWSURFACE ]
type surface_info = {
flags : Sdlvideo.surface_flags list;
w : int;
h : int;
pitch : int;
clip_rect : Sdlvideo.rect;
refcount : int;
}
external surface_info : Sdlvideo.surface -> Sdlvideo.surface_info
= "ml_sdl_surface_info"
external surface_format : Sdlvideo.surface -> Sdlvideo.pixel_format_info
= "ml_sdl_surface_info_format"
val surface_dims : Sdlvideo.surface -> int * int * int
val surface_flags : Sdlvideo.surface -> Sdlvideo.surface_flags list
val surface_bpp : Sdlvideo.surface -> int
external get_video_surface : unit -> Sdlvideo.surface
= "ml_SDL_GetVideoSurface"
external set_video_mode :
w:int ->
h:int -> ?bpp:int -> Sdlvideo.video_flag list -> Sdlvideo.surface
= "ml_SDL_SetVideoMode"
external update_rect : ?rect:Sdlvideo.rect -> Sdlvideo.surface -> unit
= "ml_SDL_UpdateRect"
external update_rects : Sdlvideo.rect list -> Sdlvideo.surface -> unit
= "ml_SDL_UpdateRects"
external flip : Sdlvideo.surface -> unit = "ml_SDL_Flip"
external set_gamma : r:float -> g:float -> b:float -> unit
= "ml_SDL_SetGamma"
type color = int * int * int
val black : Sdlvideo.color
val white : Sdlvideo.color
val red : Sdlvideo.color
val green : Sdlvideo.color
val blue : Sdlvideo.color
val yellow : Sdlvideo.color
val cyan : Sdlvideo.color
val magenta : Sdlvideo.color
external use_palette : Sdlvideo.surface -> bool
= "ml_sdl_surface_use_palette"
external palette_ncolors : Sdlvideo.surface -> int
= "ml_sdl_palette_ncolors"
external get_palette_color : Sdlvideo.surface -> int -> Sdlvideo.color
= "ml_sdl_palette_get_color"
type palette_flag = LOGPAL | PHYSPAL | LOGPHYSPAL
external set_palette :
Sdlvideo.surface ->
?flag:Sdlvideo.palette_flag ->
?firstcolor:int -> Sdlvideo.color array -> unit = "ml_SDL_SetPalette"
external map_RGB :
Sdlvideo.surface -> ?alpha:int -> Sdlvideo.color -> int32
= "ml_SDL_MapRGB"
external get_RGB : Sdlvideo.surface -> int32 -> Sdlvideo.color
= "ml_SDL_GetRGB"
external get_RGBA : Sdlvideo.surface -> int32 -> Sdlvideo.color * int
= "ml_SDL_GetRGBA"
external create_RGB_surface :
[ `ASYNCBLIT | `HWSURFACE | `SRCALPHA | `SRCCOLORKEY | `SWSURFACE ] list ->
w:int ->
h:int ->
bpp:int ->
rmask:int32 ->
gmask:int32 -> bmask:int32 -> amask:int32 -> Sdlvideo.surface
= "ml_SDL_CreateRGBSurface_bc" "ml_SDL_CreateRGBSurface"
external create_RGB_surface_format :
Sdlvideo.surface ->
[ `ASYNCBLIT | `HWSURFACE | `SRCALPHA | `SRCCOLORKEY | `SWSURFACE ] list ->
w:int -> h:int -> Sdlvideo.surface = "ml_SDL_CreateRGBSurface_format"
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 -> Sdlvideo.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 -> Sdlvideo.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 -> Sdlvideo.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 -> Sdlvideo.surface
external must_lock : Sdlvideo.surface -> bool = "ml_SDL_MustLock" "noalloc"
external lock : Sdlvideo.surface -> unit = "ml_SDL_LockSurface"
external unlock : Sdlvideo.surface -> unit = "ml_SDL_UnlockSurface"
"noalloc"
val pixel_data :
Sdlvideo.surface ->
(int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
val pixel_data_8 :
Sdlvideo.surface ->
(int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
val pixel_data_16 :
Sdlvideo.surface ->
(int, Bigarray.int16_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
val pixel_data_24 :
Sdlvideo.surface ->
(int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
val pixel_data_32 :
Sdlvideo.surface ->
(int32, Bigarray.int32_elt, Bigarray.c_layout) Bigarray.Array1.t
external get_pixel : Sdlvideo.surface -> x:int -> y:int -> int32
= "ml_SDL_get_pixel"
external get_pixel_color :
Sdlvideo.surface -> x:int -> y:int -> Sdlvideo.color
= "ml_SDL_get_pixel_color"
external put_pixel : Sdlvideo.surface -> x:int -> y:int -> int32 -> unit
= "ml_SDL_put_pixel"
external put_pixel_color :
Sdlvideo.surface -> x:int -> y:int -> Sdlvideo.color -> unit
= "ml_SDL_put_pixel_color"
external load_BMP : string -> Sdlvideo.surface = "ml_SDL_LoadBMP"
val load_BMP_from_mem : string -> Sdlvideo.surface
external save_BMP : Sdlvideo.surface -> string -> unit = "ml_SDL_SaveBMP"
external unset_color_key : Sdlvideo.surface -> unit
= "ml_SDL_unset_color_key"
external set_color_key : Sdlvideo.surface -> ?rle:bool -> int32 -> unit
= "ml_SDL_SetColorKey"
external get_color_key : Sdlvideo.surface -> int32 = "ml_SDL_get_color_key"
external unset_alpha : Sdlvideo.surface -> unit = "ml_SDL_unset_alpha"
external set_alpha : Sdlvideo.surface -> ?rle:bool -> int -> unit
= "ml_SDL_SetAlpha"
external get_alpha : Sdlvideo.surface -> int = "ml_SDL_get_alpha"
external unset_clip_rect : Sdlvideo.surface -> unit
= "ml_SDL_UnsetClipRect"
external set_clip_rect : Sdlvideo.surface -> Sdlvideo.rect -> unit
= "ml_SDL_SetClipRect"
external get_clip_rect : Sdlvideo.surface -> Sdlvideo.rect
= "ml_SDL_GetClipRect"
external blit_surface :
src:Sdlvideo.surface ->
?src_rect:Sdlvideo.rect ->
dst:Sdlvideo.surface -> ?dst_rect:Sdlvideo.rect -> unit -> unit
= "ml_SDL_BlitSurface"
external fill_rect :
?rect:Sdlvideo.rect -> Sdlvideo.surface -> int32 -> unit
= "ml_SDL_FillRect"
external display_format :
?alpha:bool -> Sdlvideo.surface -> Sdlvideo.surface
= "ml_SDL_DisplayFormat"
end