Raylib_coreBasic 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 ConfigFlags : sig ... endmodule TraceLogLevel : sig ... endmodule Key : sig ... endmodule MouseButton : sig ... endmodule MouseCursor : sig ... endmodule GamepadButton : sig ... endmodule GamepadAxis : sig ... endmodule MaterialMapIndex : sig ... endmodule ShaderLocationIndex : sig ... endmodule ShaderUniformDataType : sig ... endmodule ShaderAttributeDataType : sig ... endmodule PixelFormat : sig ... endmodule TextureFilter : sig ... endmodule TextureWrap : sig ... endmodule CubemapLayout : sig ... endmodule FontType : sig ... endmodule BlendMode : sig ... endmodule Gesture : sig ... endmodule CameraMode : sig ... endmodule CameraProjection : sig ... endmodule NPatchLayout : sig ... endmodule Vector2 : sig ... endmodule Vector3 : sig ... endmodule Vector4 : sig ... endmodule Matrix : sig ... endmodule Color : sig ... endmodule Rectangle : sig ... endmodule Image : sig ... endmodule Texture : sig ... endmodule Texture2D = Texturemodule RenderTexture : sig ... endmodule NPatchInfo : sig ... endmodule GlyphInfo : sig ... endmodule Font : sig ... endmodule Camera3D : sig ... endmodule Camera = Camera3Dmodule Camera2D : sig ... endmodule Mesh : sig ... endmodule ShaderLoc : sig ... endmodule Shader : sig ... endmodule MaterialMap : sig ... endmodule Material : sig ... endmodule Transform : sig ... endmodule BoneInfo : sig ... endmodule ModelSkeleton : sig ... endmodule Model : sig ... endmodule ModelAnimation : sig ... endmodule Ray : sig ... endmodule RayCollision : sig ... endmodule BoundingBox : sig ... endmodule Wave : sig ... endmodule AudioStream : sig ... endmodule Sound : sig ... endmodule Music : sig ... endmodule VrDeviceInfo : sig ... endmodule VrStereoConfig : sig ... endmodule FilePathList : sig ... endmodule AutomationEvent : sig ... endmodule AutomationEventList : sig ... endinit_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 the 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 Set background color (framebuffer clear color)
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 () Ends 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 a 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 the 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 the 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 the 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 Setup 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
trace_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_copy src_path dst_path Copy file from one path to another, dstPath created if it doesn't exist
file_move src_path dst_path Move file from one directory to another, dstPath created if it doesn't exist
file_text_replace file_name search replacement Replace text in an existing file
file_text_find_index file_name search Find text in existing file
is_file_extension file_name ext Check file extension (including point: .png, .wav)
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 given fileName with path (uses static string)
get_prev_directory_path dir_path Get previous directory path for a given path (uses static string)
get_working_directory () Get current working directory (uses static string)
get_application_directory () Get the 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, return true on success
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 recursive directory scan. Use 'DIR' in the filter string to include directories in the result
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 the file count in a directory
get_directory_file_count_ex base_path filter scan_subdirs Get the file count in a directory with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result
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 a key has been pressed once
val is_key_pressed_repeat : Key.t -> boolis_key_pressed_repeat key Check if a key has been pressed again
val is_key_down : Key.t -> boolis_key_down key Check if a key is being pressed
val is_key_released : Key.t -> boolis_key_released key Check if a key has been released once
val is_key_up : Key.t -> boolis_key_up key Check if a 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 -> stringget_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 a gamepad button has been pressed once
val is_gamepad_button_down : int -> GamepadButton.t -> boolis_gamepad_button_down gamepad button Check if a gamepad button is being pressed
val is_gamepad_button_released : int -> GamepadButton.t -> boolis_gamepad_button_released gamepad button Check if a gamepad button has been released once
val is_gamepad_button_up : int -> GamepadButton.t -> boolis_gamepad_button_up gamepad button Check if a gamepad button is NOT being pressed
val get_gamepad_button_pressed : unit -> GamepadButton.tget_gamepad_button_pressed () Get the 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 a mouse button has been pressed once
val is_mouse_button_down : MouseButton.t -> boolis_mouse_button_down button Check if a mouse button is being pressed
val is_mouse_button_released : MouseButton.t -> boolis_mouse_button_released button Check if a mouse button has been released once
val is_mouse_button_up : MouseButton.t -> boolis_mouse_button_up button Check if a 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 given 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 a gesture have 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