package hugin

  1. Overview
  2. Docs

Module UsdlSource

Minimal SDL2 Bindings

Sourcemodule Window : sig ... end

Opaque types for SDL objects

Sourcemodule Renderer : sig ... end
Sourcemodule Surface : sig ... end
Sourcemodule Texture : sig ... end
Sourcemodule Event : sig ... end
Sourcetype 'a result =
  1. | Ok of 'a
  2. | Error of string

Result type for functions that can fail

Sourcemodule Init : sig ... end

Initialization and Shutdown

Sourceval init : int -> unit result
Sourceval quit : unit -> unit
Sourceval get_error : unit -> string
Sourcemodule Hint : sig ... end

Hints

Sourceval set_hint : string -> string -> bool
Sourcemodule Window_flags : sig ... end

Window Management

Sourceval create_window : title:string -> w:int -> h:int -> int -> Window.t result
Sourceval destroy_window : Window.t -> unit
Sourcemodule Renderer_flags : sig ... end

Renderer Management

Sourceval create_renderer : flags:int -> Window.t -> Renderer.t result
Sourceval destroy_renderer : Renderer.t -> unit
Sourceval get_renderer_output_size : Renderer.t -> (int * int) result
Sourceval render_clear : Renderer.t -> unit result
Sourceval render_copy : Renderer.t -> Texture.t -> unit result
Sourceval render_present : Renderer.t -> unit
Sourcemodule Pixel : sig ... end

Surface Management

Sourceval create_rgb_surface_with_format : w:int -> h:int -> depth:int -> int32 -> Surface.t result
Sourceval free_surface : Surface.t -> unit
Sourceval get_surface_pitch : Surface.t -> int
Sourceval create_texture_from_surface : Renderer.t -> Surface.t -> Texture.t result

Texture Management

Sourceval destroy_texture : Texture.t -> unit
Sourcemodule Event_type : sig ... end

Event Handling

Sourcemodule Window_event_id : sig ... end
Sourceval create_event : unit -> Event.t
Sourceval wait_event : Event.t option -> bool result
Sourceval get_event_type : Event.t -> Event_type.t
Sourceval get_window_event_id : Event.t -> Window_event_id.t
OCaml

Innovation. Community. Security.