Module Sdlrender

module Sdlrender: sig .. end

2D rendering functions


API Doc: Render category

type t = Sdltype.renderer 
val create_window_and_renderer : width:int ->
height:int -> flags:Sdlwindow.window_flags list -> Sdlwindow.t * t

api doc

type renderer_flags = 
| Software
| Accelerated
| PresentVSync
| TargetTexture

api doc

val string_of_renderer_flags : renderer_flags -> string
val renderer_flags_of_string : string -> renderer_flags
val create_renderer : win:Sdlwindow.t ->
index:int -> flags:renderer_flags list -> t

api doc

val set_logical_size : t -> int * int -> unit

api doc

val set_logical_size2 : t -> width:int -> height:int -> unit

api doc

val set_viewport : t -> Sdlrect.t -> unit

api doc

val set_clip_rect : t -> Sdlrect.t -> unit

api doc

val set_draw_color : t -> rgb:int * int * int -> a:int -> unit

api doc

val set_draw_color3 : t -> r:int -> g:int -> b:int -> a:int -> unit

api doc

val set_draw_blend_mode : t -> SdlblendMode.t -> unit

api doc

val draw_point : t -> int * int -> unit

api doc

val draw_point2 : t -> x:int -> y:int -> unit

api doc

val draw_points : t -> points:(int * int) array -> unit

api doc

val draw_line : t -> (int * int) * (int * int) -> unit

api doc

val draw_line2 : t -> p1:int * int -> p2:int * int -> unit

api doc

val draw_lines : t -> (int * int) array -> unit

api doc

val draw_rect : t -> Sdlrect.t -> unit

api doc

val draw_rects : t -> Sdlrect.t array -> unit

api doc

val fill_rect : t -> Sdlrect.t -> unit

api doc

val fill_rects : t -> Sdlrect.t array -> unit

api doc

val copy : t ->
texture:Sdltexture.t ->
?src_rect:Sdlrect.t -> ?dst_rect:Sdlrect.t -> unit -> unit

api doc

type renderer_flip = 
| Flip_None
| Flip_Horizontal
| Flip_Vertical

api doc

val copyEx : t ->
texture:Sdltexture.t ->
?src_rect:Sdlrect.t ->
?dst_rect:Sdlrect.t ->
?angle:float ->
?center:int * int -> ?flip:renderer_flip -> unit -> unit

api doc

val set_scale : t -> float * float -> unit

api doc

val render_present : t -> unit

api doc

val clear : t -> unit

api doc

type renderer_info = {
   name : string;
   max_texture_width : int;
   max_texture_height : int;
}

api doc

val get_render_drivers : unit -> renderer_info array

api doc

val read_pixels : t -> ?rect:Sdlrect.t -> Sdlsurface.t -> unit

api doc