package raylib
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=96912086fb0a10de9cc6618b631665885f3d4e4add75fea1b8a284bbcf79b395
sha512=77cab807ce4a3841191fb9188acff3e53b6aedf98b89d656b5ea975189009577ed03225521748fdadf11245a615803dc4747a37e0d394a252f5fc3c1b2409915
doc/raylib/Raylib/index.html
Module Raylib
Source
Ctypes reexports
Basic types and utility functions shared by the following modules
Constants
Types
Functions
Window and Graphics Device Functions (Module: core)
Window-related functions
init_window width heigth title
initializes window and OpenGL context
Check if window is currently hidden (only PLATFORM_DESKTOP
Check if window is currently maximized (only PLATFORM_DESKTOP)
val is_window_state : ConfigFlag.t -> bool
Check if one specific window flag is enabled
val set_window_state : ConfigFlag.t list -> unit
Set window configuration state using flags
val clear_window_state : ConfigFlag.t list -> unit
Clear window configuration state flags
val set_window_icon : Image.t -> unit
Set icon for window (only PLATFORM_DESKTOP)
set_window_position x y
sets window position on screen (only PLATFORM_DESKTOP)
set_window_min_size width height
sets window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
val get_window_handle : unit -> unit ptr option
Get native window handle
val get_monitor_position : int -> Vector2.t
Get specified monitor position
val get_window_position : unit -> Vector2.t
Get window position XY on monitor
val get_window_scale_dpi : unit -> Vector2.t
Get window scale DPI factor
Get the human-readable, UTF-8 encoded name of the primary monitor
Cursor-related functions
Check if cursor is not visible
Drawing-related functions
val clear_background : Color.t -> unit
Set background color (framebuffer clear color)
val begin_mode_2d : Camera2D.t -> unit
Initialize 2D mode with custom camera (2D)
val begin_mode_3d : Camera3D.t -> unit
Initializes 3D mode with custom camera (3D)
val begin_texture_mode : RenderTexture.t -> unit
Initializes render texture for drawing
begin_scissor_mode x y width height
defines screen area for following drawing
Screen-space-related functions
val get_mouse_ray : Vector2.t -> Camera3D.t -> Ray.t
Returns a ray trace from mouse position
val get_camera_matrix : Camera3D.t -> Matrix.t
Returns camera transform matrix (view matrix)
val get_camera_matrix_2d : Camera2D.t -> Matrix.t
Returns camera 2d transform matrix
val get_world_to_screen : Vector3.t -> Camera3D.t -> Vector2.t
Returns the screen space position for a 3d world space position
val get_world_to_screen_ex : Vector3.t -> Camera3D.t -> int -> int -> Vector2.t
get_world_to_screen_ex position camera width height
returns size position for a 3d world space position
val get_world_to_screen_2d : Vector2.t -> Camera2D.t -> Vector2.t
Returns the screen space position for a 2d camera world space position
val get_screen_to_world_2d : Vector2.t -> Camera2D.t -> Vector2.t
Returns the world space position for a 2d camera screen space position
Timing-related functions
Misc. functions
val set_config_flags : ConfigFlag.t list -> unit
Setup init configuration flags (view FLAGS)
val set_trace_log_level : TraceLogType.t -> unit
Set the current threshold (minimum) log level
val set_trace_log_exit : TraceLogType.t -> unit
Set the exit threshold (minimum) log level
val trace_log : TraceLogType.t -> string -> unit
Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR)
Files management functions
Load file data as byte array (read)
Save data to file from byte array (write)
Load text data from file (read), returns a '' terminated string
save_file_text filename text
saves text data to file (write), string must be '\0' terminated
is_file_extension filename ext
checks file extension
Get extension for a filename string (including point: ".png")
Get filename string without extension (uses static string)
Get full path for a given fileName with path (uses static string)
Get previous directory path for a given path (uses static string)
Get filenames in a directory path (memory should be freed)
Get dropped files names (memory should be freed)
Compress data (DEFLATE algorithm)
Decompress data (DEFLATE algorithm)
Persistent storage management
save_storage_value position value
saves integer value to storage file (to defined position), returns true on success
Input Handling Functions (Module: core)
Input-related functions: keyboard
val is_key_pressed : Key.t -> bool
Detect if a key has been pressed once
val is_key_down : Key.t -> bool
Detect if a key is being pressed
val is_key_released : Key.t -> bool
Detect if a key has been released once
val is_key_up : Key.t -> bool
Detect if a key is NOT being pressed
val set_exit_key : Key.t -> unit
Set a custom key to exit program (default is ESC)
val get_key_pressed : unit -> Key.t
Get key pressed (keycode), call it multiple times for keys queued
Get char pressed (unicode), call it multiple times for chars queued
Input-related functions: gamepads
val is_gamepad_available : GamepadNumber.t -> bool
Detect if a gamepad is available
val is_gamepad_name : GamepadNumber.t -> string -> bool
Check gamepad name (if available)
val get_gamepad_name : GamepadNumber.t -> string
Return gamepad internal name id
val is_gamepad_button_pressed : GamepadNumber.t -> GamepadButton.t -> bool
Detect if a gamepad button has been pressed once
val is_gamepad_button_down : GamepadNumber.t -> GamepadButton.t -> bool
Detect if a gamepad button is being pressed
val is_gamepad_button_released : GamepadNumber.t -> GamepadButton.t -> bool
Detect if a gamepad button has been released once
val is_gamepad_button_up : GamepadNumber.t -> GamepadButton.t -> bool
Detect if a gamepad button is NOT being pressed
val get_gamepad_button_pressed : unit -> GamepadButton.t
Get the last gamepad button pressed
val get_gamepad_axis_count : GamepadNumber.t -> int
Return gamepad axis count for a gamepad
val get_gamepad_axis_movement : GamepadNumber.t -> GamepadAxis.t -> float
Return axis movement value for a gamepad axis
Input-related functions: mouse
val is_mouse_button_pressed : MouseButton.t -> bool
Detect if a mouse button has been pressed once
val is_mouse_button_down : MouseButton.t -> bool
Detect if a mouse button is being pressed
val is_mouse_button_released : MouseButton.t -> bool
Detect if a mouse button has been released once
val is_mouse_button_up : MouseButton.t -> bool
Detect if a mouse button is NOT being pressed
val get_mouse_position : unit -> Vector2.t
Returns mouse position XY
val get_mouse_cursor : unit -> MouseCursor.t
Returns mouse cursor if (MouseCursor enum
val set_mouse_cursor : MouseCursor.t -> unit
Set mouse cursor
Input-related functions: touch
val get_touch_position : int -> Vector2.t
Returns touch position XY for a touch point index (relative to screen size)
Gestures and Touch Handling Functions (Module: gestures)
val get_gesture_drag_vector : unit -> Vector2.t
Get gesture drag vector
val get_gesture_pinch_vector : unit -> Vector2.t
Get gesture pinch delta
Camera System Functions (Module: camera)
val set_camera_mode : Camera3D.t -> CameraMode.t -> unit
Set camera mode (multiple camera modes available)
val update_camera : Camera3D.t ptr -> unit
Update camera position for selected mode
val set_camera_pan_control : Key.t -> unit
Set camera pan key to combine with mouse movement (free camera)
val set_camera_alt_control : Key.t -> unit
Set camera alt key to combine with mouse movement (free camera)
val set_camera_smooth_zoom_control : Key.t -> unit
Set camera smooth zoom key to combine with mouse (free camera)
set_camera_move_controls front back right left up down
sets camera move controls (1st person and 3rd person cameras)
Basic Shapes Drawing Functions (Module: shapes)
Basic shapes drawing functions
val draw_pixel : int -> int -> Color.t -> unit
draw_pixel x y color
draws a pixel at x, y
val draw_line : int -> int -> int -> int -> Color.t -> unit
draw_line start_x start_y end_x end_y color
draws a line
draw_line_v start end color
draws a line (Vector version)
draw_line_v start end thickness color
draws a line defining thickness
draw_line_bezier start end thickness color
draws a line using cubic-bezier curves in-out
draw_line_strip points pointsCount color
draws lines sequence
val draw_circle : int -> int -> float -> Color.t -> unit
draw_circle center_x center_y radius color
draws a color-filled circle
draw_circle_sector center radius start_angle end_angle segments color
draws a piece of a circle
draw_circle_sector_lines center radius startAngle endAngle segments color
draws circle sector outline
draw_circle_gradient centerX centerY radius color1 color2
draws a gradient-filled circle
draw_circle_v center radius color
draws a color-filled circle (Vector version)
val draw_circle_lines : int -> int -> float -> Color.t -> unit
draw_circle_lines centerX centerY radius color
draws circle outline
val draw_ellipse : int -> int -> float -> float -> Color.t -> unit
draw_ellipse centerX centerY radiusH radiusV color
draws ellipse
val draw_ellipse_lines : int -> int -> float -> float -> Color.t -> unit
draw_ellipse_lines centerX centerY radiusH radiusV color
draws ellipse outline
draw_ring center innerRadius outerRadius startAngle endAngle segments color
draws ring
draw_ring_lines center innerRadius outerRadius startAngle endAngle segments color
draws ring outline
val draw_rectangle : int -> int -> int -> int -> Color.t -> unit
draw_rectangle posX posY width height color
draws a color-filled rectangle
draw_rectangle_v position size color
draws a color-filled rectangle (Vector version)
val draw_rectangle_rec : Rectangle.t -> Color.t -> unit
draw_rectangle_rec position size color
draws a color-filled rectangle
val draw_rectangle_pro : Rectangle.t -> Vector2.t -> float -> Color.t -> unit
draw_rectangle_pro rec origin rotation color
draws a color-filled rectangle with pro parameters
draw_rectangle_gradient_v posX posY width height color1 color2
draws a vertical-gradient-filled rectangle
draw_rectangle_gradient_h posX posY width height color1 color2
draws a horizontal-gradient-filled rectangle
val draw_rectangle_gradient_ex :
Rectangle.t ->
Color.t ->
Color.t ->
Color.t ->
Color.t ->
unit
draw_rectangle_gradient_ex rec col1 col2 col3 col4
draws a gradient-filled rectangle with custom vertex colors
val draw_rectangle_lines : int -> int -> int -> int -> Color.t -> unit
draw_rectangle_lines posX posY width height color
draws rectangle outline
val draw_rectangle_lines_ex : Rectangle.t -> int -> Color.t -> unit
draw_rectangle_lines_ex rec lineThick color
draws rectangle outline with extended parameters
val draw_rectangle_rounded : Rectangle.t -> float -> int -> Color.t -> unit
draw_rectangle_rounded rec roundness segments color
draws rectangle with rounded edges
val draw_rectangle_rounded_lines :
Rectangle.t ->
float ->
int ->
int ->
Color.t ->
unit
draw_rectangle_rounded_lines rec roundness segments lineThick color
draws rectangle with rounded edges outline
draw_triangle v1 v2 v3 color
draws a color-filled triangle (vertex in counter-clockwise order!)
draw_triangle_lines v1 v2 v3 color
draws triangle outline (vertex in counter-clockwise order!)
draw_triangle_fan points pointsCount color
draws a triangle fan defined by points (first vertex is the center)
draw_triangle_strip points pointsCount color
draws a triangle strip defined by points
draw_poly center sides radius rotation color
draws a regular polygon (Vector version)
draw_poly_lines center sides radius rotation color
draws a polygon outline of n sides
Basic shapes collision detection functions
val check_collision_recs : Rectangle.t -> Rectangle.t -> bool
Check collision between two rectangles
Check collision between two circles
val check_collision_circle_rec : Vector2.t -> float -> Rectangle.t -> bool
Check collision between circle and rectangle
val check_collision_point_rec : Vector2.t -> Rectangle.t -> bool
Check if point is inside rectangle
check_collision_point_circle point center radius
checks if point is inside circle
check_collision_point_triangle point p1 p2 p3
checks if point is inside a triangle
val get_collision_rec : Rectangle.t -> Rectangle.t -> Rectangle.t
Get collision rectangle for two rectangles collision
Texture Loading and Drawing Functions (Module: textures)
Image loading functions
val load_image : string -> Image.t
Load image from file into CPU memory (RAM)
val load_image_raw : string -> int -> int -> PixelFormat.t -> int -> Image.t
load_image_raw fileName width height format headerSize
loads image from RAW file data
val unload_image : Image.t -> unit
Unload image from CPU memory (RAM)
val export_image : Image.t -> string -> bool
Export image data to file
val export_image_as_code : Image.t -> string -> bool
export_image_as_code image filename
exports image as code file defining an array of bytes, returns true on success
Generate image: vertical gradient
Generate image: horizontal gradient
Generate image: radial gradient
Generate image: checked
val gen_image_white_noise : int -> int -> float -> Image.t
Generate image: white noise
val gen_image_perlin_noise : int -> int -> int -> int -> float -> Image.t
Generate image: perlin noise
val gen_image_cellular : int -> int -> int -> Image.t
Generate image: cellular algorithm. Bigger tileSize means bigger cells
Image manipulation functions
val image_from_image : Image.t -> Rectangle.t -> Image.t
Create an image from another image piece
Create an image from text (custom sprite font)
val image_crop : Image.t ptr -> Rectangle.t -> unit
Crop an image to a defined rectangle
Resize image (Nearest-Neighbor scaling algorithm)
Resize canvas and fill with color
Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
Modify image color: replace color
val get_image_alpha_border : Image.t -> float -> Rectangle.t
Get image alpha border rectangle
Image drawing functions
Draw pixel within an image (Vector version)
Draw line within an image
Draw line within an image (Vector version)
Draw circle within an image
Draw circle within an image (Vector version)
Draw rectangle within an image
Draw rectangle within an image (Vector version)
val image_draw_rectangle_rec : Image.t ptr -> Rectangle.t -> Color.t -> unit
Draw rectangle within an image
val image_draw_rectangle_lines :
Image.t ptr ->
Rectangle.t ->
int ->
Color.t ->
unit
Draw rectangle lines within an image
val image_draw :
Image.t ptr ->
Image.t ->
Rectangle.t ->
Rectangle.t ->
Color.t ->
unit
Draw a source image within a destination image (tint applied to source)
image_draw_text dst text posX posY fontSize color
draws text (using default font) within an image (destination)
val image_draw_text_ex :
Image.t ptr ->
Font.t ->
string ->
Vector2.t ->
float ->
float ->
Color.t ->
unit
image_draw_text_ex dst font text position fontSize spacing tint
draws text (custom sprite font) within an image (destination)
Texture loading functions
val load_texture : string -> Texture.t
Load texture from file into GPU memory (VRAM)
Load cubemap from image, multiple image cubemap layouts supported
val load_render_texture : int -> int -> RenderTexture.t
Load texture for rendering (framebuffer)
val unload_texture : Texture.t -> unit
Unload texture from GPU memory (VRAM)
val unload_render_texture : RenderTexture.t -> unit
Unload render texture from GPU memory (VRAM)
update_texture texture pixels
updates GPU texture with new data
val update_texture_rec : Texture.t -> Rectangle.t -> unit ptr -> unit
update_texture_rec texture rec pixels
updates GPU texture rectangle with new data
val get_screen_data : unit -> Image.t
Get pixel data from screen buffer and return an Image (screenshot)
Texture configuration functions
val set_texture_filter : Texture.t -> TextureFilterMode.t -> unit
Set texture scaling filter mode
val set_texture_wrap : Texture.t -> TextureWrapMode.t -> unit
Set texture wrapping mode
Texture drawing functions
draw_texture texture posX posY tint
draws a Texture
draw_texture_v texture position tint
draws a Texture with position defined as Vector2
draw_texture_ex texture position rotation scale tint
draws a Texture with extended parameters
val draw_texture_rec : Texture.t -> Rectangle.t -> Vector2.t -> Color.t -> unit
draw_texture_rec texture source position tint
draws a part of a texture defined by a rectangle
val draw_texture_quad :
Texture.t ->
Vector2.t ->
Vector2.t ->
Rectangle.t ->
Color.t ->
unit
draw_texture_quad texture tiling offset quad tint
draws texture quad with tiling and offset parameters
val draw_texture_tiled :
Texture.t ->
Rectangle.t ->
Rectangle.t ->
Vector2.t ->
float ->
float ->
Color.t ->
unit
draw_texture_tiled texture source dest origin rotation scale tint
draws part of a texture (defined by a rectangle) with rotation and scale tiled into dest
val draw_texture_pro :
Texture.t ->
Rectangle.t ->
Rectangle.t ->
Vector2.t ->
float ->
Color.t ->
unit
draw_texture_pro texture source dest origin rotation tint
draws a part of a texture defined by a rectangle with 'pro' parameters
val draw_texture_n_patch :
Texture.t ->
NPatchInfo.t ->
Rectangle.t ->
Vector2.t ->
float ->
Color.t ->
unit
draw_texture_n_patch texture nPatchInfo dest origin rotation tint
draws a texture (or part of it) that stretches or shrinks nicely
Color/Pixel related functions
val color_to_int : Color.t -> int
Returns hexadecimal value for a Color
val color_from_hsv : float -> float -> float -> Color.t
color_from_hsv hue saturation value
returns a Color from HSV values
color_alpha color alpha
returns color with alpha applied, alpha goes from 0.0f to 1.0f
color_alpha_blend dst src tint
returns src alpha-blended into dst color with tint
val get_color : int -> Color.t
Returns a Color struct from hexadecimal value
val get_pixel_color : unit ptr -> PixelFormat.t -> Color.t
Get Color from a source pixel pointer of certain format
val set_pixel_color : unit ptr -> Color.t -> PixelFormat.t -> unit
Set color formatted into destination pixel pointer
val get_pixel_data_size : int -> int -> PixelFormat.t -> int
get_pixel_data_size width height format
gets pixel data size in bytes (image or texture)
Font Loading and Text Drawing Functions (Module: text)
Font loading/unloading functions
val get_font_default : unit -> Font.t
Get the default Font
val load_font : string -> Font.t
Load font from file into GPU memory (VRAM)
load_font_ex fileName fontSize fontChars charsCount
loads font from file with extended parameters
load_font_from_image image kay firstChar
loads font from Image (XNA style)
val load_font_data :
Unsigned.uchar ptr ->
int ->
int ->
int ptr ->
int ->
int ->
CharInfo.t ptr
load_font_data fileData dataSize fontSize fontChars charsCount type
loads font data for further use
val unload_font_data : CharInfo.t ptr -> int -> unit
unload_font_data chars charsCount
Unload font chars info data (RAM)
val unload_font : Font.t -> unit
Unload Font from GPU memory (VRAM)
Text drawing functions
val draw_text : string -> int -> int -> int -> Color.t -> unit
draw_text text posX posY fontSize color
draws text (using default font)
draw_text_ex font text position fontSize spacing tint
draws text using font and additional parameters
val draw_text_rec :
Font.t ->
string ->
Rectangle.t ->
float ->
float ->
bool ->
Color.t ->
unit
draw_text_rec font text rec fontSize spacing wordWrap tint
draws text using font inside rectangle limits
val draw_text_rec_ex :
Font.t ->
string ->
Rectangle.t ->
float ->
float ->
bool ->
Color.t ->
int ->
int ->
Color.t ->
Color.t ->
unit
draw_text_rec_ex font text rec fontSize spacing wordWrap tint selectStart selectLength selectTint selectBackTint
draws text using font inside rectangle limits with support for text selection
draw_text_codepoint font codepoint position fontSize tint
draws one character (codepoint)
Text misc. functions
val get_glyph_index : Font.t -> int -> int
Get index position for a unicode character on font
Text strings management functions (no utf8 strings, only byte chars)
Text formatting with variables (sprintf style)
Insert text in a position (memory must be freed!)
val text_append : string -> string -> int ptr -> unit
Append text at specific position and move cursor!
val text_to_utf8 : int ptr -> int -> string
Encode text codepoint into utf8 text (memory must be freed!)
UTF8 text strings management functions
Get all codepoints in a string, codepoints count returned by parameters
Get total number of characters (codepoints) in a UTF8 encoded string
val get_next_codepoint : string -> int ptr -> int
Returns next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure
val codepoint_to_utf8 : int -> int ptr -> string
Encode codepoint into utf8 text (char array length returned as parameter)
Basic 3d Shapes Drawing Functions (Module: models)
Basic geometric 3D shapes drawing functions
draw_line_3d startPos endPos color
draws a line in 3D world space
draw_point_3d position color
draws a point in 3D space, actually a small line
draw_circle_3d center radius rotationAxis rotationAngle color
draws a circle in 3D world space
draw_triangle_3d v1 v2 v3 color
draws a triangle strip defined by points
draw_triangle_strip_3d points pointsCount color
draws a triangle strip defined by points
draw_cube position width height length color
draws cube
draw_cube_v position size color
draws cube (Vector version)
draw_cube_wires position width height length color
draws cube wires
draw_cube_wires_v position size color
draws cube wires (Vector version)
draw_cube_texture texture position width height length color
draws cube textured
draw_sphere centerPos radius color
draws sphere
draw_sphere_ex centerPos radius rings slices color
draws sphere with extended parameters
draw_sphere_wires centerPos radius rings slices color
draws sphere wires
draw_cylinder position radiusTop radiusBottom height slices color
draws a cylinder/cone
draw_cylinder_wires position radiusTop radiusBottom height slices color
draws a cylinder/cone wires
draw_plane centerPos size color
draws a plane XZ
val draw_gizmo : Vector3.t -> unit
draw_gizmo position
draws simple gizmo
Model loading/unloading functions
val load_model : string -> Model.t
Load model from files (meshes and materials)
val unload_model : Model.t -> unit
Unload model (including meshes) from memory (RAM and/or VRAM)
val unload_model_keep_meshes : Model.t -> unit
Unload model (but not meshes) from memory (RAM and/or VRAM)
val unload_mesh : Mesh.t -> unit
Unload mesh from memory (RAM and/or VRAM)
val export_mesh : Mesh.t -> string -> unit
Export mesh data to file
Material loading/unloading functions
val load_materials : string -> int ptr -> Material.t ptr
Load materials from model file
val load_material_default : unit -> Material.t
Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
val unload_material : Material.t -> unit
Unload material from GPU memory (VRAM)
val set_material_texture :
Material.t ptr ->
MaterialMapType.t ->
Texture.t ->
unit
Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...)
Model animations loading/unloading functions
Load model animations from file
val update_model_animation : Model.t -> ModelAnimation.t -> int -> unit
Update model animation pose
val unload_model_animation : ModelAnimation.t -> unit
Unload animation data
val is_model_animation_valid : Model.t -> ModelAnimation.t -> bool
Check model animation skeleton match
Mesh generation functions
val gen_mesh_poly : int -> float -> Mesh.t
Generate polygonal mesh
val gen_mesh_plane : float -> float -> int -> int -> Mesh.t
Generate plane mesh (with subdivisions)
val gen_mesh_cube : float -> float -> float -> Mesh.t
Generate cuboid mesh
val gen_mesh_sphere : float -> int -> int -> Mesh.t
Generate sphere mesh (standard sphere)
val gen_mesh_hemi_sphere : float -> int -> int -> Mesh.t
Generate half-sphere mesh (no bottom cap)
val gen_mesh_cylinder : float -> float -> int -> Mesh.t
Generate cylinder mesh
val gen_mesh_torus : float -> float -> int -> int -> Mesh.t
Generate torus mesh
val gen_mesh_knot : float -> float -> int -> int -> Mesh.t
Generate trefoil knot mesh
Mesh manipulation functions
val mesh_bounding_box : Mesh.t -> BoundingBox.t
Compute mesh bounding box limits
Model drawing functions
draw_model model position scale tint
draws a model (with texture if set)
draw_model_ex model position rotationAxis rotationAngle scale tint
draws a model with extended parameters
draw_model_wires model position scale tint
draws a model wires (with texture if set)
val draw_model_wires_ex :
Model.t ->
Vector3.t ->
Vector3.t ->
float ->
Vector3.t ->
Color.t ->
unit
draw_model_wires_ex model position rotationAxis rotationAngle scale tint
draws a model wires (with texture if set) with extended parameters
val draw_bounding_box : BoundingBox.t -> Color.t -> unit
draw_bounding_box box color
draws bounding box (wires)
val draw_billboard :
Camera3D.t ->
Texture.t ->
Vector3.t ->
float ->
Color.t ->
unit
draw_billboard camera texture center size tint
draws a billboard texture
val draw_billboard_rec :
Camera3D.t ->
Texture.t ->
Rectangle.t ->
Vector3.t ->
float ->
Color.t ->
unit
draw_billboard_rec camera texture source center size tint
draws a billboard texture defined by sourceRec
Collision detection functions
Detect collision between two spheres
val check_collision_boxes : BoundingBox.t -> BoundingBox.t -> bool
Detect collision between two bounding boxes
val check_collision_box_sphere : BoundingBox.t -> Vector3.t -> float -> bool
Detect collision between box and sphere
Detect collision between ray and sphere
Detect collision between ray and sphere, returns collision point
val check_collision_ray_box : Ray.t -> BoundingBox.t -> bool
Detect collision between ray and box
val get_collision_ray_mesh : Ray.t -> Mesh.t -> Matrix.t -> RayHitInfo.t
get_collision_ray_mesh ray mesh transform
gets collision info between ray and mesh
val get_collision_ray_model : Ray.t -> Model.t -> RayHitInfo.t
Get collision info between ray and model
val get_collision_ray_triangle :
Ray.t ->
Vector3.t ->
Vector3.t ->
Vector3.t ->
RayHitInfo.t
Get collision info between ray and triangle
val get_collision_ray_ground : Ray.t -> float -> RayHitInfo.t
Get collision info between ray and ground plane (Y-normal plane)
Shaders System Functions (Module: rlgl)
Shader loading/unloading functions
val load_shader : string -> string -> Shader.t
Load shader from files and bind default locations
val load_shader_code : string -> string -> Shader.t
Load shader from code strings and bind default locations
val unload_shader : Shader.t -> unit
Unload shader from GPU memory (VRAM)
val get_shader_default : unit -> Shader.t
Get default shader
val get_texture_default : unit -> Texture.t
Get default texture
val get_shapes_texture : unit -> Texture.t
Get texture to draw shapes
val get_shapes_texture_rec : unit -> Rectangle.t
Get texture rectangle to draw shapes
val set_shapes_texture : Texture.t -> Rectangle.t -> unit
Define default texture used to draw shapes
Shader configuration functions
val get_shader_location : Shader.t -> string -> int
Get shader uniform location
val get_shader_location_attrib : Shader.t -> string -> int
Get shader attribute location
val set_shader_value :
Shader.t ->
int ->
unit ptr ->
ShaderUniformDataType.t ->
unit
Set shader uniform value
val set_shader_value_v :
Shader.t ->
int ->
unit ptr ->
ShaderUniformDataType.t ->
int ->
unit
Set shader uniform value vector
Set shader uniform value (matrix 4x4)
Set shader uniform value for texture
val set_matrix_projection : Matrix.t -> unit
Set a custom projection matrix (replaces internal projection matrix)
val set_matrix_modelview : Matrix.t -> unit
Set a custom modelview matrix (replaces internal modelview matrix)
val get_matrix_modelview : unit -> Matrix.t
Get internal modelview matrix
val get_matrix_projection : unit -> Matrix.t
Get internal projection matrix
Texture maps generation (PBR)
val gen_texture_cubemap :
Shader.t ->
Texture.t ->
int ->
PixelFormat.t ->
Texture.t
Generate cubemap texture from 2D texture
Generate irradiance texture using cubemap data
Generate prefilter texture using cubemap data
Shading begin/end functions
val begin_shader_mode : Shader.t -> unit
Begin custom shader drawing
val begin_blend_mode : BlendMode.t -> unit
Begin blending mode (alpha, additive, multiplied)
VR control functions
val update_vr_tracking : Camera3D.t ptr -> unit
Update VR tracking (position and orientation) and camera
val set_vr_configuration : VrDeviceInfo.t -> Shader.t -> unit
Set stereo rendering configuration parameters
Audio Loading and Playing Functions (Module: audio)
Audio device management functions
Wave/Sound loading/unloading functions
val load_wave : string -> Wave.t
Load wave data from file
Load wave from memory buffer, fileType refers to extension: i.e. "wav"
val load_sound : string -> Sound.t
Load sound from file
val unload_wave : Wave.t -> unit
Unload wave data
val unload_sound : Sound.t -> unit
Unload sound
val export_wave : Wave.t -> string -> bool
Export wave data to file, returns true on success
val export_wave_as_code : Wave.t -> string -> bool
Export wave sample data to code (.h), returns true on success
Wave/Sound management functions
val play_sound : Sound.t -> unit
Play a sound
val stop_sound : Sound.t -> unit
Stop playing a sound
val pause_sound : Sound.t -> unit
Pause a sound
val resume_sound : Sound.t -> unit
Resume a paused sound
val play_sound_multi : Sound.t -> unit
Play a sound (using multichannel buffer pool)
val is_sound_playing : Sound.t -> bool
Check if a sound is currently playing
val set_sound_volume : Sound.t -> float -> unit
Set volume for a sound (1.0 is max level)
val set_sound_pitch : Sound.t -> float -> unit
Set pitch for a sound (1.0 is base level)
val unload_wave_samples : float ptr -> unit
Unload samples data loaded with load_wave_data
Music management functions
val load_music_stream : string -> Music.t
Load music stream from file
val unload_music_stream : Music.t -> unit
Unload music stream
val play_music_stream : Music.t -> unit
Start music playing
val update_music_stream : Music.t -> unit
Updates buffers for music streaming
val stop_music_stream : Music.t -> unit
Stop music playing
val pause_music_stream : Music.t -> unit
Pause music playing
val resume_music_stream : Music.t -> unit
Resume playing paused music
val is_music_playing : Music.t -> bool
Check if music is playing
val set_music_volume : Music.t -> float -> unit
Set volume for music (1.0 is max level)
val set_music_pitch : Music.t -> float -> unit
Set pitch for a music (1.0 is base level)
val get_music_time_length : Music.t -> float
Get music time length (in seconds)
val get_music_time_played : Music.t -> float
Get current music time played (in seconds)
AudioStream management functions
val init_audio_stream : int -> int -> int -> AudioStream.t
Init audio stream (to stream raw audio pcm data)
val update_audio_stream : AudioStream.t -> unit ptr -> int -> unit
Update audio stream buffers with data
val close_audio_stream : AudioStream.t -> unit
Close audio stream and free memory
val is_audio_stream_processed : AudioStream.t -> bool
Check if any audio stream buffers requires refill
val play_audio_stream : AudioStream.t -> unit
Play audio stream
val pause_audio_stream : AudioStream.t -> unit
Pause audio stream
val resume_audio_stream : AudioStream.t -> unit
Resume audio stream
val is_audio_stream_playing : AudioStream.t -> bool
Check if audio stream is playing
val stop_audio_stream : AudioStream.t -> unit
Stop audio stream
val set_audio_stream_volume : AudioStream.t -> float -> unit
Set volume for audio stream (1.0 is max level)
val set_audio_stream_pitch : AudioStream.t -> float -> unit
Set pitch for audio stream (1.0 is base level)
- Ctypes reexports
- Constants
- Types
-
Functions
- Window and Graphics Device Functions (Module: core)
- Input Handling Functions (Module: core)
- Basic Shapes Drawing Functions (Module: shapes)
- Texture Loading and Drawing Functions (Module: textures)
- Font Loading and Text Drawing Functions (Module: text)
- Basic 3d Shapes Drawing Functions (Module: models)
- Shaders System Functions (Module: rlgl)
- Audio Loading and Playing Functions (Module: audio)