Module Tsdl.Sdl
SDL bindings.
Integer types, bigarrays and results
type uint8= inttype int16= inttype uint16= inttype uint32= int32type uint64= int64type ('a, 'b) bigarray= ('a, 'b, Bigarray.c_layout) Bigarray.Array1.tThe type for bigarrays.
type 'a result= ('a, [ `Msg of string ]) Result.resultThe type for function results. In the error case, the string is what
Sdl.get_errorreturned.
Basics
Initialization and shutdown
module Init : sig ... endSubsystem flags.
val quit_sub_system : Init.t -> unit
Hints
module Hint : sig ... endval get_hint : Hint.t -> string option
val get_hint_boolean : Hint.t -> bool -> boolSDL_GetHintBoolean ( 2.05.0 )
val set_hint : Hint.t -> string -> bool
val set_hint_with_priority : Hint.t -> string -> Hint.priority -> bool
Errors
val set_error : ('b, Stdlib.Format.formatter, unit) Stdlib.format -> 'b
Log
module Log : sig ... endval log : ('b, Stdlib.Format.formatter, unit) Stdlib.format -> 'b
val log_critical : Log.category -> ('b, Stdlib.Format.formatter, unit) Stdlib.format -> 'b
val log_debug : Log.category -> ('b, Stdlib.Format.formatter, unit) Stdlib.format -> 'b
val log_error : Log.category -> ('b, Stdlib.Format.formatter, unit) Stdlib.format -> 'b
val log_get_priority : Log.category -> Log.priority
val log_info : Log.category -> ('b, Stdlib.Format.formatter, unit) Stdlib.format -> 'b
val log_message : Log.category -> Log.priority -> ('b, Stdlib.Format.formatter, unit) Stdlib.format -> 'b
val log_set_all_priority : Log.priority -> unit
val log_set_priority : Log.category -> Log.priority -> unit
val log_verbose : Log.category -> ('b, Stdlib.Format.formatter, unit) Stdlib.format -> 'b
val log_warn : Log.category -> ('b, Stdlib.Format.formatter, unit) Stdlib.format -> 'b
Version
Files and IO abstraction
IO abstraction
val load_file : string -> string result( 2.06.0 )
Filesystem Paths
val get_base_path : unit -> string result
val get_pref_path : org:string -> app:string -> string result
Video
Colors
module Color : sig ... endPoints
module Point : sig ... endRectangles
module Rect : sig ... endval enclose_points : ?clip:rect -> point list -> rect optionSDL_EnclosePoints. Returns
Noneif all the points were outside the clipping rectangle (if provided).
val enclose_points_ba : ?clip:rect -> (int32, Bigarray.int32_elt) bigarray -> rect optionSee
enclose_points. Each consecutive pair in the array defines a point.- raises Invalid_argument
if the length of the array is not a multiple of 2.
val intersect_rect_and_line : rect -> int -> int -> int -> int -> ((int * int) * (int * int)) optionSDL_IntersectRectAndLine. Returns the clipped segment if it intersects.
val point_in_rect : point -> rect -> boolSDL_PointInRect ( 2.04.0 )
val rect_empty : rect -> bool
Palettes
val free_palette : palette -> unit
val get_palette_ncolors : palette -> intget_palette_ncolors pis the fieldncolorsofp.
val get_palette_colors : palette -> color listget_palette_colors pis a copy of the contents of the fieldcolorsofs.
val get_palette_colors_ba : palette -> (int, Bigarray.int8_unsigned_elt) bigarrayget_palette_colors_ba pis a copy of the contents of the fieldcolorsofp.
val set_palette_colors_ba : palette -> (int, Bigarray.int8_unsigned_elt) bigarray -> fst:int -> unit resultSee
set_palette_colors. Each consecutive quadruplet defines a color. The data is copied.- raises Invalid_argument
if the length of the array is not a multiple of 4.
Pixels formats
type gamma_ramp= (int, Bigarray.int16_unsigned_elt) bigarrayThe type for gamma ramps, 256
uint16values.
val calculate_gamma_ramp : float -> gamma_ramp
module Blend : sig ... endval compose_custom_blend_mode : Blend.factor -> Blend.factor -> Blend.operation -> Blend.factor -> Blend.factor -> Blend.operation -> Blend.modeSDL_ComposeCustomBlendMode ( 2.06.0 )
module Pixel : sig ... endval alloc_format : Pixel.format_enum -> pixel_format result
val free_format : pixel_format -> unit
val get_pixel_format_name : Pixel.format_enum -> string
val get_pixel_format_format : pixel_format -> Pixel.format_enumget_pixel_format_format pfis the fieldformatofpf.
val get_pixel_format_bits_pp : pixel_format -> intget_pixel_format_bits_pp pfis the fieldBitsPerPixelofpf.
val get_pixel_format_bytes_pp : pixel_format -> intget_pixel_format_bytes_pp pfis the fieldBytesPerPixelofpf.
val get_rgb : pixel_format -> uint32 -> uint8 * uint8 * uint8
val map_rgb : pixel_format -> uint8 -> uint8 -> uint8 -> uint32
val masks_to_pixel_format_enum : int -> uint32 -> uint32 -> uint32 -> uint32 -> Pixel.format_enum
val pixel_format_enum_to_masks : Pixel.format_enum -> (int * uint32 * uint32 * uint32 * uint32) result
val set_pixel_format_palette : pixel_format -> palette -> unit resultNote If you allocated the palette with
alloc_paletteyou canfree_paletteafter.
Surface
val convert_pixels : w:int -> h:int -> src:Pixel.format_enum -> ('a, 'b) bigarray -> int -> dst:Pixel.format_enum -> ('c, 'd) bigarray -> int -> unit resultNote Pitches are given in bigarray elements not in bytes.
Warning. Unsafe, make sure your parameters don't result in invalid access to memory.
val convert_surface : surface -> pixel_format -> surface result
val convert_surface_format : surface -> Pixel.format_enum -> surface result
val create_rgb_surface : w:int -> h:int -> depth:int -> uint32 -> uint32 -> uint32 -> uint32 -> surface result
val create_rgb_surface_from : ('a, 'b) bigarray -> w:int -> h:int -> depth:int -> pitch:int -> uint32 -> uint32 -> uint32 -> uint32 -> surface resultNote The pitch is given in bigarray elements not in bytes.
Warning Unsafe, make sure your parameters don't result in invalid access to memory. The bigarray data is not copied, it must remain valid until
free_surfaceis called on the surface.
val create_rgb_surface_with_format : w:int -> h:int -> depth:int -> Pixel.format_enum -> surface resultSDL_CreateRGBSurfaceWithFormat ( 2.05.0 )
val create_rgb_surface_with_format_from : ('a, 'b) bigarray -> w:int -> h:int -> depth:int -> pitch:int -> Pixel.format_enum -> surface resultSDL_CreateRGBSurfaceWithFormatFrom ( 2.05.0 )
val fill_rects_ba : surface -> (int32, Bigarray.int32_elt) bigarray -> uint32 -> unit resultSee
fill_rects. Each consecutive quadruplet defines a rectangle.- raises Invalid_argument
if the length of the array is not a multiple of 4.
val free_surface : surface -> unit
val get_surface_blend_mode : surface -> Blend.mode result
val get_surface_format_enum : surface -> Pixel.format_enumget_surface_format_neum sis the pixel format enum of the fieldformatofs.
val get_surface_pitch : surface -> intget_surface_pitch sis the fieldpitchofs.
val get_surface_pixels : surface -> ('a, 'b) Bigarray.kind -> ('a, 'b) bigarrayget_surface_pixels s kindis the fieldpixelsofsviewed as akindbigarray. Note that you must lock the surface before accessing this.Warning. The bigarray memory becomes invalid once the surface is unlocked or freed.
- raises Invalid_argument
If
kindcan't align with the surface pitch.
val get_surface_size : surface -> int * intget_surface_size sis the fieldswandhofs.
val set_surface_blend_mode : surface -> Blend.mode -> unit result
val set_surface_palette : surface -> palette -> unit resultNote If you allocated the palette with
alloc_paletteyou canfree_paletteafter.
val unlock_surface : surface -> unit
Renderers
module Flip : sig ... endmodule Renderer : sig ... endtype renderer_info={ri_name : string;ri_flags : Renderer.flags;ri_texture_formats : Pixel.format_enum list;ri_max_texture_width : int;ri_max_texture_height : int;}
val create_renderer : ?index:int -> ?flags:Renderer.flags -> window -> renderer result
val destroy_renderer : renderer -> unit
val get_num_render_drivers : unit -> int result
val get_render_draw_blend_mode : renderer -> Blend.mode result
val get_render_driver_info : int -> renderer_info result
val get_renderer_info : renderer -> renderer_info result
val render_copy_ex : ?src:rect -> ?dst:rect -> renderer -> texture -> float -> point option -> flip -> unit result
val render_draw_lines_ba : renderer -> (int32, Bigarray.int32_elt) bigarray -> unit resultSee
render_draw_lines. Each consecutive pair in the array defines a point.- raises Invalid_argument
if the length of the array is not a multiple of 2.
val render_draw_points_ba : renderer -> (int32, Bigarray.int32_elt) bigarray -> unit resultSee
render_draw_points. Each consecutive pair in the array defines a point.- raises Invalid_argument
if the length of the array is not a multiple of 2.
val render_draw_rects_ba : renderer -> (int32, Bigarray.int32_elt) bigarray -> unit resultSee
render_draw_rects. Each consecutive quadruple in the array defines a rectangle.- raises Invalid_argument
if the length of the array is not a multiple of 4.
val render_fill_rects_ba : renderer -> (int32, Bigarray.int32_elt) bigarray -> unit resultSee
render_draw_rects. Each consecutive quadruple in the array defines a rectangle.- raises Invalid_argument
if the length of the array is not a multiple of 4.
val render_get_integer_scale : renderer -> boolSDL_RenderGetIntegerScale ( 2.05.0 )
val render_get_logical_size : renderer -> int * int
val render_get_scale : renderer -> float * float
val render_is_clip_enabled : renderer -> boolSDL_RenderIsClipEnabled ( 2.04.0 )
val render_present : renderer -> unit
val render_read_pixels : renderer -> rect option -> Pixel.format_enum option -> ('a, 'b) bigarray -> int -> unit result
val render_set_integer_scale : renderer -> bool -> unit resultSDL_RenderSetIntegerScale ( 2.05.0 )
val render_target_supported : renderer -> bool
val set_render_draw_blend_mode : renderer -> Blend.mode -> unit result
Textures
module Texture : sig ... endval create_texture : renderer -> Pixel.format_enum -> Texture.access -> w:int -> h:int -> texture result
val destroy_texture : texture -> unit
val get_texture_blend_mode : texture -> Blend.mode result
val lock_texture : texture -> rect option -> ('a, 'b) Bigarray.kind -> (('a, 'b) bigarray * int) resultNote. The returned pitch is in bigarray element, not in bytes.
- raises Invalid_argument
If
kindcan't align with the texture pitch.
val query_texture : texture -> (Pixel.format_enum * Texture.access * (int * int)) result
val set_texture_blend_mode : texture -> Blend.mode -> unit result
val unlock_texture : texture -> unit
val update_texture : texture -> rect option -> ('a, 'b) bigarray -> int -> unit resultNote The pitch is given in bigarray elements not in bytes.
val update_yuv_texture : texture -> rect option -> y:(int, Bigarray.int8_unsigned_elt) bigarray -> int -> u:(int, Bigarray.int8_unsigned_elt) bigarray -> int -> v:(int, Bigarray.int8_unsigned_elt) bigarray -> int -> unit result
Video drivers
val get_num_video_drivers : unit -> int result
val get_video_driver : int -> string result
val video_init : string option -> unit result
Displays
type display_mode={dm_format : Pixel.format_enum;dm_w : int;dm_h : int;dm_refresh_rate : int option;dm_driverdata : driverdata option;}
val get_closest_display_mode : int -> display_mode -> display_mode option
val get_current_display_mode : int -> display_mode result
val get_desktop_display_mode : int -> display_mode result
val get_display_dpi : int -> (float * float * float) resultSDL_GetDisplayDPI ( 2.04.0 )
val get_display_mode : int -> int -> display_mode result
val get_display_name : int -> string result
val get_display_usable_bounds : int -> rect resultSDL_GetDisplayUsableBouds ( 2.05.0 )
val get_num_display_modes : int -> int result
val get_num_video_displays : unit -> int result
Windows
module Window : sig ... endval create_window : string -> ?x:int -> ?y:int -> w:int -> h:int -> Window.flags -> window resultxandydefault toWindow.pos_undefined.
val create_window_and_renderer : w:int -> h:int -> Window.flags -> (window * renderer) result
val destroy_window : window -> unit
val get_window_borders_size : window -> (int * int * int * int) resultSDL_GetWindowBordersSize ( 2.05.0 )
val get_window_brightness : window -> float
val get_window_display_mode : window -> display_mode result
val get_window_flags : window -> Window.flags
val get_window_gamma_ramp : window -> (gamma_ramp * gamma_ramp * gamma_ramp) result
val get_window_grab : window -> bool
val get_grabbed_window : unit -> windowSDL_GetGrabbedWindow ( 2.04.0 )
val get_window_id : window -> int
val get_window_maximum_size : window -> int * int
val get_window_minimum_size : window -> int * int
val get_window_opacity : window -> float resultSDL_GetWindowOpacity ( 2.05.0 )
val get_window_pixel_format : window -> Pixel.format_enum
val get_window_position : window -> int * int
val get_window_size : window -> int * int
val get_window_surface : window -> surface resultNote. According to SDL's documentation the surface is freed when the window is destroyed.
val get_window_title : window -> string
val hide_window : window -> unit
val maximize_window : window -> unit
val minimize_window : window -> unit
val raise_window : window -> unit
val restore_window : window -> unit
val set_window_bordered : window -> bool -> unit
val set_window_display_mode : window -> display_mode -> unit result
val set_window_fullscreen : window -> Window.flags -> unit result
val set_window_gamma_ramp : window -> gamma_ramp -> gamma_ramp -> gamma_ramp -> unit result
val set_window_grab : window -> bool -> unit
val set_window_maximum_size : window -> w:int -> h:int -> unit
val set_window_minimum_size : window -> w:int -> h:int -> unit
val set_window_modal_for : modal:window -> parent:window -> unit resultSDL_SetWindowModalFor ( 2.05.0 )
val set_window_opacity : window -> float -> unit resultSDL_SetWindowOpacity ( 2.05.0 )
val set_window_position : window -> x:int -> y:int -> unit
val set_window_resizable : window -> bool -> unitSDL_SetWindowResizable ( 2.05.0 )
val set_window_size : window -> w:int -> h:int -> unit
val set_window_title : window -> string -> unit
val show_window : window -> unit
val update_window_surface_rects_ba : window -> (int32, Bigarray.int32_elt) bigarray -> unit resultSee
update_window_surface_rects. Each consecutive quadruplet defines a rectangle.- raises Invalid_argument
if the length of the array is not a multiple of 4.
OpenGL contexts
module Gl : sig ... endval gl_create_context : window -> gl_context result
val gl_delete_context : gl_context -> unit
val gl_get_current_context : unit -> gl_context result
val gl_get_drawable_size : window -> int * int
val gl_get_swap_interval : unit -> int result
val gl_make_current : window -> gl_context -> unit result
val gl_set_swap_interval : int -> unit result
val gl_swap_window : window -> unit
val gl_reset_attributes : unit -> unitSDL_GL_ResetAttributes (SDL 2.0.2).
val gl_unbind_texture : texture -> unit resultSDL_GL_UnbindTexture Warning Segfaults on SDL 2.0.1 see this report.
Vulkan
module Vulkan : sig ... endScreen saver
Message boxes
module Message_box : sig ... endval show_message_box : Message_box.data -> int result
val show_simple_message_box : Message_box.flags -> title:string -> string -> window option -> unit result
Clipboard
val get_clipboard_text : unit -> string result
val set_clipboard_text : string -> unit result
Input
val pressed : button_stateval released : button_state
val disable : toggle_stateval enable : toggle_state
Keyboard
val get_keyboard_focus : unit -> window option
val get_keyboard_state : unit -> (int, Bigarray.int8_unsigned_elt) bigarray
val get_key_from_name : string -> keycode
val get_key_name : keycode -> string
val get_mod_state : unit -> keymod
val get_scancode_from_name : string -> scancode
val get_scancode_name : scancode -> string
val is_screen_keyboard_shown : window -> bool
val set_mod_state : keymod -> unit
val set_text_input_rect : rect option -> unit
Mouse
module System_cursor : sig ... endmodule Button : sig ... endval capture_mouse : bool -> unit resultSDL_CaptureMouse ( 2.04.0 )
val create_cursor : (int, Bigarray.int8_unsigned_elt) bigarray -> (int, Bigarray.int8_unsigned_elt) bigarray -> w:int -> h:int -> hot_x:int -> hot_y:int -> cursor result
val create_system_cursor : System_cursor.t -> cursor result
val free_cursor : cursor -> unit
val get_cursor : unit -> cursor option
val get_default_cursor : unit -> cursor option
val get_global_mouse_state : unit -> uint32 * (int * int)SDL_GetGlobalMouseState ( 2.04.0 )
val get_mouse_focus : unit -> window option
val get_mouse_state : unit -> uint32 * (int * int)
val get_relative_mouse_state : unit -> uint32 * (int * int)
val get_cursor_shown : unit -> bool resultSDL_ShowCursor with SDL_QUERY.
val set_cursor : cursor option -> unit
val set_relative_mouse_mode : bool -> unit result
val show_cursor : bool -> bool resultSDL_ShowCursor. See also
get_cursor_shown.
val warp_mouse_global : x:int -> y:int -> unit resultSDL_WarpMouseGlobal ( 2.04.0 )
val warp_mouse_in_window : window option -> x:int -> y:int -> unit
Touch and gestures
val touch_mouse_id : touch_idSDL_TOUCH_MOUSEID
module Finger : sig ... endval get_num_touch_fingers : touch_id -> int
val save_dollar_template : gesture_id -> rw_ops -> unit result
Joystick
module Hat : sig ... endmodule Joystick_power_level : sig ... endmodule Joystick_type : sig ... endval joystick_close : joystick -> unit
val joystick_current_power_level : joystick -> Joystick_power_level.tSDL_JoystickCurrentPowerLevel ( 2.04.0 )
val joystick_from_instance_id : joystick_id -> joystickSDL_JoystickFromInstanceId ( 2.04.0 )
val joystick_get_device_instance_id : int -> joystick_id( 2.06.0 )
val joystick_get_device_product : int -> int16( 2.06.0 )
val joystick_get_device_product_version : int -> int16( 2.06.0 )
val joystick_get_device_type : int -> Joystick_type.t( 2.06.0 )
val joystick_get_device_vendor : int -> int16( 2.06.0 )
val joystick_get_event_state : unit -> toggle_state resultSDL_JoystickEventState with SDL_QUERY.
val joystick_set_event_state : toggle_state -> toggle_state resultSDL_JoystickEventState. See also
joystick_get_event_state.
val joystick_get_attached : joystick -> bool
val joystick_get_device_guid : int -> joystick_guid
val joystick_get_guid : joystick -> joystick_guid
val joystick_get_guid_from_string : string -> joystick_guid
val joystick_get_guid_string : joystick_guid -> string
val joystick_get_type : joystick -> Joystick_type.tSDL_JoystickGetType ( 2.06.0)
val joystick_instance_id : joystick -> joystick_id result
val joystick_name_for_index : int -> string result
val num_joysticks : unit -> int result
Game controller
module Controller : sig ... endval game_controller_add_mapping : string -> bool result
val game_controller_add_mapping_from_file : string -> int resultSDL_GameControllerAddMappingsFromFile (SDL 2.0.2).
val game_controller_add_mapping_from_rw : rw_ops -> bool -> int resultSDL_GameControllerAddMappingsFromFile (SDL 2.0.2).
val game_controller_close : game_controller -> unit
val game_controller_from_instance_id : joystick_id -> game_controllerSDL_GameControllerFromInstanceId ( 2.04.0 )
val game_controller_get_event_state : unit -> toggle_state resultSDL_GameControllerEventState with SDL_QUERY
val game_controller_set_event_state : toggle_state -> toggle_state resultSDL_GameControllerEventState. See also
game_controller_get_event_state.
val game_controller_get_attached : game_controller -> bool
val game_controller_get_axis : game_controller -> Controller.axis -> int16
val game_controller_get_axis_from_string : string -> Controller.axis
val game_controller_get_bind_for_axis : game_controller -> Controller.axis -> Controller.button_bind
val game_controller_get_bind_for_button : game_controller -> Controller.button -> Controller.button_bind
val game_controller_get_button : game_controller -> Controller.button -> uint8
val game_controller_get_button_from_string : string -> Controller.button
val game_controller_get_joystick : game_controller -> joystick result
val game_controller_get_product : game_controller -> uint16( 2.06.0 )
val game_controller_get_product_version : game_controller -> uint16( 2.06.0 )
val game_controller_get_string_for_axis : Controller.axis -> string option
val game_controller_get_string_for_button : Controller.button -> string option
val game_controller_get_vendor : game_controller -> uint16( 2.06.0 )
val game_controller_mapping : game_controller -> string result
val game_controller_mapping_for_index : int -> string result
val game_controller_mapping_for_guid : joystick_guid -> string result
val game_controller_name : game_controller -> string result
val game_controller_name_for_index : int -> string result
val game_controller_open : int -> game_controller result
Events
type event_type= intSDL_EventType. See
Eventfor constants.
module Event : sig ... endEvent accessors and
event_typeconstants and enumeration.
val get_event_state : event_type -> toggle_stateSDL_EventState with SDL_QUERY.
val set_event_state : event_type -> toggle_state -> unitSDL_EventState. See also
get_event_state.
val flush_event : event_type -> unit
val flush_events : event_type -> event_type -> unit
val has_event : event_type -> bool
val has_events : event_type -> event_type -> bool
val poll_event : event option -> bool
val register_event : unit -> event_type optionSDL_RegisterEvents called with
1.
val wait_event_timeout : event option -> int -> bool
Force Feedback
module Haptic : sig ... endval haptic_close : haptic -> unit
val haptic_destroy_effect : haptic -> haptic_effect_id -> unit
val haptic_effect_supported : haptic -> haptic_effect -> bool result
val haptic_get_effect_status : haptic -> haptic_effect_id -> bool result
val haptic_name : int -> string result
val haptic_new_effect : haptic -> haptic_effect -> haptic_effect_id result
val haptic_query : haptic -> int
val haptic_run_effect : haptic -> haptic_effect_id -> uint32 -> unit result
val haptic_stop_effect : haptic -> haptic_effect_id -> unit result
val haptic_update_effect : haptic -> haptic_effect_id -> haptic_effect -> unit result
val mouse_is_haptic : unit -> bool result
val num_haptics : unit -> int result
Audio
module Audio : sig ... endAudio drivers
val audio_init : string option -> unit result
val get_audio_driver : int -> string result
val get_num_audio_drivers : unit -> int result
Audio devices
type audio_device_id= uint32type audio_callbackThe type for audio callbacks.
val audio_callback : ('a, 'b) Bigarray.kind -> (('a, 'b) bigarray -> unit) -> audio_callbackaudio_callback k fis an audio callback. A reference needs to be kept on the callback value until it is no longer needed.
type audio_spec={as_freq : int;as_format : Audio.format;as_channels : uint8;as_silence : uint8;as_samples : uint8;as_size : uint32;as_callback : audio_callback option;}
val close_audio_device : audio_device_id -> unit
val free_wav : ('a, 'b) bigarray -> unit
val get_audio_device_name : int -> bool -> string result
val get_audio_device_status : audio_device_id -> Audio.status
val get_num_audio_devices : bool -> int result
val load_wav_rw : rw_ops -> audio_spec -> ('a, 'b) Bigarray.kind -> (audio_spec * ('a, 'b) bigarray) result
val lock_audio_device : audio_device_id -> unit
val open_audio_device : string option -> bool -> audio_spec -> Audio.allow -> (audio_device_id * audio_spec) result
val pause_audio_device : audio_device_id -> bool -> unit
val unlock_audio_device : audio_device_id -> unit
val queue_audio : audio_device_id -> ('a, 'b) bigarray -> unit result
val dequeue_audio : audio_device_id -> ('a, 'b) bigarray -> int
val get_queued_audio_size : audio_device_id -> int
val clear_queued_audio : audio_device_id -> unit
Timer
val get_ticks : unit -> uint32
val get_performance_counter : unit -> uint64
val get_performance_frequency : unit -> uint64
Platform and CPU information
val get_cpu_cache_line_size : unit -> int result
val has_avx : unit -> boolSDL_HasAVX (SDL 2.0.2)
val has_avx2 : unit -> boolSDL_HasAVX2 (SDL 2.0.4)
Power
type power_info={pi_state : power_state;pi_secs : int option;pi_pct : int option;}
val get_power_info : unit -> power_info
Binding Coverage
Everything except the following functions/categories are available.
Unbound categories
- Assertions (cpp based).
- Platform-specific Window Management (not useful at the moment)
- Thread Management (better use another OCaml API)
- Thread Synchronization Primitives (better use another OCaml API)
- Atomic Operations (mostly cpp based)
- File I/O Abstraction (only the minimum was covered for other parts of the API that needs it, better use another OCaml API)
- Shared Object Loading and Function Lookup (use ocaml-ctypes)
- Byte Order and Byte Swapping (cpp based)
- Bit Manipulation (cpp based)
Unbound functions
- SDL_AddHintCallback (avoid callbacks from C to OCaml)
- SDL_DelHintCallback (avoid callbacks from C to OCaml)
- SDL_LogGetOutputFunction (avoid callbacks from C to OCaml)
- SDL_LogSetOutputFunction (avoid callbacks from C to OCaml)
- SDL_CreateWindowFrom (avoid
void *type in the interface) - SDL_GetWindowData (avoid storing OCaml values in C)
- SDL_SetWindowData (avoid storing OCaml values in C)
- SDL_GetWindowWMInfo (avoid
void *type in the interface) - SDL_GL_GetProcAddress (use another OCaml API)
- SDL_GL_LoadLibrary (use another OCaml API)
- SDL_GL_UnloadLibrary (use another OCaml API)
- SDL_AddEventWatch (avoid callbacks from C to OCaml)
- SDL_DelEventWatch (avoid callbacks from C to OCaml)
- SDL_FilterEvents (avoid callbacks from C to OCaml)
- SDL_GetEventFilter (avoid callbacks from C to OCaml)
- SDL_SetEventFilter (avoid callbacks from C to OCaml)
- SDL_PeepEvents (Should certainly be split into more than one fun, functionality also available through other bound functions.)
- SDL_QuitRequested (cpp based)
- SDL_AddTimer (avoid callbacks from C to OCaml, besides callbacks are run on another thread, thus runtime lock support in ocaml-ctypes is needed. Probably better to use another OCaml API anyway)
- SDL_RemoveTimer (avoid callbacks from C to OCaml)
- SDL_SetWindowHitTest (avoid callbacks from C to OCaml)
- SDL_GetAudioStatus (SDL legacy function)
- SDL_OpenAudio (SDL legacy function)
- SDL_CloseAudio (SDL legacy function)
- SDL_LockAudio (SDL legacy function)
- SDL_MixAudio (SDL legacy function)
- SDL_MixAudioFormat (limited functionality, do your own mixing).
- SDL_PauseAudio (SDL legacy function)
- SDL_UnlockAudio (SDL legacy function)