Raylib_coreShared types plus runtime raymath operations.
module Vector2 : sig ... endmodule Vector3 : sig ... endmodule Vector4 : sig ... endmodule Matrix : sig ... endinclude module type of struct include Raylib_types end
with module Vector2 := Raylib_types.Vector2
and module Vector3 := Raylib_types.Vector3
and module Vector4 := Raylib_types.Vector4
and module Matrix := Raylib_types.MatrixBasic types and utility functions shared by the following modules
val to_ctyp : 'a Ctypes.structure -> 'a ctypval ptr_of_int : int -> int ptrval ptr_of_uint : Unsigned.uint -> Unsigned.uint ptrval void_ptr_of_int : int -> unit ptrmodule CArray = Raylib_types.CArraymodule ConfigFlags = Raylib_types.ConfigFlagsmodule TraceLogLevel = Raylib_types.TraceLogLevelmodule Key = Raylib_types.Keymodule MouseButton = Raylib_types.MouseButtonmodule MouseCursor = Raylib_types.MouseCursormodule GamepadButton = Raylib_types.GamepadButtonmodule GamepadAxis = Raylib_types.GamepadAxismodule MaterialMapIndex = Raylib_types.MaterialMapIndexmodule ShaderLocationIndex = Raylib_types.ShaderLocationIndexmodule ShaderUniformDataType = Raylib_types.ShaderUniformDataTypemodule ShaderAttributeDataType = Raylib_types.ShaderAttributeDataTypemodule PixelFormat = Raylib_types.PixelFormatmodule TextureFilter = Raylib_types.TextureFiltermodule TextureWrap = Raylib_types.TextureWrapmodule CubemapLayout = Raylib_types.CubemapLayoutmodule FontType = Raylib_types.FontTypemodule BlendMode = Raylib_types.BlendModemodule Gesture = Raylib_types.Gesturemodule CameraMode = Raylib_types.CameraModemodule CameraProjection = Raylib_types.CameraProjectionmodule NPatchLayout = Raylib_types.NPatchLayoutmodule TextureId = Raylib_types.TextureIdmodule ShaderProgramId = Raylib_types.ShaderProgramIdmodule FramebufferId = Raylib_types.FramebufferIdmodule Color = Raylib_types.Colormodule Rectangle = Raylib_types.Rectanglemodule Image = Raylib_types.Imagemodule Texture = Raylib_types.Texturemodule Texture2D = Raylib_types.Texture2Dmodule RenderTexture = Raylib_types.RenderTexturemodule NPatchInfo = Raylib_types.NPatchInfomodule GlyphInfo = Raylib_types.GlyphInfomodule Font = Raylib_types.Fontmodule Camera3D = Raylib_types.Camera3Dmodule Camera = Raylib_types.Cameramodule Camera2D = Raylib_types.Camera2Dmodule Mesh = Raylib_types.Meshmodule ShaderLoc = Raylib_types.ShaderLocmodule Shader = Raylib_types.Shadermodule MaterialMap = Raylib_types.MaterialMapmodule Material = Raylib_types.Materialmodule Transform = Raylib_types.Transformmodule BoneInfo = Raylib_types.BoneInfomodule ModelSkeleton = Raylib_types.ModelSkeletonmodule Model = Raylib_types.Modelmodule ModelAnimation = Raylib_types.ModelAnimationmodule Ray = Raylib_types.Raymodule RayCollision = Raylib_types.RayCollisionmodule BoundingBox = Raylib_types.BoundingBoxmodule Wave = Raylib_types.Wavemodule AudioStream = Raylib_types.AudioStreammodule Sound = Raylib_types.Soundmodule Music = Raylib_types.Musicmodule VrDeviceInfo = Raylib_types.VrDeviceInfomodule VrStereoConfig = Raylib_types.VrStereoConfigmodule FilePathList = Raylib_types.FilePathListmodule AutomationEvent = Raylib_types.AutomationEventmodule AutomationEventList = Raylib_types.AutomationEventListinit_window width height title Initialize window and OpenGL context
window_should_close () Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)
is_window_ready () Check if window has been initialized successfully
is_window_fullscreen () Check if window is currently fullscreen
is_window_hidden () Check if window is currently hidden
is_window_resized () Check if window has been resized last frame
val is_window_state : ConfigFlags.t -> boolis_window_state flag Check if one specific window flag is enabled
val set_window_state : ConfigFlags.t -> unitset_window_state flags Set window configuration state using flags
val clear_window_state : ConfigFlags.t -> unitclear_window_state flags Clear window configuration state flags
toggle_fullscreen () Toggle window state: fullscreen/windowed, resizes monitor to match window resolution
toggle_borderless_windowed () Toggle window state: borderless windowed, resizes window to match monitor resolution
val set_window_icon : Image.t -> unitset_window_icon image Set icon for window (single image, RGBA 32bit)
set_window_icons images count Set icon for window (multiple images, RGBA 32bit)
set_window_min_size width height Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
set_window_max_size width height Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)
val get_window_handle : unit -> unit ptr optionget_window_handle () Get native window handle
get_render_height () Get current render height (it considers HiDPI)
get_current_monitor () Get current monitor where window is placed
val get_monitor_position : int -> Vector2.tget_monitor_position monitor Get specified monitor position
get_monitor_width monitor Get specified monitor width (current video mode used by monitor)
get_monitor_height monitor Get specified monitor height (current video mode used by monitor)
get_monitor_physical_width monitor Get specified monitor physical width in millimetres
get_monitor_physical_height monitor Get specified monitor physical height in millimetres
get_monitor_refresh_rate monitor Get specified monitor refresh rate
val get_window_position : unit -> Vector2.tget_window_position () Get window position XY on monitor
val get_window_scale_dpi : unit -> Vector2.tget_window_scale_dpi () Get window scale DPI factor
get_monitor_name monitor Get human-readable, UTF-8 encoded name of the specified monitor
val get_clipboard_image : unit -> Image.tget_clipboard_image () Get clipboard image content
enable_event_waiting () Enable waiting for events on EndDrawing(), no automatic event polling
disable_event_waiting () Disable waiting for events on EndDrawing(), automatic events polling
is_cursor_hidden () Check if cursor is not visible
val clear_background : Color.t -> unitclear_background color Clear background (framebuffer) to color
end_drawing () End canvas (framebuffer) drawing and swap buffers (double buffering)
val begin_mode_2d : Camera2D.t -> unitbegin_mode_2d camera Begin 2D mode with custom camera (2D)
val begin_mode_3d : Camera3D.t -> unitbegin_mode_3d camera Begin 3D mode with custom camera (3D)
end_mode_3d () End 3D mode and returns to default 2D orthographic mode
val begin_texture_mode : RenderTexture.t -> unitbegin_texture_mode target Begin drawing to render texture
val begin_shader_mode : Shader.t -> unitbegin_shader_mode shader Begin custom shader drawing
val begin_blend_mode : BlendMode.t -> unitbegin_blend_mode mode Begin blending mode (alpha, additive, multiplied, subtract, custom)
end_blend_mode () End blending mode (reset to default: alpha blending)
begin_scissor_mode x y width height Begin scissor mode (define screen area for following drawing)
val begin_vr_stereo_mode : VrStereoConfig.t -> unitbegin_vr_stereo_mode config Begin stereo rendering (requires VR simulator)
end_vr_stereo_mode () End stereo rendering (requires VR simulator)
val load_vr_stereo_config : VrDeviceInfo.t -> VrStereoConfig.tload_vr_stereo_config device Load VR stereo config for VR simulator device parameters
val unload_vr_stereo_config : VrStereoConfig.t -> unitunload_vr_stereo_config config Unload VR stereo config
val load_shader : string -> string -> Shader.tload_shader vs_file_name fs_file_name Load shader from files and bind default locations
val load_shader_from_memory : string -> string -> Shader.tload_shader_from_memory vs_code fs_code Load shader from code strings and bind default locations
val is_shader_valid : Shader.t -> boolis_shader_valid shader Check if shader is valid (loaded on GPU)
val get_shader_location : Shader.t -> string -> ShaderLoc.tget_shader_location shader uniform_name Get shader uniform location
val get_shader_location_attrib : Shader.t -> string -> ShaderLoc.tget_shader_location_attrib shader attrib_name Get shader attribute location
val set_shader_value :
Shader.t ->
ShaderLoc.t ->
unit ptr ->
ShaderUniformDataType.t ->
unitset_shader_value shader loc_index value uniform_type Set shader uniform value
val set_shader_value_v :
Shader.t ->
ShaderLoc.t ->
unit ptr ->
ShaderUniformDataType.t ->
int ->
unitset_shader_value_v shader loc_index value uniform_type count Set shader uniform value vector
val set_shader_value_matrix : Shader.t -> ShaderLoc.t -> Matrix.t -> unitset_shader_value_matrix shader loc_index mat Set shader uniform value (matrix 4x4)
val set_shader_value_texture : Shader.t -> ShaderLoc.t -> Texture.t -> unitset_shader_value_texture shader loc_index texture Set shader uniform value for texture (sampler2d)
val unload_shader : Shader.t -> unitunload_shader shader Unload shader from GPU memory (VRAM)
val get_screen_to_world_ray : Vector2.t -> Camera3D.t -> Ray.tget_screen_to_world_ray position camera Get a ray trace from screen position (i.e mouse)
val get_screen_to_world_ray_ex : Vector2.t -> Camera3D.t -> int -> int -> Ray.tget_screen_to_world_ray_ex position camera width height Get a ray trace from screen position (i.e mouse) in a viewport
val get_world_to_screen : Vector3.t -> Camera3D.t -> Vector2.tget_world_to_screen position camera Get screen space position for a 3d world space position
val get_world_to_screen_ex : Vector3.t -> Camera3D.t -> int -> int -> Vector2.tget_world_to_screen_ex position camera width height Get size position for a 3d world space position
val get_world_to_screen_2d : Vector2.t -> Camera2D.t -> Vector2.tget_world_to_screen_2d position camera Get screen space position for a 2d camera world space position
val get_screen_to_world_2d : Vector2.t -> Camera2D.t -> Vector2.tget_screen_to_world_2d position camera Get world space position for a 2d camera screen space position
val get_camera_matrix : Camera3D.t -> Matrix.tget_camera_matrix camera Get camera transform matrix (view matrix)
val get_camera_matrix_2d : Camera2D.t -> Matrix.tget_camera_matrix_2d camera Get camera 2d transform matrix
get_frame_time () Get time in seconds for last frame drawn (delta time)
swap_screen_buffer () Swap back buffer with front buffer (screen drawing)
set_random_seed seed Set the seed for the random number generator
get_random_value min max Get a random value between min and max (both included)
val load_random_sequence : int -> int -> int -> int ptrload_random_sequence count min max Load random values sequence, no values repeated
val unload_random_sequence : int ptr -> unitunload_random_sequence sequence Unload random values sequence
take_screenshot file_name Takes a screenshot of current screen (filename extension defines format)
val set_config_flags : ConfigFlags.t -> unitset_config_flags flags Set init configuration flags (view FLAGS)
val set_trace_log_level : TraceLogLevel.t -> unitset_trace_log_level log_level Set the current threshold (minimum) log level
val trace_log : TraceLogLevel.t -> string -> unittrace_log log_level text args Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
val mem_alloc : int -> unit ptrmem_alloc size Internal memory allocator
val mem_free : unit ptr -> unitmem_free ptr Internal memory free
save_file_data file_name data data_size Save data to file from byte array (write), returns true on success
export_data_as_code data filename Export data to code (.h), returns true on success
load_file_text file_name Load text data from file (read), returns a '\0' terminated string
save_file_text file_name text Save text data to file (write), string must be ' 0' terminated, returns true on success
file_rename file_name file_rename Rename file (if exists), returns 0 on success
file_copy src_path dst_path Copy file from one path to another, dstPath created if it doesn't exist, returns 0 on success
file_move src_path dst_path Move file from one directory to another, dstPath created if it doesn't exist, returns 0 on success
file_text_replace file_name search replacement Replace text in an existing file, returns 0 on success
file_text_find_index file_name search Find text in existing file, returns -1 if index not found or index otherwise
is_file_extension file_name ext Check file extension (including point: .png, .wav)
is_file_hidden file_path Check if file path (file or directory) is hidden by OS
get_file_length file_name Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)
get_file_mod_time file_name Get file modification time (last write time)
get_file_extension file_name Get pointer to extension for a filename string (includes dot: '.png')
get_file_name file_path Get pointer to filename for a path string
get_file_name_without_ext file_path Get filename string without extension (uses static string)
get_directory_path file_path Get full path for a provided fileName with path (uses static string)
get_prev_directory_path dir_path Get previous directory path for a provided path (uses static string)
get_working_directory () Get current working directory (uses static string)
get_application_directory () Get directory of the running application (uses static string)
make_directory dir_path Create directories (including full path requested), returns 0 on success
change_directory dir Change working directory, returns 0 on success
is_path_directory path Check if provided path points to a directory
is_path_absolute path Check if provided path is an absolute path
is_file_name_valid file_name Check if fileName is valid for the platform/OS
val load_directory_files : string -> FilePathList.tload_directory_files dir_path Load directory filepaths
val load_directory_files_ex : string -> string -> bool -> FilePathList.tload_directory_files_ex base_path filter scan_subdirs Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'
val unload_directory_files : FilePathList.t -> unitunload_directory_files files Unload filepaths
val load_dropped_files : unit -> FilePathList.tload_dropped_files () Load dropped filepaths
val unload_dropped_files : FilePathList.t -> unitunload_dropped_files files Unload dropped filepaths
get_directory_file_count dir_path Get file count in a directory
get_directory_file_count_ex base_path filter scan_subdirs Get file count in a directory with extension filtering and recursive directory scan. Filters include '*.*', 'FILES*' and 'DIRS*'
compress_data data data_length comp_data_length Compress data (DEFLATE algorithm)
decompress_data comp_data comp_data_length data_length Decompress data (DEFLATE algorithm)
val load_automation_event_list : string -> AutomationEventList.tload_automation_event_list file_name Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
val unload_automation_event_list : AutomationEventList.t -> unitunload_automation_event_list list Unload automation events list from file
val export_automation_event_list : AutomationEventList.t -> string -> boolexport_automation_event_list list file_name Export automation events list as text file
val set_automation_event_list : AutomationEventList.t ptr -> unitset_automation_event_list list Set automation event list to record to
set_automation_event_base_frame frame Set automation event internal base frame to start recording
start_automation_event_recording () Start recording automation events (AutomationEventList must be set)
stop_automation_event_recording () Stop recording automation events
val play_automation_event : AutomationEvent.t -> unitplay_automation_event event Play a recorded automation event
val is_key_pressed : Key.t -> boolis_key_pressed key Check if key has been pressed once
val is_key_pressed_repeat : Key.t -> boolis_key_pressed_repeat key Check if key has been pressed again
val is_key_down : Key.t -> boolis_key_down key Check if key is being pressed
val is_key_released : Key.t -> boolis_key_released key Check if key has been released once
val is_key_up : Key.t -> boolis_key_up key Check if key is NOT being pressed
val get_key_pressed : unit -> Key.tget_key_pressed () Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
get_char_pressed () Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty
val get_key_name : Key.t -> string optionget_key_name key Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard)
val set_exit_key : Key.t -> unitset_exit_key key Set a custom key to exit program (default is ESC)
val is_gamepad_button_pressed : int -> GamepadButton.t -> boolis_gamepad_button_pressed gamepad button Check if gamepad button has been pressed once
val is_gamepad_button_down : int -> GamepadButton.t -> boolis_gamepad_button_down gamepad button Check if gamepad button is being pressed
val is_gamepad_button_released : int -> GamepadButton.t -> boolis_gamepad_button_released gamepad button Check if gamepad button has been released once
val is_gamepad_button_up : int -> GamepadButton.t -> boolis_gamepad_button_up gamepad button Check if gamepad button is NOT being pressed
val get_gamepad_button_pressed : unit -> GamepadButton.tget_gamepad_button_pressed () Get last gamepad button pressed
get_gamepad_axis_count gamepad Get gamepad axis count for a gamepad
val get_gamepad_axis_movement : int -> GamepadAxis.t -> floatget_gamepad_axis_movement gamepad axis Get axis movement value for a gamepad axis
set_gamepad_mappings mappings Set internal gamepad mappings (SDL_GameControllerDB)
set_gamepad_vibration gamepad left_motor right_motor duration Set gamepad vibration for both motors (duration in seconds)
val is_mouse_button_pressed : MouseButton.t -> boolis_mouse_button_pressed button Check if mouse button has been pressed once
val is_mouse_button_down : MouseButton.t -> boolis_mouse_button_down button Check if mouse button is being pressed
val is_mouse_button_released : MouseButton.t -> boolis_mouse_button_released button Check if mouse button has been released once
val is_mouse_button_up : MouseButton.t -> boolis_mouse_button_up button Check if mouse button is NOT being pressed
val get_mouse_position : unit -> Vector2.tget_mouse_position () Get mouse position XY
val get_mouse_delta : unit -> Vector2.tget_mouse_delta () Get mouse delta between frames
get_mouse_wheel_move () Get mouse wheel movement for X or Y, whichever is larger
val get_mouse_wheel_move_v : unit -> Vector2.tget_mouse_wheel_move_v () Get mouse wheel movement for both X and Y
val set_mouse_cursor : MouseCursor.t -> unitset_mouse_cursor cursor Set mouse cursor
get_touch_x () Get touch position X for touch point 0 (relative to screen size)
get_touch_y () Get touch position Y for touch point 0 (relative to screen size)
val get_touch_position : int -> Vector2.tget_touch_position index Get touch position XY for a touch point index (relative to screen size)
get_touch_point_id index Get touch point identifier for provided index
val set_gestures_enabled : Gesture.t -> unitset_gestures_enabled flags Enable a set of gestures using flags
val is_gesture_detected : Gesture.t -> boolis_gesture_detected gesture Check if gesture has been detected
val get_gesture_detected : unit -> Gesture.tget_gesture_detected () Get latest detected gesture
get_gesture_hold_duration () Get gesture hold time in seconds
val get_gesture_drag_vector : unit -> Vector2.tget_gesture_drag_vector () Get gesture drag vector
val get_gesture_pinch_vector : unit -> Vector2.tget_gesture_pinch_vector () Get gesture pinch delta
val update_camera : Camera3D.t ptr -> CameraMode.t -> unitupdate_camera camera mode Update camera position for selected mode
val update_camera_pro :
Camera3D.t ptr ->
Vector3.t ->
Vector3.t ->
float ->
unitupdate_camera_pro camera movement rotation zoom Update camera movement/rotation