Documentation
Namespaces: main
main
Aliases for 'main'
// Beige
+ value BEIGE (Color{ r: 211, g: 176, b: 131, a: 255 })
// Black
+ value BLACK (Color{ r: 0, g: 0, b: 0, a: 255 })
// Blank (Transparent)
+ value BLANK (Color{ r: 0, g: 0, b: 0, a: 0 })
// Blue
+ value BLUE (Color{ r: 0, g: 121, b: 241, a: 255 })
// Brown
+ value BROWN (Color{ r: 127, g: 106, b: 79, a: 255 })
alias Camera for Camera3D
// Dark Blue
+ value DARKBLUE (Color{ r: 0, g: 82, b: 172, a: 255 })
// Dark Brown
+ value DARKBROWN (Color{ r: 76, g: 63, b: 47, a: 255 })
// Dark Gray
+ value DARKGRAY (Color{ r: 80, g: 80, b: 80, a: 255 })
// Dark Green
+ value DARKGREEN (Color{ r: 0, g: 117, b: 44, a: 255 })
// Dark Purple
+ value DARKPURPLE (Color{ r: 112, g: 31, b: 126, a: 255 })
// Multiply degrees by this for radians.
+ value DEG2RAD (PI / 180.0)
// Set to run program in borderless windowed mode.
+ value FLAG_BORDERLESS_WINDOWED_MODE (0x8000)
// Set to run program in fullscreen.
+ value FLAG_FULLSCREEN_MODE (0x2)
// Set to try enabling interlaced video format (for V3D).
+ value FLAG_INTERLACED_HINT (0x10000)
// Set to try enabling MSAA 4X.
+ value FLAG_MSAA_4X_HINT (0x20)
// Set to try enabling V-Sync on GPU.
+ value FLAG_VSYNC_HINT (0x40)
// Set to allow windows running while minimized.
+ value FLAG_WINDOW_ALWAYS_RUN (0x100)
// Set to hide window.
+ value FLAG_WINDOW_HIDDEN (0x80)
// Set to support HighDPI.
+ value FLAG_WINDOW_HIGHDPI (0x2000)
// Set to maximize window (expanded to monitor).
+ value FLAG_WINDOW_MAXIMIZED (0x400)
// Set to minimize window (iconify).
+ value FLAG_WINDOW_MINIMIZED (0x200)
// Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED.
+ value FLAG_WINDOW_MOUSE_PASSTHROUGH (0x4000)
// Set to allow resizable window.
+ value FLAG_WINDOW_RESIZABLE (0x4)
// Set to window always on top.
+ value FLAG_WINDOW_TOPMOST (0x1000)
// Set to allow transparent framebuffer.
+ value FLAG_WINDOW_TRANSPARENT (0x10)
// Set to disable window decoration (frame and buttons).
+ value FLAG_WINDOW_UNDECORATED (0x8)
// Set to window non focused.
+ value FLAG_WINDOW_UNFOCUSED (0x800)
// Double tap gesture.
+ value GESTURE_DOUBLETAP (0x2)
// Drag gesture.
+ value GESTURE_DRAG (0x8)
// Hold gesture.
+ value GESTURE_HOLD (0x4)
// No gesture.
+ value GESTURE_NONE (0x0)
// Pinch in gesture.
+ value GESTURE_PINCH_IN (0x100)
// Pinch out gesture.
+ value GESTURE_PINCH_OUT (0x200)
// Swipe down gesture.
+ value GESTURE_SWIPE_DOWN (0x80)
// Swipe left gesture.
+ value GESTURE_SWIPE_LEFT (0x20)
// Swipe right gesture.
+ value GESTURE_SWIPE_RIGHT (0x10)
// Swipe up gesture.
+ value GESTURE_SWIPE_UP (0x40)
// Tap gesture.
+ value GESTURE_TAP (0x1)
// Gold
+ value GOLD (Color{ r: 255, g: 203, b: 0, a: 255 })
// Gray
+ value GRAY (Color{ r: 130, g: 130, b: 130, a: 255 })
// Green
+ value GREEN (Color{ r: 0, g: 228, b: 48, a: 255 })
// Light Gray
+ value LIGHTGRAY (Color{ r: 200, g: 200, b: 200, a: 255 })
// Lime
+ value LIME (Color{ r: 0, g: 158, b: 47, a: 255 })
// Magenta
+ value MAGENTA (Color{ r: 255, g: 0, b: 255, a: 255 })
// Maroon
+ value MAROON (Color{ r: 190, g: 33, b: 55, a: 255 })
// Orange
+ value ORANGE (Color{ r: 255, g: 161, b: 0, a: 255 })
// Pi.
+ value PI (3.14159265358979323846)
// Pink
+ value PINK (Color{ r: 255, g: 109, b: 194, a: 255 })
// Purple
+ value PURPLE (Color{ r: 200, g: 122, b: 255, a: 255 })
alias Quaternion for Vector4
// Multiply radians by this for degrees.
+ value RAD2DEG (180.0 / PI)
// raylib's version, as a string.
+ value RAYLIB_VERSION ("6.0")
// My own White (raylib logo)
+ value RAYWHITE (Color{ r: 245, g: 245, b: 245, a: 255 })
// Red
+ value RED (Color{ r: 230, g: 41, b: 55, a: 255 })
alias RenderTexture2D for RenderTexture
// Sky Blue
+ value SKYBLUE (Color{ r: 102, g: 191, b: 255, a: 255 })
alias Texture2D for Texture
alias TextureCubemap for Texture
// Violet
+ value VIOLET (Color{ r: 135, g: 60, b: 190, a: 255 })
// White
+ value WHITE (Color{ r: 255, g: 255, b: 255, a: 255 })
// Yellow
+ value YELLOW (Color{ r: 253, g: 249, b: 0, a: 255 })
BEIGE
Beige
BLACK
Black
BLANK
Blank (Transparent)
BLUE
Blue
BROWN
Brown
DARKBLUE
Dark Blue
DARKBROWN
Dark Brown
DARKGRAY
Dark Gray
DARKGREEN
Dark Green
DARKPURPLE
Dark Purple
DEG2RAD
Multiply degrees by this for radians.
FLAG_BORDERLESS_WINDOWED_MODE
Set to run program in borderless windowed mode.
FLAG_FULLSCREEN_MODE
Set to run program in fullscreen.
FLAG_INTERLACED_HINT
Set to try enabling interlaced video format (for V3D).
FLAG_MSAA_4X_HINT
Set to try enabling MSAA 4X.
FLAG_VSYNC_HINT
Set to try enabling V-Sync on GPU.
FLAG_WINDOW_ALWAYS_RUN
Set to allow windows running while minimized.
FLAG_WINDOW_HIDDEN
Set to hide window.
FLAG_WINDOW_HIGHDPI
Set to support HighDPI.
FLAG_WINDOW_MAXIMIZED
Set to maximize window (expanded to monitor).
FLAG_WINDOW_MINIMIZED
Set to minimize window (iconify).
FLAG_WINDOW_MOUSE_PASSTHROUGH
Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED.
FLAG_WINDOW_RESIZABLE
Set to allow resizable window.
FLAG_WINDOW_TOPMOST
Set to window always on top.
FLAG_WINDOW_TRANSPARENT
Set to allow transparent framebuffer.
FLAG_WINDOW_UNDECORATED
Set to disable window decoration (frame and buttons).
FLAG_WINDOW_UNFOCUSED
Set to window non focused.
GESTURE_DOUBLETAP
Double tap gesture.
GESTURE_DRAG
Drag gesture.
GESTURE_HOLD
Hold gesture.
GESTURE_NONE
No gesture.
GESTURE_PINCH_IN
Pinch in gesture.
GESTURE_PINCH_OUT
Pinch out gesture.
GESTURE_SWIPE_DOWN
Swipe down gesture.
GESTURE_SWIPE_LEFT
Swipe left gesture.
GESTURE_SWIPE_RIGHT
Swipe right gesture.
GESTURE_SWIPE_UP
Swipe up gesture.
GESTURE_TAP
Tap gesture.
GOLD
Gold
GRAY
Gray
GREEN
Green
LIGHTGRAY
Light Gray
LIME
Lime
MAGENTA
Magenta
MAROON
Maroon
ORANGE
Orange
PI
Pi.
PINK
Pink
PURPLE
Purple
RAD2DEG
Multiply radians by this for degrees.
RAYLIB_VERSION
raylib's version, as a string.
RAYWHITE
My own White (raylib logo)
RED
Red
SKYBLUE
Sky Blue
VIOLET
Violet
WHITE
White
YELLOW
Yellow
Enums for 'main'
// Color blending modes (pre-defined).
+ enum BlendMode : i32 { alpha (0), additive (1), multiplied (2), add_colors (3), subtract_colors (4), alpha_premultiply (5), custom (6), custom_separate (7) }
// Camera system modes.
+ enum CameraMode : i32 { custom (0), free (1), orbital (2), first_person (3), third_person (4) }
// Camera projection.
+ enum CameraProjection : i32 { perspective (0), orthographic (1) }
// Cubemap layouts.
+ enum CubemapLayout : i32 { auto_detect (0), line_vertical (1), line_horizontal (2), cross_three_by_four (3), cross_four_by_three (4) }
// Font type, defines generation method.
+ enum FontType : i32 { default (0), bitmap (1), sdf (2) }
// Gamepad axes.
+ enum GamepadAxis : i32 { left_x (0), left_y (1), right_x (2), right_y (3), left_trigger (4), right_trigger (5) }
// Gamepad buttons.
+ enum GamepadButton : i32 { unknown (0), left_face_up (1), left_face_right (2), left_face_down (3), left_face_left (4), right_face_up (5), right_face_right (6), right_face_down (7), right_face_left (8), left_trigger_1 (9), left_trigger_2 (10), right_trigger_1 (11), right_trigger_2 (12), middle_left (13), middle (14), middle_right (15), left_thumb (16), right_thumb (17) }
// Keyboard keys (US keyboard layout).
+ enum KeyboardKey : i32 { none (0), apostrophe (39), comma (44), minus (45), period (46), slash (47), zero (48), one (49), two (50), three (51), four (52), five (53), six (54), seven (55), eight (56), nine (57), semicolon (59), equal (61), a (65), b (66), c (67), d (68), e (69), f (70), g (71), h (72), i (73), j (74), k (75), l (76), m (77), n (78), o (79), p (80), q (81), r (82), s (83), t (84), u (85), v (86), w (87), x (88), y (89), z (90), left_bracket (91), backslash (92), right_bracket (93), grave (96), space (32), escape (256), enter (257), tab (258), backspace (259), insert (260), delete (261), right (262), left (263), down (264), up (265), page_up (266), page_down (267), home (268), end (269), caps_lock (280), scroll_lock (281), num_lock (282), print_screen (283), pause (284), f1 (290), f2 (291), f3 (292), f4 (293), f5 (294), f6 (295), f7 (296), f8 (297), f9 (298), f10 (299), f11 (300), f12 (301), left_shift (340), left_control (341), left_alt (342), left_super (343), right_shift (344), right_control (345), right_alt (346), right_super (347), kb_menu (348), kp_0 (320), kp_1 (321), kp_2 (322), kp_3 (323), kp_4 (324), kp_5 (325), kp_6 (326), kp_7 (327), kp_8 (328), kp_9 (329), kp_decimal (330), kp_divide (331), kp_multiply (332), kp_subtract (333), kp_add (334), kp_enter (335), kp_equal (336), back (4), menu (5), volume_up (24), volume_down (25) }
// Material map index.
+ enum MaterialMapIndex : i32 { albedo (0), metalness (1), normal (2), roughness (3), occlusion (4), emission (5), height (6), cubemap (7), irradiance (8), prefilter (9), brdf (10) }
// Mouse buttons.
+ enum MouseButton : i32 { left (0), right (1), middle (2), side (3), extra (4), forward (5), back (6) }
// Mouse cursor.
+ enum MouseCursor : i32 { default (0), arrow (1), ibeam (2), crosshair (3), pointing_hand (4), resize_ew (5), resize_ns (6), resize_nwse (7), resize_nesw (8), resize_all (9), not_allowed (10) }
// N-patch layout.
+ enum NPatchLayout : i32 { nine_patch (0), three_patch_vertical (1), three_patch_horizontal (2) }
// Pixel formats.
+ enum PixelFormat : i32 { uncompressed_grayscale (1), uncompressed_gray_alpha (2), uncompressed_r5g6b5 (3), uncompressed_r8g8b8 (4), uncompressed_r5g5b5a1 (5), uncompressed_r4g4b4a4 (6), uncompressed_r8g8b8a8 (7), uncompressed_r32 (8), uncompressed_r32g32b32 (9), uncompressed_r32g32b32a32 (10), uncompressed_r16 (11), uncompressed_r16g16b16 (12), uncompressed_r16g16b16a16 (13), compressed_dxt1_rgb (14), compressed_dxt1_rgba (15), compressed_dxt3_rgba (16), compressed_dxt5_rgba (17), compressed_etc1_rgb (18), compressed_etc2_rgb (19), compressed_etc2_eac_rgba (20), compressed_pvrt_rgb (21), compressed_pvrt_rgba (22), compressed_astc_4x4_rgba (23), compressed_astc_8x8_rgba (24) }
// Shader attribute data types.
+ enum ShaderAttributeDataType : i32 { float (0), vec2 (1), vec3 (2), vec4 (3) }
// Shader location index.
+ enum ShaderLocationIndex : i32 { vertex_position (0), vertex_texcoord01 (1), vertex_texcoord02 (2), vertex_normal (3), vertex_tangent (4), vertex_color (5), matrix_mvp (6), matrix_view (7), matrix_projection (8), matrix_model (9), matrix_normal (10), vector_view (11), color_diffuse (12), color_specular (13), color_ambient (14), map_albedo (15), map_metalness (16), map_normal (17), map_roughness (18), map_occlusion (19), map_emission (20), map_height (21), map_cubemap (22), map_irradiance (23), map_prefilter (24), map_brdf (25), vertex_boneids (26), vertex_boneweights (27), matrix_bonetransforms (28), vertex_instancetransform (29) }
// Shader uniform data type.
+ enum ShaderUniformDataType : i32 { float (0), vec2 (1), vec3 (2), vec4 (3), int (4), ivec2 (5), ivec3 (6), ivec4 (7), uint (8), uivec2 (9), uivec3 (10), uivec4 (11), sampler2d (12) }
// Texture parameters: filter mode.
+ enum TextureFilter : i32 { point (0), bilinear (1), trilinear (2), anisotropic_4x (3), anisotropic_8x (4), anisotropic_16x (5) }
// Texture parameters: wrap mode.
+ enum TextureWrap : i32 { repeat (0), clamp (1), mirror_repeat (2), mirror_clamp (3) }
// Trace log level.
+ enum TraceLogLevel : i32 { all (0), trace (1), debug (2), info (3), warning (4), error (5), fatal (6), none (7) }
BlendMode
Color blending modes (pre-defined).
CameraMode
Camera system modes.
CameraProjection
Camera projection.
CubemapLayout
Cubemap layouts.
FontType
Font type, defines generation method.
GamepadAxis
Gamepad axes.
Gamepad buttons.
KeyboardKey
Keyboard keys (US keyboard layout).
MaterialMapIndex
Material map index.
Mouse buttons.
MouseCursor
Mouse cursor.
NPatchLayout
N-patch layout.
Pixel formats.
ShaderAttributeDataType
Shader attribute data types.
ShaderLocationIndex
Shader location index.
Shader uniform data type.
TextureFilter
Texture parameters: filter mode.
TextureWrap
Texture parameters: wrap mode.
TraceLogLevel
Trace log level.
Functions for 'main'
// Begin blending mode (alpha, additive, multiplied, subtract, custom).
+ fn begin_blend_mode(mode: BlendMode) void
// Setup canvas (framebuffer) to start drawing.
+ fn begin_drawing() void
// Begin 2D mode with custom camera (2D).
+ fn begin_mode_2d(camera: Camera2D) void
// Begin 3D mode with custom camera (3D).
+ fn begin_mode_3d(camera: Camera3D) void
// Begin scissor mode (define screen area for following drawing).
+ fn begin_scissor_mode(x: i32, y: i32, width: i32, height: i32) void
// Begin custom shader drawing.
+ fn begin_shader_mode(shader: Shader) void
// Begin drawing to render texture.
+ fn begin_texture_mode(target: RenderTexture) void
// Begin stereo rendering (requires VR simulator).
+ fn begin_vr_stereo_mode(config: VrStereoConfig) void
// Change working directory, return true on success.
+ fn change_directory(dir_path: String) bool
// Check collision between box and sphere.
+ fn check_collision_box_sphere(box: BoundingBox, center: Vector3, radius: f32) bool
// Check collision between two bounding boxes.
+ fn check_collision_boxes(box1: BoundingBox, box2: BoundingBox) bool
// Check if circle collides with a line created betweeen two points [p1] and [p2].
+ fn check_collision_circle_line(center: Vector2, radius: f32, p1: Vector2, p2: Vector2) bool
// Check collision between circle and rectangle.
+ fn check_collision_circle_rec(center: Vector2, radius: f32, rec: Rectangle) bool
// Check collision between two circles.
+ fn check_collision_circles(center1: Vector2, radius1: f32, center2: Vector2, radius2: f32) bool
// Where two line segments cross, or null when they do not.
+ fn check_collision_lines(start1: Vector2, end1: Vector2, start2: Vector2, end2: Vector2) ?Vector2
// Check if point is inside circle.
+ fn check_collision_point_circle(point: Vector2, center: Vector2, radius: f32) bool
// Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold].
+ fn check_collision_point_line(point: Vector2, p1: Vector2, p2: Vector2, threshold: i32) bool
// Check if point is within a polygon described by array of vertices.
+ fn check_collision_point_poly(point: Vector2, points: local &[Vector2]) bool
// Check if point is inside rectangle.
+ fn check_collision_point_rec(point: Vector2, rec: Rectangle) bool
// Check if point is inside a triangle.
+ fn check_collision_point_triangle(point: Vector2, p1: Vector2, p2: Vector2, p3: Vector2) bool
// Check collision between two rectangles.
+ fn check_collision_recs(rec1: Rectangle, rec2: Rectangle) bool
// Check collision between two spheres.
+ fn check_collision_spheres(center1: Vector3, radius1: f32, center2: Vector3, radius2: f32) bool
// Set background color (framebuffer clear color).
+ fn clear_background(color: Color) void
// Clear window configuration state flags.
+ fn clear_window_state(flags: u32) void
// Close the audio device and context.
+ fn close_audio_device() void
// Close window and unload OpenGL context.
+ fn close_window() void
// Get color with alpha applied, alpha goes from 0.0f to 1.0f.
+ fn color_alpha(color: Color, alpha: f32) Color
// Get src alpha-blended into dst color with tint.
+ fn color_alpha_blend(dst: Color, src: Color, tint: Color) Color
// Get color with brightness correction, brightness factor goes from -1.0f to 1.0f.
+ fn color_brightness(color: Color, factor: f32) Color
// Get color with contrast correction, contrast values between -1.0f and 1.0f.
+ fn color_contrast(color: Color, contrast: f32) Color
// Get a Color from HSV values, hue [0..360], saturation/value [0..1].
+ fn color_from_hsv(hue: f32, saturation: f32, value: f32) Color
// Get Color from normalized values [0..1].
+ fn color_from_normalized(normalized: Vector4) Color
// Check if two colors are equal.
+ fn color_is_equal(col1: Color, col2: Color) bool
// Get color lerp interpolation between two colors, factor [0.0f..1.0f].
+ fn color_lerp(color1: Color, color2: Color, factor: f32) Color
// Get Color normalized as float [0..1].
+ fn color_normalize(color: Color) Vector4
// Get color multiplied with another color.
+ fn color_tint(color: Color, tint: Color) Color
// Get HSV values for a Color, hue [0..360], saturation/value [0..1].
+ fn color_to_hsv(color: Color) Vector3
// Get hexadecimal value for a Color (0xRRGGBBAA).
+ fn color_to_int(color: Color) i32
// Check if a directory path exists.
+ fn directory_exists(dir_path: String) bool
// Disables cursor (lock cursor).
+ fn disable_cursor() void
// Disable waiting for events on EndDrawing(), automatic events polling.
+ fn disable_event_waiting() void
// Draw a billboard texture.
+ fn draw_billboard(camera: Camera3D, texture: Texture, position: Vector3, scale: f32, tint: Color) void
// Draw a billboard texture defined by source and rotation.
+ fn draw_billboard_pro(camera: Camera3D, texture: Texture, source: Rectangle, position: Vector3, up: Vector3, size: Vector2, origin: Vector2, rotation: f32, tint: Color) void
// Draw a billboard texture defined by source.
+ fn draw_billboard_rec(camera: Camera3D, texture: Texture, source: Rectangle, position: Vector3, size: Vector2, tint: Color) void
// Draw bounding box (wires).
+ fn draw_bounding_box(box: BoundingBox, color: Color) void
// Draw a capsule with the center of its sphere caps at startPos and endPos.
+ fn draw_capsule(start_pos: Vector3, end_pos: Vector3, radius: f32, slices: i32, rings: i32, color: Color) void
// Draw capsule wireframe with the center of its sphere caps at startPos and endPos.
+ fn draw_capsule_wires(start_pos: Vector3, end_pos: Vector3, radius: f32, slices: i32, rings: i32, color: Color) void
// Draw a color-filled circle.
+ fn draw_circle(center_x: i32, center_y: i32, radius: f32, color: Color) void
// Draw a circle in 3D world space.
+ fn draw_circle_3d(center: Vector3, radius: f32, rotation_axis: Vector3, rotation_angle: f32, color: Color) void
// Draw a gradient-filled circle.
+ fn draw_circle_gradient(center: Vector2, radius: f32, inner: Color, outer: Color) void
// Draw circle outline.
+ fn draw_circle_lines(center_x: i32, center_y: i32, radius: f32, color: Color) void
// Draw circle outline (Vector version).
+ fn draw_circle_lines_v(center: Vector2, radius: f32, color: Color) void
// Draw a piece of a circle.
+ fn draw_circle_sector(center: Vector2, radius: f32, start_angle: f32, end_angle: f32, segments: i32, color: Color) void
// Draw circle sector outline.
+ fn draw_circle_sector_lines(center: Vector2, radius: f32, start_angle: f32, end_angle: f32, segments: i32, color: Color) void
// Draw a color-filled circle (Vector version).
+ fn draw_circle_v(center: Vector2, radius: f32, color: Color) void
// Draw cube.
+ fn draw_cube(position: Vector3, width: f32, height: f32, length: f32, color: Color) void
// Draw cube (Vector version).
+ fn draw_cube_v(position: Vector3, size: Vector3, color: Color) void
// Draw cube wires.
+ fn draw_cube_wires(position: Vector3, width: f32, height: f32, length: f32, color: Color) void
// Draw cube wires (Vector version).
+ fn draw_cube_wires_v(position: Vector3, size: Vector3, color: Color) void
// Draw a cylinder/cone.
+ fn draw_cylinder(position: Vector3, radius_top: f32, radius_bottom: f32, height: f32, slices: i32, color: Color) void
// Draw a cylinder with base at startPos and top at endPos.
+ fn draw_cylinder_ex(start_pos: Vector3, end_pos: Vector3, start_radius: f32, end_radius: f32, sides: i32, color: Color) void
// Draw a cylinder/cone wires.
+ fn draw_cylinder_wires(position: Vector3, radius_top: f32, radius_bottom: f32, height: f32, slices: i32, color: Color) void
// Draw a cylinder wires with base at startPos and top at endPos.
+ fn draw_cylinder_wires_ex(start_pos: Vector3, end_pos: Vector3, start_radius: f32, end_radius: f32, sides: i32, color: Color) void
// Draw ellipse.
+ fn draw_ellipse(center_x: i32, center_y: i32, radius_h: f32, radius_v: f32, color: Color) void
// Draw ellipse outline.
+ fn draw_ellipse_lines(center_x: i32, center_y: i32, radius_h: f32, radius_v: f32, color: Color) void
// Draw ellipse outline (Vector version).
+ fn draw_ellipse_lines_v(center: Vector2, radius_h: f32, radius_v: f32, color: Color) void
// Draw ellipse (Vector version).
+ fn draw_ellipse_v(center: Vector2, radius_h: f32, radius_v: f32, color: Color) void
// Draw current FPS.
+ fn draw_fps(pos_x: i32, pos_y: i32) void
// Draw a grid (centered at (0, 0, 0)).
+ fn draw_grid(slices: i32, spacing: f32) void
// Draw a line.
+ fn draw_line(start_pos_x: i32, start_pos_y: i32, end_pos_x: i32, end_pos_y: i32, color: Color) void
// Draw a line in 3D world space.
+ fn draw_line_3d(start_pos: Vector3, end_pos: Vector3, color: Color) void
// Draw line segment cubic-bezier in-out interpolation.
+ fn draw_line_bezier(start_pos: Vector2, end_pos: Vector2, thick: f32, color: Color) void
// Draw a dashed line.
+ fn draw_line_dashed(start_pos: Vector2, end_pos: Vector2, dash_size: i32, space_size: i32, color: Color) void
// Draw a line (using triangles/quads).
+ fn draw_line_ex(start_pos: Vector2, end_pos: Vector2, thick: f32, color: Color) void
// Draw lines sequence (using gl lines).
+ fn draw_line_strip(points: local &[Vector2], color: Color) void
// Draw a line (using gl lines).
+ fn draw_line_v(start_pos: Vector2, end_pos: Vector2, color: Color) void
// Draw a 3d mesh with material and transform.
+ fn draw_mesh(mesh: Mesh, material: Material, transform: Matrix) void
// Draw multiple mesh instances with material and different transforms.
+ fn draw_mesh_instanced(mesh: Mesh, material: Material, transforms: local &[Matrix]) void
// Draw a model (with texture if set).
+ fn draw_model(model: Model, position: Vector3, scale: f32, tint: Color) void
// Draw a model with extended parameters.
+ fn draw_model_ex(model: Model, position: Vector3, rotation_axis: Vector3, rotation_angle: f32, scale: Vector3, tint: Color) void
// Draw a model wires (with texture if set).
+ fn draw_model_wires(model: Model, position: Vector3, scale: f32, tint: Color) void
// Draw a model wires (with texture if set) with extended parameters.
+ fn draw_model_wires_ex(model: Model, position: Vector3, rotation_axis: Vector3, rotation_angle: f32, scale: Vector3, tint: Color) void
// Draw a pixel using geometry [Can be slow, use with care].
+ fn draw_pixel(pos_x: i32, pos_y: i32, color: Color) void
// Draw a pixel using geometry (Vector version) [Can be slow, use with care].
+ fn draw_pixel_v(position: Vector2, color: Color) void
// Draw a plane XZ.
+ fn draw_plane(center_pos: Vector3, size: Vector2, color: Color) void
// Draw a point in 3D space, actually a small line.
+ fn draw_point_3d(position: Vector3, color: Color) void
// Draw a regular polygon (Vector version).
+ fn draw_poly(center: Vector2, sides: i32, radius: f32, rotation: f32, color: Color) void
// Draw a polygon outline of n sides.
+ fn draw_poly_lines(center: Vector2, sides: i32, radius: f32, rotation: f32, color: Color) void
// Draw a polygon outline of n sides with extended parameters.
+ fn draw_poly_lines_ex(center: Vector2, sides: i32, radius: f32, rotation: f32, line_thick: f32, color: Color) void
// Draw a ray line.
+ fn draw_ray(ray: Ray, color: Color) void
// Draw a color-filled rectangle.
+ fn draw_rectangle(pos_x: i32, pos_y: i32, width: i32, height: i32, color: Color) void
// Draw a gradient-filled rectangle with custom vertex colors.
+ fn draw_rectangle_gradient_ex(rec: Rectangle, top_left: Color, bottom_left: Color, bottom_right: Color, top_right: Color) void
// Draw a horizontal-gradient-filled rectangle.
+ fn draw_rectangle_gradient_h(pos_x: i32, pos_y: i32, width: i32, height: i32, left: Color, right: Color) void
// Draw a vertical-gradient-filled rectangle.
+ fn draw_rectangle_gradient_v(pos_x: i32, pos_y: i32, width: i32, height: i32, top: Color, bottom: Color) void
// Draw rectangle outline.
+ fn draw_rectangle_lines(pos_x: i32, pos_y: i32, width: i32, height: i32, color: Color) void
// Draw rectangle outline with extended parameters.
+ fn draw_rectangle_lines_ex(rec: Rectangle, line_thick: f32, color: Color) void
// Draw a color-filled rectangle with pro parameters.
+ fn draw_rectangle_pro(rec: Rectangle, origin: Vector2, rotation: f32, color: Color) void
// Draw a color-filled rectangle.
+ fn draw_rectangle_rec(rec: Rectangle, color: Color) void
// Draw rectangle with rounded edges.
+ fn draw_rectangle_rounded(rec: Rectangle, roundness: f32, segments: i32, color: Color) void
// Draw rectangle lines with rounded edges.
+ fn draw_rectangle_rounded_lines(rec: Rectangle, roundness: f32, segments: i32, color: Color) void
// Draw rectangle with rounded edges outline.
+ fn draw_rectangle_rounded_lines_ex(rec: Rectangle, roundness: f32, segments: i32, line_thick: f32, color: Color) void
// Draw a color-filled rectangle (Vector version).
+ fn draw_rectangle_v(position: Vector2, size: Vector2, color: Color) void
// Draw ring.
+ fn draw_ring(center: Vector2, inner_radius: f32, outer_radius: f32, start_angle: f32, end_angle: f32, segments: i32, color: Color) void
// Draw ring outline.
+ fn draw_ring_lines(center: Vector2, inner_radius: f32, outer_radius: f32, start_angle: f32, end_angle: f32, segments: i32, color: Color) void
// Draw sphere.
+ fn draw_sphere(center_pos: Vector3, radius: f32, color: Color) void
// Draw sphere with extended parameters.
+ fn draw_sphere_ex(center_pos: Vector3, radius: f32, rings: i32, slices: i32, color: Color) void
// Draw sphere wires.
+ fn draw_sphere_wires(center_pos: Vector3, radius: f32, rings: i32, slices: i32, color: Color) void
// Draw spline: B-Spline, minimum 4 points.
+ fn draw_spline_basis(points: local &[Vector2], thick: f32, color: Color) void
// Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...].
+ fn draw_spline_bezier_cubic(points: local &[Vector2], thick: f32, color: Color) void
// Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...].
+ fn draw_spline_bezier_quadratic(points: local &[Vector2], thick: f32, color: Color) void
// Draw spline: Catmull-Rom, minimum 4 points.
+ fn draw_spline_catmull_rom(points: local &[Vector2], thick: f32, color: Color) void
// Draw spline: Linear, minimum 2 points.
+ fn draw_spline_linear(points: local &[Vector2], thick: f32, color: Color) void
// Draw spline segment: B-Spline, 4 points.
+ fn draw_spline_segment_basis(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: f32, color: Color) void
// Draw spline segment: Cubic Bezier, 2 points, 2 control points.
+ fn draw_spline_segment_bezier_cubic(p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, thick: f32, color: Color) void
// Draw spline segment: Quadratic Bezier, 2 points, 1 control point.
+ fn draw_spline_segment_bezier_quadratic(p1: Vector2, c2: Vector2, p3: Vector2, thick: f32, color: Color) void
// Draw spline segment: Catmull-Rom, 4 points.
+ fn draw_spline_segment_catmull_rom(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: f32, color: Color) void
// Draw spline segment: Linear, 2 points.
+ fn draw_spline_segment_linear(p1: Vector2, p2: Vector2, thick: f32, color: Color) void
// Draw text (using default font).
+ fn draw_text(text: String, pos_x: i32, pos_y: i32, font_size: i32, color: Color) void
// Draw one character (codepoint).
+ fn draw_text_codepoint(font: Font, codepoint: i32, position: Vector2, font_size: f32, tint: Color) void
// Draw multiple character (codepoint).
+ fn draw_text_codepoints(font: Font, codepoints: local &[i32], position: Vector2, font_size: f32, spacing: f32, tint: Color) void
// Draw text using font and additional parameters.
+ fn draw_text_ex(font: Font, text: String, position: Vector2, font_size: f32, spacing: f32, tint: Color) void
// Draw text using Font and pro parameters (rotation).
+ fn draw_text_pro(font: Font, text: String, position: Vector2, origin: Vector2, rotation: f32, font_size: f32, spacing: f32, tint: Color) void
// Draw a Texture2D.
+ fn draw_texture(texture: Texture, pos_x: i32, pos_y: i32, tint: Color) void
// Draw a Texture2D with extended parameters.
+ fn draw_texture_ex(texture: Texture, position: Vector2, rotation: f32, scale: f32, tint: Color) void
// Draws a texture (or part of it) that stretches or shrinks nicely.
+ fn draw_texture_n_patch(texture: Texture, n_patch_info: NPatchInfo, dest: Rectangle, origin: Vector2, rotation: f32, tint: Color) void
// Draw a part of a texture defined by a rectangle with 'pro' parameters.
+ fn draw_texture_pro(texture: Texture, source: Rectangle, dest: Rectangle, origin: Vector2, rotation: f32, tint: Color) void
// Draw a part of a texture defined by a rectangle.
+ fn draw_texture_rec(texture: Texture, source: Rectangle, position: Vector2, tint: Color) void
// Draw a Texture2D with position defined as Vector2.
+ fn draw_texture_v(texture: Texture, position: Vector2, tint: Color) void
// Draw a color-filled triangle (vertex in counter-clockwise order!).
+ fn draw_triangle(v1: Vector2, v2: Vector2, v3: Vector2, color: Color) void
// Draw a color-filled triangle (vertex in counter-clockwise order!).
+ fn draw_triangle_3d(v1: Vector3, v2: Vector3, v3: Vector3, color: Color) void
// Draw a triangle fan defined by points (first vertex is the center).
+ fn draw_triangle_fan(points: local &[Vector2], color: Color) void
// Draw triangle outline (vertex in counter-clockwise order!).
+ fn draw_triangle_lines(v1: Vector2, v2: Vector2, v3: Vector2, color: Color) void
// Draw a triangle strip defined by points.
+ fn draw_triangle_strip(points: local &[Vector2], color: Color) void
// Draw a triangle strip defined by points.
+ fn draw_triangle_strip_3d(points: local &[Vector3], color: Color) void
// Enables cursor (unlock cursor).
+ fn enable_cursor() void
// Enable waiting for events on EndDrawing(), no automatic event polling.
+ fn enable_event_waiting() void
// End blending mode (reset to default: alpha blending).
+ fn end_blend_mode() void
// End canvas drawing and swap buffers (double buffering).
+ fn end_drawing() void
// Ends 2D mode with custom camera.
+ fn end_mode_2d() void
// Ends 3D mode and returns to default 2D orthographic mode.
+ fn end_mode_3d() void
// End scissor mode.
+ fn end_scissor_mode() void
// End custom shader drawing (use default shader).
+ fn end_shader_mode() void
// Ends drawing to render texture.
+ fn end_texture_mode() void
// End stereo rendering (requires VR simulator).
+ fn end_vr_stereo_mode() void
// Export automation events list as text file.
+ fn export_automation_event_list(list: AutomationEventList, file_name: String) bool
// Export font as code file, returns true on success.
+ fn export_font_as_code(font: Font, file_name: String) bool
// Export image data to file, returns true on success.
+ fn export_image(image: Image, file_name: String) bool
// Export image as code file defining an array of bytes, returns true on success.
+ fn export_image_as_code(image: Image, file_name: String) bool
// Export mesh data to file, returns true on success.
+ fn export_mesh(mesh: Mesh, file_name: String) bool
// Export mesh as code file (.h) defining multiple arrays of vertex attributes.
+ fn export_mesh_as_code(mesh: Mesh, file_name: String) bool
// Export wave data to file, returns true on success.
+ fn export_wave(wave: Wave, file_name: String) bool
// Export wave sample data to code (.h), returns true on success.
+ fn export_wave_as_code(wave: Wave, file_name: String) bool
// Get color with alpha applied, alpha goes from 0.0f to 1.0f.
+ fn fade(color: Color, alpha: f32) Color
// Copy file from one path to another, dstPath created if it doesn't exist.
+ fn file_copy(src_path: String, dst_path: String) i32
// Check if file exists.
+ fn file_exists(file_name: String) bool
// Move file from one directory to another, dstPath created if it doesn't exist.
+ fn file_move(src_path: String, dst_path: String) i32
// Remove file (if exists).
+ fn file_remove(file_name: String) i32
// Rename file (if exists).
+ fn file_rename(file_name: String, file_rename: String) i32
// Find text in existing file.
+ fn file_text_find_index(file_name: String, search: String) i32
// Replace text in an existing file.
+ fn file_text_replace(file_name: String, search: String, replacement: String) i32
// Generate image: cellular algorithm, bigger tileSize means bigger cells.
+ fn gen_image_cellular(width: i32, height: i32, tile_size: i32) Image
// Generate image: checked.
+ fn gen_image_checked(width: i32, height: i32, checks_x: i32, checks_y: i32, col1: Color, col2: Color) Image
// Generate image: plain color.
+ fn gen_image_color(width: i32, height: i32, color: Color) Image
// Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient.
+ fn gen_image_gradient_linear(width: i32, height: i32, direction: i32, start: Color, end: Color) Image
// Generate image: radial gradient.
+ fn gen_image_gradient_radial(width: i32, height: i32, density: f32, inner: Color, outer: Color) Image
// Generate image: square gradient.
+ fn gen_image_gradient_square(width: i32, height: i32, density: f32, inner: Color, outer: Color) Image
// Generate image: perlin noise.
+ fn gen_image_perlin_noise(width: i32, height: i32, offset_x: i32, offset_y: i32, scale: f32) Image
// Generate image: grayscale image from text data.
+ fn gen_image_text(width: i32, height: i32, text: String) Image
// Generate image: white noise.
+ fn gen_image_white_noise(width: i32, height: i32, factor: f32) Image
// Generate cone/pyramid mesh.
+ fn gen_mesh_cone(radius: f32, height: f32, slices: i32) Mesh
// Generate cuboid mesh.
+ fn gen_mesh_cube(width: f32, height: f32, length: f32) Mesh
// Generate cubes-based map mesh from image data.
+ fn gen_mesh_cubicmap(cubicmap: Image, cube_size: Vector3) Mesh
// Generate cylinder mesh.
+ fn gen_mesh_cylinder(radius: f32, height: f32, slices: i32) Mesh
// Generate heightmap mesh from image data.
+ fn gen_mesh_heightmap(heightmap: Image, size: Vector3) Mesh
// Generate half-sphere mesh (no bottom cap).
+ fn gen_mesh_hemi_sphere(radius: f32, rings: i32, slices: i32) Mesh
// Generate trefoil knot mesh.
+ fn gen_mesh_knot(radius: f32, size: f32, rad_seg: i32, sides: i32) Mesh
// Generate plane mesh (with subdivisions).
+ fn gen_mesh_plane(width: f32, length: f32, res_x: i32, res_z: i32) Mesh
// Generate polygonal mesh.
+ fn gen_mesh_poly(sides: i32, radius: f32) Mesh
// Generate sphere mesh (standard sphere).
+ fn gen_mesh_sphere(radius: f32, rings: i32, slices: i32) Mesh
// Generate torus mesh.
+ fn gen_mesh_torus(radius: f32, size: f32, rad_seg: i32, sides: i32) Mesh
// Get the directory of the running application (uses static string).
+ fn get_application_directory() String
// Get camera transform matrix (view matrix).
+ fn get_camera_matrix(camera: Camera3D) Matrix
// Get camera 2d transform matrix.
+ fn get_camera_matrix_2d(camera: Camera2D) Matrix
// Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty.
+ fn get_char_pressed() i32
// Get clipboard image content.
+ fn get_clipboard_image() Image
// Get clipboard text content.
+ fn get_clipboard_text() String
// Get collision rectangle for two rectangles collision.
+ fn get_collision_rec(rec1: Rectangle, rec2: Rectangle) Rectangle
// Get Color structure from hexadecimal value.
+ fn get_color(hex_value: u32) Color
// Get current monitor where window is placed.
+ fn get_current_monitor() i32
// Get the file count in a directory.
+ fn get_directory_file_count(dir_path: String) u32
// 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.
+ fn get_directory_file_count_ex(base_path: String, filter: String, scan_subdirs: bool) u32
// Get full path for a given fileName with path (uses static string).
+ fn get_directory_path(file_path: String) String
// Get pointer to extension for a filename string (includes dot: '.png').
+ fn get_file_extension(file_name: String) String
// Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h).
+ fn get_file_length(file_name: String) i32
// Get pointer to filename for a path string.
+ fn get_file_name(file_path: String) String
// Get filename string without extension (uses static string).
+ fn get_file_name_without_ext(file_path: String) String
// Get the default Font.
+ fn get_font_default() Font
// Get current FPS.
+ fn get_fps() i32
// Get time in seconds for last frame drawn (delta time).
+ fn get_frame_time() f32
// Get axis count for a gamepad.
+ fn get_gamepad_axis_count(gamepad: i32) i32
// Get movement value for a gamepad axis.
+ fn get_gamepad_axis_movement(gamepad: i32, axis: GamepadAxis) f32
// Get the last gamepad button pressed.
+ fn get_gamepad_button_pressed() i32
// Get gamepad internal name id.
+ fn get_gamepad_name(gamepad: i32) String
// Get latest detected gesture.
+ fn get_gesture_detected() i32
// Get gesture drag angle.
+ fn get_gesture_drag_angle() f32
// Get gesture drag vector.
+ fn get_gesture_drag_vector() Vector2
// Get gesture hold time in seconds.
+ fn get_gesture_hold_duration() f32
// Get gesture pinch angle.
+ fn get_gesture_pinch_angle() f32
// Get gesture pinch delta.
+ fn get_gesture_pinch_vector() Vector2
// Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found.
+ fn get_glyph_atlas_rec(font: Font, codepoint: i32) Rectangle
// Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found.
+ fn get_glyph_index(font: Font, codepoint: i32) i32
// Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found.
+ fn get_glyph_info(font: Font, codepoint: i32) GlyphInfo
// Get image alpha border rectangle.
+ fn get_image_alpha_border(image: Image, threshold: f32) Rectangle
// Get image pixel color at (x, y) position.
+ fn get_image_color(image: Image, x: i32, y: i32) Color
// Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard).
+ fn get_key_name(key: KeyboardKey) String
// Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty.
+ fn get_key_pressed() i32
// Get master volume (listener).
+ fn get_master_volume() f32
// Compute mesh bounding box limits.
+ fn get_mesh_bounding_box(mesh: Mesh) BoundingBox
// Compute model bounding box limits (considers all meshes).
+ fn get_model_bounding_box(model: Model) BoundingBox
// Get number of connected monitors.
+ fn get_monitor_count() i32
// Get specified monitor height (current video mode used by monitor).
+ fn get_monitor_height(monitor: i32) i32
// Get the human-readable, UTF-8 encoded name of the specified monitor.
+ fn get_monitor_name(monitor: i32) String
// Get specified monitor physical height in millimetres.
+ fn get_monitor_physical_height(monitor: i32) i32
// Get specified monitor physical width in millimetres.
+ fn get_monitor_physical_width(monitor: i32) i32
// Get specified monitor position.
+ fn get_monitor_position(monitor: i32) Vector2
// Get specified monitor refresh rate.
+ fn get_monitor_refresh_rate(monitor: i32) i32
// Get specified monitor width (current video mode used by monitor).
+ fn get_monitor_width(monitor: i32) i32
// Get mouse delta between frames.
+ fn get_mouse_delta() Vector2
// Get mouse position XY.
+ fn get_mouse_position() Vector2
// Get mouse wheel movement for X or Y, whichever is larger.
+ fn get_mouse_wheel_move() f32
// Get mouse wheel movement for both X and Y.
+ fn get_mouse_wheel_move_v() Vector2
// Get mouse position X.
+ fn get_mouse_x() i32
// Get mouse position Y.
+ fn get_mouse_y() i32
// Get music time length (in seconds).
+ fn get_music_time_length(music: Music) f32
// Get current music time played (in seconds).
+ fn get_music_time_played(music: Music) f32
// Get pixel data size in bytes for certain format.
+ fn get_pixel_data_size(width: i32, height: i32, format: PixelFormat) i32
// Get previous directory path for a given path (uses static string).
+ fn get_prev_directory_path(dir_path: String) String
// Get a random value between min and max (both included).
+ fn get_random_value(min: i32, max: i32) i32
// Get collision info between ray and box.
+ fn get_ray_collision_box(ray: Ray, box: BoundingBox) RayCollision
// Get collision info between ray and mesh.
+ fn get_ray_collision_mesh(ray: Ray, mesh: Mesh, transform: Matrix) RayCollision
// Get collision info between ray and quad.
+ fn get_ray_collision_quad(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3, p4: Vector3) RayCollision
// Get collision info between ray and sphere.
+ fn get_ray_collision_sphere(ray: Ray, center: Vector3, radius: f32) RayCollision
// Get collision info between ray and triangle.
+ fn get_ray_collision_triangle(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3) RayCollision
// Get current render height (it considers HiDPI).
+ fn get_render_height() i32
// Get current render width (it considers HiDPI).
+ fn get_render_width() i32
// Get current screen height.
+ fn get_screen_height() i32
// Get the world space position for a 2d camera screen space position.
+ fn get_screen_to_world_2d(position: Vector2, camera: Camera2D) Vector2
// Get a ray trace from screen position (i.e mouse).
+ fn get_screen_to_world_ray(position: Vector2, camera: Camera3D) Ray
// Get a ray trace from screen position (i.e mouse) in a viewport.
+ fn get_screen_to_world_ray_ex(position: Vector2, camera: Camera3D, width: i32, height: i32) Ray
// Get current screen width.
+ fn get_screen_width() i32
// Get shader uniform location.
+ fn get_shader_location(shader: Shader, uniform_name: String) i32
// Get shader attribute location.
+ fn get_shader_location_attrib(shader: Shader, attrib_name: String) i32
// Get texture that is used for shapes drawing.
+ fn get_shapes_texture() Texture
// Get texture source rectangle that is used for shapes drawing.
+ fn get_shapes_texture_rectangle() Rectangle
// Get (evaluate) spline point: B-Spline.
+ fn get_spline_point_basis(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: f32) Vector2
// Get (evaluate) spline point: Cubic Bezier.
+ fn get_spline_point_bezier_cubic(p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, t: f32) Vector2
// Get (evaluate) spline point: Quadratic Bezier.
+ fn get_spline_point_bezier_quad(p1: Vector2, c2: Vector2, p3: Vector2, t: f32) Vector2
// Get (evaluate) spline point: Catmull-Rom.
+ fn get_spline_point_catmull_rom(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: f32) Vector2
// Get (evaluate) spline point: Linear.
+ fn get_spline_point_linear(start_pos: Vector2, end_pos: Vector2, t: f32) Vector2
// Get elapsed time in seconds since InitWindow().
+ fn get_time() f64
// Get number of touch points.
+ fn get_touch_point_count() i32
// Get touch point identifier for given index.
+ fn get_touch_point_id(index: i32) i32
// Get touch position XY for a touch point index (relative to screen size).
+ fn get_touch_position(index: i32) Vector2
// Get touch position X for touch point 0 (relative to screen size).
+ fn get_touch_x() i32
// Get touch position Y for touch point 0 (relative to screen size).
+ fn get_touch_y() i32
// Get window position XY on monitor.
+ fn get_window_position() Vector2
// Get window scale DPI factor.
+ fn get_window_scale_dpi() Vector2
// Get current working directory (uses static string).
+ fn get_working_directory() String
// Get the screen space position for a 3d world space position.
+ fn get_world_to_screen(position: Vector3, camera: Camera3D) Vector2
// Get the screen space position for a 2d camera world space position.
+ fn get_world_to_screen_2d(position: Vector2, camera: Camera2D) Vector2
// Get size position for a 3d world space position.
+ fn get_world_to_screen_ex(position: Vector3, camera: Camera3D, width: i32, height: i32) Vector2
// Hides cursor.
+ fn hide_cursor() void
// Create an image duplicate (useful for transformations).
+ fn image_copy(image: Image) Image
// Create an image from a selected channel of another image (GRAYSCALE).
+ fn image_from_channel(image: Image, selected_channel: i32) Image
// Create an image from another image piece.
+ fn image_from_image(image: Image, rec: Rectangle) Image
// Create an image from text (default font).
+ fn image_text(text: String, font_size: i32, color: Color) Image
// Create an image from text (custom sprite font).
+ fn image_text_ex(font: Font, text: String, font_size: f32, spacing: f32, tint: Color) Image
// Initialize audio device and context.
+ fn init_audio_device() void
// Initialize window and OpenGL context.
+ fn init_window(width: i32, height: i32, title: String) void
// Check if audio device has been initialized successfully.
+ fn is_audio_device_ready() bool
// Check if audio stream is playing.
+ fn is_audio_stream_playing(stream: AudioStream) bool
// Check if any audio stream buffers requires refill.
+ fn is_audio_stream_processed(stream: AudioStream) bool
// Checks if an audio stream is valid (buffers initialized).
+ fn is_audio_stream_valid(stream: AudioStream) bool
// Check if cursor is not visible.
+ fn is_cursor_hidden() bool
// Check if cursor is on the screen.
+ fn is_cursor_on_screen() bool
// Check if a file has been dropped into window.
+ fn is_file_dropped() bool
// Check file extension (recommended include point: .png, .wav).
+ fn is_file_extension(file_name: String, ext: String) bool
// Check if fileName is valid for the platform/OS.
+ fn is_file_name_valid(file_name: String) bool
// Check if a font is valid (font data loaded, WARNING: GPU texture not checked).
+ fn is_font_valid(font: Font) bool
// Check if a gamepad is available.
+ fn is_gamepad_available(gamepad: i32) bool
// Check if a gamepad button is being pressed.
+ fn is_gamepad_button_down(gamepad: i32, button: GamepadButton) bool
// Check if a gamepad button has been pressed once.
+ fn is_gamepad_button_pressed(gamepad: i32, button: GamepadButton) bool
// Check if a gamepad button has been released once.
+ fn is_gamepad_button_released(gamepad: i32, button: GamepadButton) bool
// Check if a gamepad button is NOT being pressed.
+ fn is_gamepad_button_up(gamepad: i32, button: GamepadButton) bool
// Check if a gesture have been detected.
+ fn is_gesture_detected(gesture: u32) bool
// Check if an image is valid (data and parameters).
+ fn is_image_valid(image: Image) bool
// Check if a key is being pressed.
+ fn is_key_down(key: KeyboardKey) bool
// Check if a key has been pressed once.
+ fn is_key_pressed(key: KeyboardKey) bool
// Check if a key has been pressed again.
+ fn is_key_pressed_repeat(key: KeyboardKey) bool
// Check if a key has been released once.
+ fn is_key_released(key: KeyboardKey) bool
// Check if a key is NOT being pressed.
+ fn is_key_up(key: KeyboardKey) bool
// Check if a material is valid (shader assigned, map textures loaded in GPU).
+ fn is_material_valid(material: Material) bool
// Check model animation skeleton match.
+ fn is_model_animation_valid(model: Model, anim: ModelAnimation) bool
// Check if a model is valid (loaded in GPU, VAO/VBOs).
+ fn is_model_valid(model: Model) bool
// Check if a mouse button is being pressed.
+ fn is_mouse_button_down(button: MouseButton) bool
// Check if a mouse button has been pressed once.
+ fn is_mouse_button_pressed(button: MouseButton) bool
// Check if a mouse button has been released once.
+ fn is_mouse_button_released(button: MouseButton) bool
// Check if a mouse button is NOT being pressed.
+ fn is_mouse_button_up(button: MouseButton) bool
// Check if music is playing.
+ fn is_music_stream_playing(music: Music) bool
// Checks if a music stream is valid (context and buffers initialized).
+ fn is_music_valid(music: Music) bool
// Check if a given path is a file or a directory.
+ fn is_path_file(path: String) bool
// Check if a render texture is valid (loaded in GPU).
+ fn is_render_texture_valid(target: RenderTexture) bool
// Check if a shader is valid (loaded on GPU).
+ fn is_shader_valid(shader: Shader) bool
// Check if a sound is currently playing.
+ fn is_sound_playing(sound: Sound) bool
// Checks if a sound is valid (data loaded and buffers initialized).
+ fn is_sound_valid(sound: Sound) bool
// Check if a texture is valid (loaded in GPU).
+ fn is_texture_valid(texture: Texture) bool
// Checks if wave data is valid (data loaded and parameters).
+ fn is_wave_valid(wave: Wave) bool
// Check if window is currently focused.
+ fn is_window_focused() bool
// Check if window is currently fullscreen.
+ fn is_window_fullscreen() bool
// Check if window is currently hidden.
+ fn is_window_hidden() bool
// Check if window is currently maximized.
+ fn is_window_maximized() bool
// Check if window is currently minimized.
+ fn is_window_minimized() bool
// Check if window has been initialized successfully.
+ fn is_window_ready() bool
// Check if window has been resized last frame.
+ fn is_window_resized() bool
// Check if one specific window flag is enabled.
+ fn is_window_state(flag: u32) bool
// Load audio stream (to stream raw audio pcm data).
+ fn load_audio_stream(sample_rate: u32, sample_size: u32, channels: u32) AudioStream
// Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS.
+ fn load_automation_event_list(file_name: String) AutomationEventList
// Load directory filepaths, files and directories, no subdirs scan.
+ fn load_directory_files(dir_path: String) FilePathList
// Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*".
+ fn load_directory_files_ex(base_path: String, filter: String, scan_subdirs: bool) FilePathList
// Load dropped filepaths.
+ fn load_dropped_files() FilePathList
// Load font from file into GPU memory (VRAM).
+ fn load_font(file_name: String) Font
// Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height.
+ fn load_font_ex(file_name: String, font_size: i32, codepoints: local &[i32]) Font
// Load font from Image (XNA style).
+ fn load_font_from_image(image: Image, key: Color, first_char: i32) Font
// Load image from file into CPU memory (RAM).
+ fn load_image(file_name: String) Image
// Every pixel of an image as a color, row by row.
+ fn load_image_colors(image: Image) Array[Color]
// Load image from screen buffer and (screenshot).
+ fn load_image_from_screen() Image
// Load image from GPU texture data.
+ fn load_image_from_texture(texture: Texture) Image
// Load image from RAW file data.
+ fn load_image_raw(file_name: String, width: i32, height: i32, format: PixelFormat, header_size: i32) Image
// Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps).
+ fn load_material_default() Material
// Load model from files (meshes and materials).
+ fn load_model(file_name: String) Model
// Load model from generated mesh (default material).
+ fn load_model_from_mesh(mesh: Mesh) Model
// Load music stream from file.
+ fn load_music_stream(file_name: String) Music
// Load texture for rendering (framebuffer).
+ fn load_render_texture(width: i32, height: i32) RenderTexture
// Load shader from files and bind default locations.
+ fn load_shader(vs_file_name: String, fs_file_name: String) Shader
// Load shader from code strings and bind default locations.
+ fn load_shader_from_memory(vs_code: String, fs_code: String) Shader
// Load sound from file.
+ fn load_sound(file_name: String) Sound
// Create a new sound that shares the same sample data as the source sound, does not own the sound data.
+ fn load_sound_alias(source: Sound) Sound
// Load sound from wave data.
+ fn load_sound_from_wave(wave: Wave) Sound
// Load texture from file into GPU memory (VRAM).
+ fn load_texture(file_name: String) Texture
// Load cubemap from image, multiple image cubemap layouts supported.
+ fn load_texture_cubemap(image: Image, layout: CubemapLayout) Texture
// Load texture from image data.
+ fn load_texture_from_image(image: Image) Texture
// Load VR stereo config for VR simulator device parameters.
+ fn load_vr_stereo_config(device: VrDeviceInfo) VrStereoConfig
// Load wave data from file.
+ fn load_wave(file_name: String) Wave
// Create directories (including full path requested), returns 0 on success.
+ fn make_directory(dir_path: String) i32
// Set window state: maximized, if resizable.
+ fn maximize_window() void
// Measure string width for default font.
+ fn measure_text(text: String, font_size: i32) i32
// Measure string size for Font.
+ fn measure_text_ex(font: Font, text: String, font_size: f32, spacing: f32) Vector2
// Set window state: minimized, if resizable.
+ fn minimize_window() void
// Open URL with default system browser (if available).
+ fn open_url(url: String) void
// Pause audio stream.
+ fn pause_audio_stream(stream: AudioStream) void
// Pause music playing.
+ fn pause_music_stream(music: Music) void
// Pause a sound.
+ fn pause_sound(sound: Sound) void
// Play audio stream.
+ fn play_audio_stream(stream: AudioStream) void
// Play a recorded automation event.
+ fn play_automation_event(event: AutomationEvent) void
// Start music playing.
+ fn play_music_stream(music: Music) void
// Play a sound.
+ fn play_sound(sound: Sound) void
// Register all input events.
+ fn poll_input_events() void
// Restore window from being minimized/maximized.
+ fn restore_window() void
// Resume audio stream.
+ fn resume_audio_stream(stream: AudioStream) void
// Resume playing paused music.
+ fn resume_music_stream(music: Music) void
// Resume a paused sound.
+ fn resume_sound(sound: Sound) void
// Save text data to file (write), string must be '\0' terminated, returns true on success.
+ fn save_file_text(file_name: String, text: String) bool
// Seek music to a position (in seconds).
+ fn seek_music_stream(music: Music, position: f32) void
// Default size for new audio streams.
+ fn set_audio_stream_buffer_size_default(size: i32) void
// Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered).
+ fn set_audio_stream_pan(stream: AudioStream, pan: f32) void
// Set pitch for audio stream (1.0 is base level).
+ fn set_audio_stream_pitch(stream: AudioStream, pitch: f32) void
// Set volume for audio stream (1.0 is max level).
+ fn set_audio_stream_volume(stream: AudioStream, volume: f32) void
// Set automation event internal base frame to start recording.
+ fn set_automation_event_base_frame(frame: i32) void
// Set clipboard text content.
+ fn set_clipboard_text(text: String) void
// Setup init configuration flags (view FLAGS).
+ fn set_config_flags(flags: u32) void
// Set a custom key to exit program (default is ESC).
+ fn set_exit_key(key: KeyboardKey) void
// Set internal gamepad mappings (SDL_GameControllerDB).
+ fn set_gamepad_mappings(mappings: String) i32
// Set gamepad vibration for both motors (duration in seconds).
+ fn set_gamepad_vibration(gamepad: i32, left_motor: f32, right_motor: f32, duration: f32) void
// Enable a set of gestures using flags.
+ fn set_gestures_enabled(flags: u32) void
// Set master volume (listener).
+ fn set_master_volume(volume: f32) void
// Set mouse cursor.
+ fn set_mouse_cursor(cursor: MouseCursor) void
// Set mouse offset.
+ fn set_mouse_offset(offset_x: i32, offset_y: i32) void
// Set mouse position XY.
+ fn set_mouse_position(x: i32, y: i32) void
// Set mouse scaling.
+ fn set_mouse_scale(scale_x: f32, scale_y: f32) void
// Set pan for a music (-1.0 left, 0.0 center, 1.0 right).
+ fn set_music_pan(music: Music, pan: f32) void
// Set pitch for a music (1.0 is base level).
+ fn set_music_pitch(music: Music, pitch: f32) void
// Set volume for music (1.0 is max level).
+ fn set_music_volume(music: Music, volume: f32) void
// Set the seed for the random number generator.
+ fn set_random_seed(seed: u32) void
// Set shader uniform value (matrix 4x4).
+ fn set_shader_value_matrix(shader: Shader, loc_index: i32, mat: Matrix) void
// Set shader uniform value and bind the texture (sampler2d).
+ fn set_shader_value_texture(shader: Shader, loc_index: i32, texture: Texture) void
// Set texture and rectangle to be used on shapes drawing.
+ fn set_shapes_texture(texture: Texture, source: Rectangle) void
// Set pan for a sound (-1.0 left, 0.0 center, 1.0 right).
+ fn set_sound_pan(sound: Sound, pan: f32) void
// Set pitch for a sound (1.0 is base level).
+ fn set_sound_pitch(sound: Sound, pitch: f32) void
// Set volume for a sound (1.0 is max level).
+ fn set_sound_volume(sound: Sound, volume: f32) void
// Set target FPS (maximum).
+ fn set_target_fps(fps: i32) void
// Set vertical line spacing when drawing with line-breaks.
+ fn set_text_line_spacing(spacing: i32) void
// Set texture scaling filter mode.
+ fn set_texture_filter(texture: Texture, filter: TextureFilter) void
// Set texture wrapping mode.
+ fn set_texture_wrap(texture: Texture, wrap: TextureWrap) void
// Set the current threshold (minimum) log level.
+ fn set_trace_log_level(log_level: TraceLogLevel) void
// Set window focused.
+ fn set_window_focused() void
// Set icon for window (single image, RGBA 32bit).
+ fn set_window_icon(image: Image) void
// Set icon for window (multiple images, RGBA 32bit).
+ fn set_window_icons(images: local &[Image]) void
// Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE).
+ fn set_window_max_size(width: i32, height: i32) void
// Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE).
+ fn set_window_min_size(width: i32, height: i32) void
// Set monitor for the current window.
+ fn set_window_monitor(monitor: i32) void
// Set window opacity [0.0f..1.0f].
+ fn set_window_opacity(opacity: f32) void
// Set window position on screen.
+ fn set_window_position(x: i32, y: i32) void
// Set window dimensions.
+ fn set_window_size(width: i32, height: i32) void
// Set window configuration state using flags.
+ fn set_window_state(flags: u32) void
// Set title for window.
+ fn set_window_title(title: String) void
// Shows cursor.
+ fn show_cursor() void
// Start recording automation events (AutomationEventList must be set).
+ fn start_automation_event_recording() void
// Stop audio stream.
+ fn stop_audio_stream(stream: AudioStream) void
// Stop recording automation events.
+ fn stop_automation_event_recording() void
// Stop music playing.
+ fn stop_music_stream(music: Music) void
// Stop playing a sound.
+ fn stop_sound(sound: Sound) void
// Swap back buffer with front buffer (screen drawing).
+ fn swap_screen_buffer() void
// Takes a screenshot of current screen (filename extension defines format).
+ fn take_screenshot(file_name: String) void
// Toggle window state: borderless windowed, resizes window to match monitor resolution.
+ fn toggle_borderless_windowed() void
// Toggle window state: fullscreen/windowed, resizes monitor to match window resolution.
+ fn toggle_fullscreen() void
// Unload audio stream and free memory.
+ fn unload_audio_stream(stream: AudioStream) void
// Unload automation events list from file.
+ fn unload_automation_event_list(list: AutomationEventList) void
// Unload filepaths.
+ fn unload_directory_files(files: FilePathList) void
// Unload dropped filepaths.
+ fn unload_dropped_files(files: FilePathList) void
// Unload font from GPU memory (VRAM).
+ fn unload_font(font: Font) void
// Unload font chars info data (RAM).
+ fn unload_font_data(glyphs: local &[GlyphInfo]) void
// Unload image from CPU memory (RAM).
+ fn unload_image(image: Image) void
// Unload material from GPU memory (VRAM).
+ fn unload_material(material: Material) void
// Unload mesh data from CPU and GPU.
+ fn unload_mesh(mesh: Mesh) void
// Unload model (including meshes) from memory (RAM and/or VRAM).
+ fn unload_model(model: Model) void
// Unload animation array data.
+ fn unload_model_animations(animations: local &[ModelAnimation]) void
// Unload music stream.
+ fn unload_music_stream(music: Music) void
// Unload render texture from GPU memory (VRAM).
+ fn unload_render_texture(target: RenderTexture) void
// Unload shader from GPU memory (VRAM).
+ fn unload_shader(shader: Shader) void
// Unload sound.
+ fn unload_sound(sound: Sound) void
// Unload a sound alias (does not deallocate sample data).
+ fn unload_sound_alias(alias: Sound) void
// Unload texture from GPU memory (VRAM).
+ fn unload_texture(texture: Texture) void
// Unload VR stereo config.
+ fn unload_vr_stereo_config(config: VrStereoConfig) void
// Unload wave data.
+ fn unload_wave(wave: Wave) void
// Update model animation pose (vertex buffers and bone matrices).
+ fn update_model_animation(model: Model, anim: ModelAnimation, frame: f32) void
// Update model animation pose, blending two animations.
+ fn update_model_animation_ex(model: Model, anim_a: ModelAnimation, frame_a: f32, anim_b: ModelAnimation, frame_b: f32, blend: f32) void
// Updates buffers for music streaming.
+ fn update_music_stream(music: Music) void
// Replaces the pixels of an RGBA texture (`PixelFormat.uncompressed_r8g8b8a8`), row by row. Panics when the texture has another format or `pixels` is not `width * height` long.
+ fn update_texture(texture: Texture, pixels: local &[Color]) void
// Wait for some time (halt program execution).
+ fn wait_time(seconds: f64) void
// Copy a wave to a new wave.
+ fn wave_copy(wave: Wave) Wave
// Check if application should close (KEY_ESCAPE pressed or windows close icon clicked).
+ fn window_should_close() bool
begin_blend_mode
Begin blending mode (alpha, additive, multiplied, subtract, custom).
begin_drawing
Setup canvas (framebuffer) to start drawing.
begin_mode_2d
Begin 2D mode with custom camera (2D).
begin_mode_3d
Begin 3D mode with custom camera (3D).
begin_scissor_mode
Begin scissor mode (define screen area for following drawing).
begin_shader_mode
Begin custom shader drawing.
begin_texture_mode
Begin drawing to render texture.
begin_vr_stereo_mode
Begin stereo rendering (requires VR simulator).
change_directory
Change working directory, return true on success.
check_collision_box_sphere
Check collision between box and sphere.
check_collision_boxes
Check collision between two bounding boxes.
check_collision_circle_line
Check if circle collides with a line created betweeen two points [p1] and [p2].
check_collision_circle_rec
Check collision between circle and rectangle.
check_collision_circles
Check collision between two circles.
check_collision_lines
Where two line segments cross, or null when they do not.
check_collision_point_circle
Check if point is inside circle.
check_collision_point_line
Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold].
check_collision_point_poly
Check if point is within a polygon described by array of vertices.
check_collision_point_rec
Check if point is inside rectangle.
check_collision_point_triangle
Check if point is inside a triangle.
check_collision_recs
Check collision between two rectangles.
check_collision_spheres
Check collision between two spheres.
clear_background
Set background color (framebuffer clear color).
clear_window_state
Clear window configuration state flags.
close_audio_device
Close the audio device and context.
close_window
Close window and unload OpenGL context.
color_alpha
Get color with alpha applied, alpha goes from 0.0f to 1.0f.
color_alpha_blend
Get src alpha-blended into dst color with tint.
color_brightness
Get color with brightness correction, brightness factor goes from -1.0f to 1.0f.
color_contrast
Get color with contrast correction, contrast values between -1.0f and 1.0f.
color_from_hsv
Get a Color from HSV values, hue [0..360], saturation/value [0..1].
color_from_normalized
Get Color from normalized values [0..1].
color_is_equal
Check if two colors are equal.
color_lerp
Get color lerp interpolation between two colors, factor [0.0f..1.0f].
color_normalize
Get Color normalized as float [0..1].
color_tint
Get color multiplied with another color.
color_to_hsv
Get HSV values for a Color, hue [0..360], saturation/value [0..1].
color_to_int
Get hexadecimal value for a Color (0xRRGGBBAA).
directory_exists
Check if a directory path exists.
disable_cursor
Disables cursor (lock cursor).
disable_event_waiting
Disable waiting for events on EndDrawing(), automatic events polling.
draw_billboard
Draw a billboard texture.
draw_billboard_pro
Draw a billboard texture defined by source and rotation.
draw_billboard_rec
Draw a billboard texture defined by source.
draw_bounding_box
Draw bounding box (wires).
draw_capsule
Draw a capsule with the center of its sphere caps at startPos and endPos.
draw_capsule_wires
Draw capsule wireframe with the center of its sphere caps at startPos and endPos.
draw_circle
Draw a color-filled circle.
draw_circle_3d
Draw a circle in 3D world space.
draw_circle_gradient
Draw a gradient-filled circle.
draw_circle_lines
Draw circle outline.
draw_circle_lines_v
Draw circle outline (Vector version).
draw_circle_sector
Draw a piece of a circle.
draw_circle_sector_lines
Draw circle sector outline.
draw_circle_v
Draw a color-filled circle (Vector version).
draw_cube
Draw cube.
draw_cube_v
Draw cube (Vector version).
draw_cube_wires
Draw cube wires.
draw_cube_wires_v
Draw cube wires (Vector version).
draw_cylinder
Draw a cylinder/cone.
draw_cylinder_ex
Draw a cylinder with base at startPos and top at endPos.
draw_cylinder_wires
Draw a cylinder/cone wires.
draw_cylinder_wires_ex
Draw a cylinder wires with base at startPos and top at endPos.
draw_ellipse
Draw ellipse.
draw_ellipse_lines
Draw ellipse outline.
draw_ellipse_lines_v
Draw ellipse outline (Vector version).
draw_ellipse_v
Draw ellipse (Vector version).
draw_fps
Draw current FPS.
draw_grid
Draw a grid (centered at (0, 0, 0)).
draw_line
Draw a line.
draw_line_3d
Draw a line in 3D world space.
draw_line_bezier
Draw line segment cubic-bezier in-out interpolation.
draw_line_dashed
Draw a dashed line.
draw_line_ex
Draw a line (using triangles/quads).
draw_line_strip
Draw lines sequence (using gl lines).
draw_line_v
Draw a line (using gl lines).
draw_mesh
Draw a 3d mesh with material and transform.
draw_mesh_instanced
Draw multiple mesh instances with material and different transforms.
draw_model
Draw a model (with texture if set).
draw_model_ex
Draw a model with extended parameters.
draw_model_wires
Draw a model wires (with texture if set).
draw_model_wires_ex
Draw a model wires (with texture if set) with extended parameters.
draw_pixel
Draw a pixel using geometry [Can be slow, use with care].
draw_pixel_v
Draw a pixel using geometry (Vector version) [Can be slow, use with care].
draw_plane
Draw a plane XZ.
draw_point_3d
Draw a point in 3D space, actually a small line.
draw_poly
Draw a regular polygon (Vector version).
draw_poly_lines
Draw a polygon outline of n sides.
draw_poly_lines_ex
Draw a polygon outline of n sides with extended parameters.
draw_ray
Draw a ray line.
draw_rectangle
Draw a color-filled rectangle.
draw_rectangle_gradient_ex
Draw a gradient-filled rectangle with custom vertex colors.
draw_rectangle_gradient_h
Draw a horizontal-gradient-filled rectangle.
draw_rectangle_gradient_v
Draw a vertical-gradient-filled rectangle.
draw_rectangle_lines
Draw rectangle outline.
draw_rectangle_lines_ex
Draw rectangle outline with extended parameters.
draw_rectangle_pro
Draw a color-filled rectangle with pro parameters.
draw_rectangle_rec
Draw a color-filled rectangle.
draw_rectangle_rounded
Draw rectangle with rounded edges.
draw_rectangle_rounded_lines
Draw rectangle lines with rounded edges.
draw_rectangle_rounded_lines_ex
Draw rectangle with rounded edges outline.
draw_rectangle_v
Draw a color-filled rectangle (Vector version).
draw_ring
Draw ring.
draw_ring_lines
Draw ring outline.
draw_sphere
Draw sphere.
draw_sphere_ex
Draw sphere with extended parameters.
draw_sphere_wires
Draw sphere wires.
draw_spline_basis
Draw spline: B-Spline, minimum 4 points.
draw_spline_bezier_cubic
Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...].
draw_spline_bezier_quadratic
Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...].
draw_spline_catmull_rom
Draw spline: Catmull-Rom, minimum 4 points.
draw_spline_linear
Draw spline: Linear, minimum 2 points.
draw_spline_segment_basis
Draw spline segment: B-Spline, 4 points.
draw_spline_segment_bezier_cubic
Draw spline segment: Cubic Bezier, 2 points, 2 control points.
draw_spline_segment_bezier_quadratic
Draw spline segment: Quadratic Bezier, 2 points, 1 control point.
draw_spline_segment_catmull_rom
Draw spline segment: Catmull-Rom, 4 points.
draw_spline_segment_linear
Draw spline segment: Linear, 2 points.
draw_text
Draw text (using default font).
draw_text_codepoint
Draw one character (codepoint).
draw_text_codepoints
Draw multiple character (codepoint).
draw_text_ex
Draw text using font and additional parameters.
draw_text_pro
Draw text using Font and pro parameters (rotation).
draw_texture
Draw a Texture2D.
draw_texture_ex
Draw a Texture2D with extended parameters.
draw_texture_n_patch
Draws a texture (or part of it) that stretches or shrinks nicely.
draw_texture_pro
Draw a part of a texture defined by a rectangle with 'pro' parameters.
draw_texture_rec
Draw a part of a texture defined by a rectangle.
draw_texture_v
Draw a Texture2D with position defined as Vector2.
draw_triangle
Draw a color-filled triangle (vertex in counter-clockwise order!).
draw_triangle_3d
Draw a color-filled triangle (vertex in counter-clockwise order!).
draw_triangle_fan
Draw a triangle fan defined by points (first vertex is the center).
draw_triangle_lines
Draw triangle outline (vertex in counter-clockwise order!).
draw_triangle_strip
Draw a triangle strip defined by points.
draw_triangle_strip_3d
Draw a triangle strip defined by points.
enable_cursor
Enables cursor (unlock cursor).
enable_event_waiting
Enable waiting for events on EndDrawing(), no automatic event polling.
end_blend_mode
End blending mode (reset to default: alpha blending).
end_drawing
End canvas drawing and swap buffers (double buffering).
end_mode_2d
Ends 2D mode with custom camera.
end_mode_3d
Ends 3D mode and returns to default 2D orthographic mode.
end_scissor_mode
End scissor mode.
end_shader_mode
End custom shader drawing (use default shader).
end_texture_mode
Ends drawing to render texture.
end_vr_stereo_mode
End stereo rendering (requires VR simulator).
export_automation_event_list
Export automation events list as text file.
export_font_as_code
Export font as code file, returns true on success.
export_image
Export image data to file, returns true on success.
export_image_as_code
Export image as code file defining an array of bytes, returns true on success.
export_mesh
Export mesh data to file, returns true on success.
export_mesh_as_code
Export mesh as code file (.h) defining multiple arrays of vertex attributes.
export_wave
Export wave data to file, returns true on success.
export_wave_as_code
Export wave sample data to code (.h), returns true on success.
fade
Get color with alpha applied, alpha goes from 0.0f to 1.0f.
file_copy
Copy file from one path to another, dstPath created if it doesn't exist.
file_exists
Check if file exists.
file_move
Move file from one directory to another, dstPath created if it doesn't exist.
file_remove
Remove file (if exists).
file_rename
Rename file (if exists).
file_text_find_index
Find text in existing file.
file_text_replace
Replace text in an existing file.
gen_image_cellular
Generate image: cellular algorithm, bigger tileSize means bigger cells.
gen_image_checked
Generate image: checked.
gen_image_color
Generate image: plain color.
gen_image_gradient_linear
Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient.
gen_image_gradient_radial
Generate image: radial gradient.
gen_image_gradient_square
Generate image: square gradient.
gen_image_perlin_noise
Generate image: perlin noise.
gen_image_text
Generate image: grayscale image from text data.
gen_image_white_noise
Generate image: white noise.
gen_mesh_cone
Generate cone/pyramid mesh.
gen_mesh_cube
Generate cuboid mesh.
gen_mesh_cubicmap
Generate cubes-based map mesh from image data.
gen_mesh_cylinder
Generate cylinder mesh.
gen_mesh_heightmap
Generate heightmap mesh from image data.
gen_mesh_hemi_sphere
Generate half-sphere mesh (no bottom cap).
gen_mesh_knot
Generate trefoil knot mesh.
gen_mesh_plane
Generate plane mesh (with subdivisions).
gen_mesh_poly
Generate polygonal mesh.
gen_mesh_sphere
Generate sphere mesh (standard sphere).
gen_mesh_torus
Generate torus mesh.
get_application_directory
Get the directory of the running application (uses static string).
get_camera_matrix
Get camera transform matrix (view matrix).
get_camera_matrix_2d
Get camera 2d transform matrix.
get_char_pressed
Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty.
get_clipboard_image
Get clipboard image content.
get_clipboard_text
Get clipboard text content.
get_collision_rec
Get collision rectangle for two rectangles collision.
get_color
Get Color structure from hexadecimal value.
get_current_monitor
Get current monitor where window is placed.
get_directory_file_count
Get the file count in a directory.
get_directory_file_count_ex
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.
get_directory_path
Get full path for a given fileName with path (uses static string).
get_file_extension
Get pointer to extension for a filename string (includes dot: '.png').
get_file_length
Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h).
get_file_name
Get pointer to filename for a path string.
get_file_name_without_ext
Get filename string without extension (uses static string).
get_font_default
Get the default Font.
get_fps
Get current FPS.
get_frame_time
Get time in seconds for last frame drawn (delta time).
get_gamepad_axis_count
Get axis count for a gamepad.
get_gamepad_axis_movement
Get movement value for a gamepad axis.
Get the last gamepad button pressed.
get_gamepad_name
Get gamepad internal name id.
get_gesture_detected
Get latest detected gesture.
get_gesture_drag_angle
Get gesture drag angle.
get_gesture_drag_vector
Get gesture drag vector.
get_gesture_hold_duration
Get gesture hold time in seconds.
get_gesture_pinch_angle
Get gesture pinch angle.
get_gesture_pinch_vector
Get gesture pinch delta.
get_glyph_atlas_rec
Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found.
get_glyph_index
Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found.
get_glyph_info
Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found.
get_image_alpha_border
Get image alpha border rectangle.
get_image_color
Get image pixel color at (x, y) position.
get_key_name
Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard).
get_key_pressed
Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty.
get_master_volume
Get master volume (listener).
get_mesh_bounding_box
Compute mesh bounding box limits.
get_model_bounding_box
Compute model bounding box limits (considers all meshes).
get_monitor_count
Get number of connected monitors.
get_monitor_height
Get specified monitor height (current video mode used by monitor).
get_monitor_name
Get the human-readable, UTF-8 encoded name of the specified monitor.
get_monitor_physical_height
Get specified monitor physical height in millimetres.
get_monitor_physical_width
Get specified monitor physical width in millimetres.
get_monitor_position
Get specified monitor position.
get_monitor_refresh_rate
Get specified monitor refresh rate.
get_monitor_width
Get specified monitor width (current video mode used by monitor).
get_mouse_delta
Get mouse delta between frames.
get_mouse_position
Get mouse position XY.
get_mouse_wheel_move
Get mouse wheel movement for X or Y, whichever is larger.
get_mouse_wheel_move_v
Get mouse wheel movement for both X and Y.
get_mouse_x
Get mouse position X.
get_mouse_y
Get mouse position Y.
get_music_time_length
Get music time length (in seconds).
get_music_time_played
Get current music time played (in seconds).
get_pixel_data_size
Get pixel data size in bytes for certain format.
get_prev_directory_path
Get previous directory path for a given path (uses static string).
get_random_value
Get a random value between min and max (both included).
get_ray_collision_box
Get collision info between ray and box.
get_ray_collision_mesh
Get collision info between ray and mesh.
get_ray_collision_quad
Get collision info between ray and quad.
get_ray_collision_sphere
Get collision info between ray and sphere.
get_ray_collision_triangle
Get collision info between ray and triangle.
get_render_height
Get current render height (it considers HiDPI).
get_render_width
Get current render width (it considers HiDPI).
get_screen_height
Get current screen height.
get_screen_to_world_2d
Get the world space position for a 2d camera screen space position.
get_screen_to_world_ray
Get a ray trace from screen position (i.e mouse).
get_screen_to_world_ray_ex
Get a ray trace from screen position (i.e mouse) in a viewport.
get_screen_width
Get current screen width.
get_shader_location
Get shader uniform location.
get_shader_location_attrib
Get shader attribute location.
get_shapes_texture
Get texture that is used for shapes drawing.
get_shapes_texture_rectangle
Get texture source rectangle that is used for shapes drawing.
get_spline_point_basis
Get (evaluate) spline point: B-Spline.
get_spline_point_bezier_cubic
Get (evaluate) spline point: Cubic Bezier.
get_spline_point_bezier_quad
Get (evaluate) spline point: Quadratic Bezier.
get_spline_point_catmull_rom
Get (evaluate) spline point: Catmull-Rom.
get_spline_point_linear
Get (evaluate) spline point: Linear.
get_time
Get elapsed time in seconds since InitWindow().
get_touch_point_count
Get number of touch points.
get_touch_point_id
Get touch point identifier for given index.
get_touch_position
Get touch position XY for a touch point index (relative to screen size).
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).
get_window_position
Get window position XY on monitor.
get_window_scale_dpi
Get window scale DPI factor.
get_working_directory
Get current working directory (uses static string).
get_world_to_screen
Get the screen space position for a 3d world space position.
get_world_to_screen_2d
Get the screen space position for a 2d camera world space position.
get_world_to_screen_ex
Get size position for a 3d world space position.
hide_cursor
Hides cursor.
image_copy
Create an image duplicate (useful for transformations).
image_from_channel
Create an image from a selected channel of another image (GRAYSCALE).
image_from_image
Create an image from another image piece.
image_text
Create an image from text (default font).
image_text_ex
Create an image from text (custom sprite font).
init_audio_device
Initialize audio device and context.
init_window
Initialize window and OpenGL context.
is_audio_device_ready
Check if audio device has been initialized successfully.
is_audio_stream_playing
Check if audio stream is playing.
is_audio_stream_processed
Check if any audio stream buffers requires refill.
is_audio_stream_valid
Checks if an audio stream is valid (buffers initialized).
is_cursor_hidden
Check if cursor is not visible.
is_cursor_on_screen
Check if cursor is on the screen.
is_file_dropped
Check if a file has been dropped into window.
is_file_extension
Check file extension (recommended include point: .png, .wav).
is_file_name_valid
Check if fileName is valid for the platform/OS.
is_font_valid
Check if a font is valid (font data loaded, WARNING: GPU texture not checked).
is_gamepad_available
Check if a gamepad is available.
Check if a gamepad button is being pressed.
Check if a gamepad button has been pressed once.
Check if a gamepad button has been released once.
Check if a gamepad button is NOT being pressed.
is_gesture_detected
Check if a gesture have been detected.
is_image_valid
Check if an image is valid (data and parameters).
is_key_down
Check if a key is being pressed.
is_key_pressed
Check if a key has been pressed once.
is_key_pressed_repeat
Check if a key has been pressed again.
is_key_released
Check if a key has been released once.
is_key_up
Check if a key is NOT being pressed.
is_material_valid
Check if a material is valid (shader assigned, map textures loaded in GPU).
is_model_animation_valid
Check model animation skeleton match.
is_model_valid
Check if a model is valid (loaded in GPU, VAO/VBOs).
Check if a mouse button is being pressed.
Check if a mouse button has been pressed once.
Check if a mouse button has been released once.
Check if a mouse button is NOT being pressed.
is_music_stream_playing
Check if music is playing.
is_music_valid
Checks if a music stream is valid (context and buffers initialized).
is_path_file
Check if a given path is a file or a directory.
is_render_texture_valid
Check if a render texture is valid (loaded in GPU).
is_shader_valid
Check if a shader is valid (loaded on GPU).
is_sound_playing
Check if a sound is currently playing.
is_sound_valid
Checks if a sound is valid (data loaded and buffers initialized).
is_texture_valid
Check if a texture is valid (loaded in GPU).
is_wave_valid
Checks if wave data is valid (data loaded and parameters).
is_window_focused
Check if window is currently focused.
is_window_fullscreen
Check if window is currently fullscreen.
is_window_hidden
Check if window is currently hidden.
is_window_maximized
Check if window is currently maximized.
is_window_minimized
Check if window is currently minimized.
is_window_ready
Check if window has been initialized successfully.
is_window_resized
Check if window has been resized last frame.
is_window_state
Check if one specific window flag is enabled.
load_audio_stream
Load audio stream (to stream raw audio pcm data).
load_automation_event_list
Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS.
load_directory_files
Load directory filepaths, files and directories, no subdirs scan.
load_directory_files_ex
Load directory filepaths with extension filtering and subdir scan; some filters available: ".", "FILES", "DIRS".
load_dropped_files
Load dropped filepaths.
load_font
Load font from file into GPU memory (VRAM).
load_font_ex
Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height.
load_font_from_image
Load font from Image (XNA style).
load_image
Load image from file into CPU memory (RAM).
load_image_colors
Every pixel of an image as a color, row by row.
load_image_from_screen
Load image from screen buffer and (screenshot).
load_image_from_texture
Load image from GPU texture data.
load_image_raw
Load image from RAW file data.
load_material_default
Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps).
load_model
Load model from files (meshes and materials).
load_model_from_mesh
Load model from generated mesh (default material).
load_music_stream
Load music stream from file.
load_render_texture
Load texture for rendering (framebuffer).
load_shader
Load shader from files and bind default locations.
An empty string uses raylib's default shader for that stage.
load_shader_from_memory
Load shader from code strings and bind default locations.
An empty string uses raylib's default shader for that stage.
load_sound
Load sound from file.
load_sound_alias
Create a new sound that shares the same sample data as the source sound, does not own the sound data.
load_sound_from_wave
Load sound from wave data.
load_texture
Load texture from file into GPU memory (VRAM).
load_texture_cubemap
Load cubemap from image, multiple image cubemap layouts supported.
load_texture_from_image
Load texture from image data.
load_vr_stereo_config
Load VR stereo config for VR simulator device parameters.
load_wave
Load wave data from file.
make_directory
Create directories (including full path requested), returns 0 on success.
maximize_window
Set window state: maximized, if resizable.
measure_text
Measure string width for default font.
measure_text_ex
Measure string size for Font.
minimize_window
Set window state: minimized, if resizable.
open_url
Open URL with default system browser (if available).
pause_audio_stream
Pause audio stream.
pause_music_stream
Pause music playing.
pause_sound
Pause a sound.
play_audio_stream
Play audio stream.
play_automation_event
Play a recorded automation event.
play_music_stream
Start music playing.
play_sound
Play a sound.
Register all input events.
restore_window
Restore window from being minimized/maximized.
resume_audio_stream
Resume audio stream.
resume_music_stream
Resume playing paused music.
resume_sound
Resume a paused sound.
save_file_text
Save text data to file (write), string must be '\0' terminated, returns true on success.
seek_music_stream
Seek music to a position (in seconds).
set_audio_stream_buffer_size_default
Default size for new audio streams.
set_audio_stream_pan
Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered).
set_audio_stream_pitch
Set pitch for audio stream (1.0 is base level).
set_audio_stream_volume
Set volume for audio stream (1.0 is max level).
set_automation_event_base_frame
Set automation event internal base frame to start recording.
set_clipboard_text
Set clipboard text content.
set_config_flags
Setup init configuration flags (view FLAGS).
set_exit_key
Set a custom key to exit program (default is ESC).
set_gamepad_mappings
Set internal gamepad mappings (SDL_GameControllerDB).
set_gamepad_vibration
Set gamepad vibration for both motors (duration in seconds).
set_gestures_enabled
Enable a set of gestures using flags.
set_master_volume
Set master volume (listener).
set_mouse_cursor
Set mouse cursor.
set_mouse_offset
Set mouse offset.
set_mouse_position
Set mouse position XY.
set_mouse_scale
Set mouse scaling.
set_music_pan
Set pan for a music (-1.0 left, 0.0 center, 1.0 right).
set_music_pitch
Set pitch for a music (1.0 is base level).
set_music_volume
Set volume for music (1.0 is max level).
set_random_seed
Set the seed for the random number generator.
set_shader_value_matrix
Set shader uniform value (matrix 4x4).
set_shader_value_texture
Set shader uniform value and bind the texture (sampler2d).
set_shapes_texture
Set texture and rectangle to be used on shapes drawing.
set_sound_pan
Set pan for a sound (-1.0 left, 0.0 center, 1.0 right).
set_sound_pitch
Set pitch for a sound (1.0 is base level).
set_sound_volume
Set volume for a sound (1.0 is max level).
set_target_fps
Set target FPS (maximum).
set_text_line_spacing
Set vertical line spacing when drawing with line-breaks.
set_texture_filter
Set texture scaling filter mode.
set_texture_wrap
Set texture wrapping mode.
set_trace_log_level
Set the current threshold (minimum) log level.
set_window_focused
Set window focused.
set_window_icon
Set icon for window (single image, RGBA 32bit).
set_window_icons
Set icon for window (multiple images, RGBA 32bit).
set_window_max_size
Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE).
set_window_min_size
Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE).
set_window_monitor
Set monitor for the current window.
set_window_opacity
Set window opacity [0.0f..1.0f].
set_window_position
Set window position on screen.
set_window_size
Set window dimensions.
set_window_state
Set window configuration state using flags.
set_window_title
Set title for window.
show_cursor
Shows cursor.
start_automation_event_recording
Start recording automation events (AutomationEventList must be set).
stop_audio_stream
Stop audio stream.
stop_automation_event_recording
Stop recording automation events.
stop_music_stream
Stop music playing.
stop_sound
Stop playing a sound.
swap_screen_buffer
Swap back buffer with front buffer (screen drawing).
take_screenshot
Takes a screenshot of current screen (filename extension defines format).
toggle_borderless_windowed
Toggle window state: borderless windowed, resizes window to match monitor resolution.
toggle_fullscreen
Toggle window state: fullscreen/windowed, resizes monitor to match window resolution.
unload_audio_stream
Unload audio stream and free memory.
unload_automation_event_list
Unload automation events list from file.
unload_directory_files
Unload filepaths.
unload_dropped_files
Unload dropped filepaths.
unload_font
Unload font from GPU memory (VRAM).
unload_font_data
Unload font chars info data (RAM).
unload_image
Unload image from CPU memory (RAM).
unload_material
Unload material from GPU memory (VRAM).
unload_mesh
Unload mesh data from CPU and GPU.
unload_model
Unload model (including meshes) from memory (RAM and/or VRAM).
unload_model_animations
Unload animation array data.
unload_music_stream
Unload music stream.
unload_render_texture
Unload render texture from GPU memory (VRAM).
unload_shader
Unload shader from GPU memory (VRAM).
unload_sound
Unload sound.
unload_sound_alias
Unload a sound alias (does not deallocate sample data).
unload_texture
Unload texture from GPU memory (VRAM).
unload_vr_stereo_config
Unload VR stereo config.
unload_wave
Unload wave data.
update_model_animation
Update model animation pose (vertex buffers and bone matrices).
update_model_animation_ex
Update model animation pose, blending two animations.
update_music_stream
Updates buffers for music streaming.
update_texture
Replaces the pixels of an RGBA texture (PixelFormat.uncompressed_r8g8b8a8), row by row.
Panics when the texture has another format or pixels is not width * height long.
wait_time
Wait for some time (halt program execution).
wave_copy
Copy a wave to a new wave.
window_should_close
Check if application should close (KEY_ESCAPE pressed or windows close icon clicked).
Classes for 'main'
// AudioStream, custom audio stream.
+ struct AudioStream {
// Pointer to internal data used by the audio system.
+ buffer: ?ptr
// Number of channels (1-mono, 2-stereo, ...).
+ channels: u32
// Pointer to internal data processor, useful for audio effects.
+ processor: ?ptr
// Frequency (samples per second).
+ sample_rate: u32
// Bit depth (bits per sample): 8, 16, 32 (24 not supported).
+ sample_size: u32
}
AudioStream
AudioStream, custom audio stream.
buffer
Pointer to internal data used by the audio system.
channels
Number of channels (1-mono, 2-stereo, ...).
processor
Pointer to internal data processor, useful for audio effects.
sample_rate
Frequency (samples per second).
sample_size
Bit depth (bits per sample): 8, 16, 32 (24 not supported).
// Automation event.
+ struct AutomationEvent {
// Event frame.
+ frame: u32
// Event parameters (if required).
+ params: [i32 x 4]
// Event type (AutomationEventType).
+ type: u32
}
AutomationEvent
Automation event.
frame
Event frame.
params
Event parameters (if required).
type
Event type (AutomationEventType).
// Automation event list.
+ struct AutomationEventList {
// Events max entries (MAX_AUTOMATION_EVENTS).
+ capacity: u32
// Events entries count.
+ count: u32
// Events entries.
+ events: ?ptr
}
AutomationEventList
Automation event list.
capacity
Events max entries (MAX_AUTOMATION_EVENTS).
count
Events entries count.
events
Events entries.
// Bone, skeletal animation bone.
+ struct BoneInfo {
// Bone name.
+ name: [u8 x 32]
// Bone parent.
+ parent: i32
}
BoneInfo
Bone, skeletal animation bone.
name
Bone name.
parent
Bone parent.
// BoundingBox.
+ struct BoundingBox {
// Maximum vertex box-corner.
+ max: Vector3
// Minimum vertex box-corner.
+ min: Vector3
}
BoundingBox
BoundingBox.
max
Maximum vertex box-corner.
min
Minimum vertex box-corner.
// Camera2D, defines position/orientation in 2d space.
+ struct Camera2D {
// Camera offset (screen space offset from window origin).
+ offset: Vector2
// Camera rotation in degrees (pivots around target).
+ rotation: f32
// Camera target (world space target point that is mapped to screen space offset).
+ target: Vector2
// Camera zoom (scaling around target), must not be set to 0, set to 1.0f for no scale.
+ zoom: f32
}
Camera2D
Camera2D, defines position/orientation in 2d space.
offset
Camera offset (screen space offset from window origin).
rotation
Camera rotation in degrees (pivots around target).
target
Camera target (world space target point that is mapped to screen space offset).
zoom
Camera zoom (scaling around target), must not be set to 0, set to 1.0f for no scale.
// Camera, defines position/orientation in 3d space.
+ struct Camera3D {
// Camera field-of-view aperture in Y (degrees) in perspective, used as near plane height in world units in orthographic.
+ fovy: f32
// Camera position.
+ position: Vector3
// Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC.
+ projection: i32
// Camera target it looks-at.
+ target: Vector3
// Camera up vector (rotation over its axis).
+ up: Vector3
// Update camera position for selected mode.
+ fn update(mode: CameraMode) void
// Update camera movement/rotation.
+ fn update_pro(movement: Vector3, rotation: Vector3, zoom: f32) void
}
Camera3D
Camera, defines position/orientation in 3d space.
fovy
Camera field-of-view aperture in Y (degrees) in perspective, used as near plane height in world units in orthographic.
position
Camera position.
projection
Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC.
target
Camera target it looks-at.
up
Camera up vector (rotation over its axis).
update
Update camera position for selected mode.
update_pro
Update camera movement/rotation.
// Color, 4 components, R8G8B8A8 (32bit).
+ struct Color {
// Color alpha value.
+ a: u8
// Color blue value.
+ b: u8
// Color green value.
+ g: u8
// Color red value.
+ r: u8
// The same color with its alpha set: 0 is transparent, 1 opaque.
+ fn alpha(alpha: f32) Color
// An opaque color.
+ static fn rgb(r: u8, g: u8, b: u8) Color
// A color with alpha.
+ static fn rgba(r: u8, g: u8, b: u8, a: u8) Color
}
Color
Color, 4 components, R8G8B8A8 (32bit).
a
Color alpha value.
b
Color blue value.
g
Color green value.
r
Color red value.
alpha
The same color with its alpha set: 0 is transparent, 1 opaque.
rgb
An opaque color.
rgba
A color with alpha.
// File path list.
+ struct FilePathList {
// Filepaths entries count.
+ count: u32
// Filepaths entries.
+ paths: ?ptr
}
FilePathList
File path list.
count
Filepaths entries count.
paths
Filepaths entries.
// Font, font texture and GlyphInfo array data.
+ struct Font {
// Base size (default chars height).
+ base_size: i32
// Number of glyph characters.
+ glyph_count: i32
// Padding around the glyph characters.
+ glyph_padding: i32
// Glyphs info data.
+ glyphs: ?ptr
// Rectangles in texture for the glyphs.
+ recs: ?ptr
// Texture atlas containing the glyphs.
+ texture: Texture
}
Font
Font, font texture and GlyphInfo array data.
base_size
Base size (default chars height).
glyph_count
Number of glyph characters.
glyph_padding
Padding around the glyph characters.
glyphs
Glyphs info data.
recs
Rectangles in texture for the glyphs.
texture
Texture atlas containing the glyphs.
// GlyphInfo, font characters glyphs info.
+ struct GlyphInfo {
// Character advance position X.
+ advance_x: i32
// Character image data.
+ image: Image
// Character offset X when drawing.
+ offset_x: i32
// Character offset Y when drawing.
+ offset_y: i32
// Character value (Unicode).
+ value: i32
}
GlyphInfo
GlyphInfo, font characters glyphs info.
advance_x
Character advance position X.
image
Character image data.
offset_x
Character offset X when drawing.
offset_y
Character offset Y when drawing.
value
Character value (Unicode).
// Image, pixel data stored in CPU memory (RAM).
+ struct Image {
// Image raw data.
+ data: ?ptr
// Data format (PixelFormat type).
+ format: i32
// Image base height.
+ height: i32
// Mipmap levels, 1 by default.
+ mipmaps: i32
// Image base width.
+ width: i32
// Clear alpha channel to desired color.
+ fn alpha_clear(color: Color, threshold: f32) void
// Crop image depending on alpha value.
+ fn alpha_crop(threshold: f32) void
// Apply alpha mask to image.
+ fn alpha_mask(alpha_mask: Image) void
// Premultiply alpha channel.
+ fn alpha_premultiply() void
// Apply Gaussian blur using a box blur approximation.
+ fn blur_gaussian(blur_size: i32) void
// Clear image background with given color.
+ fn clear_background(color: Color) void
// Modify image color: brightness (-255 to 255).
+ fn color_brightness(brightness: i32) void
// Modify image color: contrast (-100 to 100).
+ fn color_contrast(contrast: f32) void
// Modify image color: grayscale.
+ fn color_grayscale() void
// Modify image color: invert.
+ fn color_invert() void
// Modify image color: replace color.
+ fn color_replace(color: Color, replace: Color) void
// Modify image color: tint.
+ fn color_tint(color: Color) void
// Convert image data to desired format.
+ fn convert_format(new_format: PixelFormat) void
// Crop an image to a defined rectangle.
+ fn crop(crop: Rectangle) void
// Dither image data to 16bpp or lower (Floyd-Steinberg dithering).
+ fn dither(r_bpp: i32, g_bpp: i32, b_bpp: i32, a_bpp: i32) void
// Draw a source image within a destination image (tint applied to source).
+ fn draw(src: Image, src_rec: Rectangle, dst_rec: Rectangle, tint: Color) void
// Draw a filled circle within an image.
+ fn draw_circle(center_x: i32, center_y: i32, radius: i32, color: Color) void
// Draw circle outline within an image.
+ fn draw_circle_lines(center_x: i32, center_y: i32, radius: i32, color: Color) void
// Draw circle outline within an image (Vector version).
+ fn draw_circle_lines_v(center: Vector2, radius: i32, color: Color) void
// Draw a filled circle within an image (Vector version).
+ fn draw_circle_v(center: Vector2, radius: i32, color: Color) void
// Draw line within an image.
+ fn draw_line(start_pos_x: i32, start_pos_y: i32, end_pos_x: i32, end_pos_y: i32, color: Color) void
// Draw a line defining thickness within an image.
+ fn draw_line_ex(start: Vector2, end: Vector2, thick: i32, color: Color) void
// Draw line within an image (Vector version).
+ fn draw_line_v(start: Vector2, end: Vector2, color: Color) void
// Draw pixel within an image.
+ fn draw_pixel(pos_x: i32, pos_y: i32, color: Color) void
// Draw pixel within an image (Vector version).
+ fn draw_pixel_v(position: Vector2, color: Color) void
// Draw rectangle within an image.
+ fn draw_rectangle(pos_x: i32, pos_y: i32, width: i32, height: i32, color: Color) void
// Draw rectangle lines within an image.
+ fn draw_rectangle_lines(rec: Rectangle, thick: i32, color: Color) void
// Draw rectangle within an image.
+ fn draw_rectangle_rec(rec: Rectangle, color: Color) void
// Draw rectangle within an image (Vector version).
+ fn draw_rectangle_v(position: Vector2, size: Vector2, color: Color) void
// Draw text (using default font) within an image (destination).
+ fn draw_text(text: String, pos_x: i32, pos_y: i32, font_size: i32, color: Color) void
// Draw text (custom sprite font) within an image (destination).
+ fn draw_text_ex(font: Font, text: String, position: Vector2, font_size: f32, spacing: f32, tint: Color) void
// Draw triangle within an image.
+ fn draw_triangle(v1: Vector2, v2: Vector2, v3: Vector2, color: Color) void
// Draw triangle with interpolated colors within an image.
+ fn draw_triangle_ex(v1: Vector2, v2: Vector2, v3: Vector2, c1: Color, c2: Color, c3: Color) void
// Draw a triangle fan defined by points within an image (first vertex is the center).
+ fn draw_triangle_fan(points: local &[Vector2], color: Color) void
// Draw triangle outline within an image.
+ fn draw_triangle_lines(v1: Vector2, v2: Vector2, v3: Vector2, color: Color) void
// Draw a triangle strip defined by points within an image.
+ fn draw_triangle_strip(points: local &[Vector2], color: Color) void
// Flip image horizontally.
+ fn flip_horizontal() void
// Flip image vertically.
+ fn flip_vertical() void
// Compute all mipmap levels for a provided image.
+ fn gen_mipmaps() void
// Resize image (Bicubic scaling algorithm).
+ fn resize(new_width: i32, new_height: i32) void
// Resize canvas and fill with color.
+ fn resize_canvas(new_width: i32, new_height: i32, offset_x: i32, offset_y: i32, fill: Color) void
// Resize image (Nearest-Neighbor scaling algorithm).
+ fn resize_nn(new_width: i32, new_height: i32) void
// Rotate image by input angle in degrees (-359 to 359).
+ fn rotate(degrees: i32) void
// Rotate image counter-clockwise 90deg.
+ fn rotate_ccw() void
// Rotate image clockwise 90deg.
+ fn rotate_cw() void
// Convert image to POT (power-of-two).
+ fn to_pot(fill: Color) void
}
Image
Image, pixel data stored in CPU memory (RAM).
data
Image raw data.
Data format (PixelFormat type).
height
Image base height.
mipmaps
Mipmap levels, 1 by default.
width
Image base width.
alpha_clear
Clear alpha channel to desired color.
alpha_crop
Crop image depending on alpha value.
alpha_mask
Apply alpha mask to image.
alpha_premultiply
Premultiply alpha channel.
blur_gaussian
Apply Gaussian blur using a box blur approximation.
clear_background
Clear image background with given color.
color_brightness
Modify image color: brightness (-255 to 255).
color_contrast
Modify image color: contrast (-100 to 100).
color_grayscale
Modify image color: grayscale.
color_invert
Modify image color: invert.
color_replace
Modify image color: replace color.
color_tint
Modify image color: tint.
Convert image data to desired format.
crop
Crop an image to a defined rectangle.
dither
Dither image data to 16bpp or lower (Floyd-Steinberg dithering).
draw
Draw a source image within a destination image (tint applied to source).
draw_circle
Draw a filled circle within an image.
draw_circle_lines
Draw circle outline within an image.
draw_circle_lines_v
Draw circle outline within an image (Vector version).
draw_circle_v
Draw a filled circle within an image (Vector version).
draw_line
Draw line within an image.
draw_line_ex
Draw a line defining thickness within an image.
draw_line_v
Draw line within an image (Vector version).
draw_pixel
Draw pixel within an image.
draw_pixel_v
Draw pixel within an image (Vector version).
draw_rectangle
Draw rectangle within an image.
draw_rectangle_lines
Draw rectangle lines within an image.
draw_rectangle_rec
Draw rectangle within an image.
draw_rectangle_v
Draw rectangle within an image (Vector version).
draw_text
Draw text (using default font) within an image (destination).
draw_text_ex
Draw text (custom sprite font) within an image (destination).
draw_triangle
Draw triangle within an image.
draw_triangle_ex
Draw triangle with interpolated colors within an image.
draw_triangle_fan
Draw a triangle fan defined by points within an image (first vertex is the center).
draw_triangle_lines
Draw triangle outline within an image.
draw_triangle_strip
Draw a triangle strip defined by points within an image.
flip_horizontal
Flip image horizontally.
flip_vertical
Flip image vertically.
gen_mipmaps
Compute all mipmap levels for a provided image.
resize
Resize image (Bicubic scaling algorithm).
resize_canvas
Resize canvas and fill with color.
resize_nn
Resize image (Nearest-Neighbor scaling algorithm).
rotate
Rotate image by input angle in degrees (-359 to 359).
rotate_ccw
Rotate image counter-clockwise 90deg.
rotate_cw
Rotate image clockwise 90deg.
to_pot
Convert image to POT (power-of-two).
// Material, includes shader and maps.
+ struct Material {
// Material maps array (MAX_MATERIAL_MAPS).
+ maps: ?ptr
// Material generic parameters (if required).
+ params: [f32 x 4]
// Material shader.
+ shader: Shader
// Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...).
+ fn set_texture(map_type: MaterialMapIndex, texture: Texture) void
}
Material
Material, includes shader and maps.
maps
Material maps array (MAX_MATERIAL_MAPS).
params
Material generic parameters (if required).
shader
Material shader.
set_texture
Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...).
// MaterialMap.
+ struct MaterialMap {
// Material map color.
+ color: Color
// Material map texture.
+ texture: Texture
// Material map value.
+ value: f32
}
MaterialMap
MaterialMap.
color
Material map color.
texture
Material map texture.
value
Material map value.
// Matrix, 4x4 components, column major, OpenGL style, right-handed.
+ struct Matrix {
// Matrix first row (4 components).
+ m0: f32
// Matrix second row (4 components).
+ m1: f32
// Matrix third row (4 components).
+ m10: f32
// Matrix fourth row (4 components).
+ m11: f32
// Matrix first row (4 components).
+ m12: f32
// Matrix second row (4 components).
+ m13: f32
// Matrix third row (4 components).
+ m14: f32
// Matrix fourth row (4 components).
+ m15: f32
// Matrix third row (4 components).
+ m2: f32
// Matrix fourth row (4 components).
+ m3: f32
// Matrix first row (4 components).
+ m4: f32
// Matrix second row (4 components).
+ m5: f32
// Matrix third row (4 components).
+ m6: f32
// Matrix fourth row (4 components).
+ m7: f32
// Matrix first row (4 components).
+ m8: f32
// Matrix second row (4 components).
+ m9: f32
// The matrix that changes nothing.
+ static fn identity() Matrix
// This transform followed by `then`, like raymath's `MatrixMultiply(this, then)`.
+ fn multiply(then: Matrix) Matrix
// Rotates `angle` radians around the x axis.
+ static fn rotate_x(angle: f32) Matrix
// Rotates `angle` radians around the y axis.
+ static fn rotate_y(angle: f32) Matrix
// Rotates `angle` radians around the z axis.
+ static fn rotate_z(angle: f32) Matrix
// Scales each axis.
+ static fn scaling(x: f32, y: f32, z: f32) Matrix
// Moves by `x`, `y`, `z`.
+ static fn translate(x: f32, y: f32, z: f32) Matrix
}
Matrix
Matrix, 4x4 components, column major, OpenGL style, right-handed.
m0
Matrix first row (4 components).
m1
Matrix second row (4 components).
m10
Matrix third row (4 components).
m11
Matrix fourth row (4 components).
m12
Matrix first row (4 components).
m13
Matrix second row (4 components).
m14
Matrix third row (4 components).
m15
Matrix fourth row (4 components).
m2
Matrix third row (4 components).
m3
Matrix fourth row (4 components).
m4
Matrix first row (4 components).
m5
Matrix second row (4 components).
m6
Matrix third row (4 components).
m7
Matrix fourth row (4 components).
m8
Matrix first row (4 components).
m9
Matrix second row (4 components).
identity
The matrix that changes nothing.
multiply
This transform followed by then, like raymath's MatrixMultiply(this, then).
rotate_x
Rotates angle radians around the x axis.
rotate_y
Rotates angle radians around the y axis.
rotate_z
Rotates angle radians around the z axis.
scaling
Scales each axis.
translate
Moves by x, y, z.
// Mesh, vertex data and vao/vbo.
+ struct Mesh {
// Animated normals (after bones transformations).
+ anim_normals: ?ptr
// Animated vertex positions (after bones transformations).
+ anim_vertices: ?ptr
// Number of bones (MAX: 256 bones).
+ bone_count: i32
// Vertex bone indices, up to 4 bones influence by vertex (skinning) (shader-location = 6).
+ bone_indices: ?ptr
// Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7).
+ bone_weights: ?ptr
// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3).
+ colors: ?ptr
// Vertex indices (in case vertex data comes indexed).
+ indices: ?ptr
// Vertex normals (XYZ - 3 components per vertex) (shader-location = 2).
+ normals: ?ptr
// Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4).
+ tangents: ?ptr
// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1).
+ texcoords: ?ptr
// Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5).
+ texcoords2: ?ptr
// Number of triangles stored (indexed or not).
+ triangle_count: i32
// OpenGL Vertex Array Object id.
+ vao_id: u32
// OpenGL Vertex Buffer Objects id (default vertex data).
+ vbo_id: ?ptr
// Number of vertices stored in arrays.
+ vertex_count: i32
// Vertex position (XYZ - 3 components per vertex) (shader-location = 0).
+ vertices: ?ptr
// Compute mesh tangents.
+ fn gen_tangents() void
// Upload mesh vertex data in GPU and provide VAO/VBO ids.
+ fn upload(dynamic: bool) void
}
Mesh
Mesh, vertex data and vao/vbo.
anim_normals
Animated normals (after bones transformations).
anim_vertices
Animated vertex positions (after bones transformations).
bone_count
Number of bones (MAX: 256 bones).
bone_indices
Vertex bone indices, up to 4 bones influence by vertex (skinning) (shader-location = 6).
bone_weights
Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7).
colors
Vertex colors (RGBA - 4 components per vertex) (shader-location = 3).
indices
Vertex indices (in case vertex data comes indexed).
normals
Vertex normals (XYZ - 3 components per vertex) (shader-location = 2).
tangents
Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4).
texcoords
Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1).
texcoords2
Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5).
triangle_count
Number of triangles stored (indexed or not).
vao_id
OpenGL Vertex Array Object id.
vbo_id
OpenGL Vertex Buffer Objects id (default vertex data).
vertex_count
Number of vertices stored in arrays.
vertices
Vertex position (XYZ - 3 components per vertex) (shader-location = 0).
gen_tangents
Compute mesh tangents.
upload
Upload mesh vertex data in GPU and provide VAO/VBO ids.
// Collects vertices in valk arrays and turns them into a raylib `Mesh`.
+ class MeshBuilder {
~ colors: Array[u8]
~ indices: Array[u16]
~ normal_values: Array[f32]
// Whether vertices keep their normal. Turn it off for a shader that does not use normals: the mesh gets none, and a third less memory.
+ normals: bool
~ positions: Array[f32]
~ texcoords: Array[f32]
// Copies the vertices into a new `Mesh` and uploads it to the GPU, which needs an open window. Pass `upload: false` to keep it on the CPU, e.g. for `get_mesh_bounding_box`. Free it with `unload_mesh`, or through `unload_model` once a model owns it.
+ fn build(upload: bool (true), dynamic: bool (false), keep_data: bool (true)) Mesh
// Removes every vertex and index, keeping the memory for the next mesh.
+ fn clear() void
// Adds a triangle of vertices that were added before, by index. A mesh built with indices can only have 65536 vertices.
+ fn triangle(a: uint, b: uint, c: uint) void
// Adds a vertex and returns its index.
+ fn vertex(position: Vector3, uv: Vector2, normal: Vector3, color: Color) uint
// The number of vertices added so far.
+ get vertex_count: uint
}
MeshBuilder
Collects vertices in valk arrays and turns them into a raylib Mesh.
Every vertex has a position, texture coordinates, a normal and a color. Without
index calls the vertices form triangles three at a time.
let builder = raylib.MeshBuilder{}
builder.vertex(.{ x: 0, y: 0, z: 0 }, .{ x: 0, y: 0 }, .{ x: 0, y: 1, z: 0 }, raylib.WHITE)
builder.vertex(.{ x: 1, y: 0, z: 1 }, .{ x: 1, y: 1 }, .{ x: 0, y: 1, z: 0 }, raylib.WHITE)
builder.vertex(.{ x: 1, y: 0, z: 0 }, .{ x: 1, y: 0 }, .{ x: 0, y: 1, z: 0 }, raylib.WHITE)
let mesh = builder.build()
defer raylib.unload_mesh(mesh)
normals
Whether vertices keep their normal. Turn it off for a shader that does not use
normals: the mesh gets none, and a third less memory.
build
Copies the vertices into a new Mesh and uploads it to the GPU, which needs an open
window. Pass upload: false to keep it on the CPU, e.g. for get_mesh_bounding_box.
Free it with unload_mesh, or through unload_model once a model owns it.
raylib keeps a copy of the vertices next to the one on the GPU. keep_data: false
frees it after the upload: the mesh still draws and unloads, but its vertices can no
longer be read, e.g. by get_mesh_bounding_box.
Panics when indices name a vertex that was not added, or when an indexed mesh has
more than 65536 vertices.
clear
Removes every vertex and index, keeping the memory for the next mesh.
triangle
Adds a triangle of vertices that were added before, by index. A mesh built with
indices can only have 65536 vertices.
vertex
Adds a vertex and returns its index.
vertex_count
The number of vertices added so far.
// Model, meshes, materials and animation data.
+ struct Model {
// Bones animated transformation matrices.
+ bone_matrices: ?ptr
// Current animation pose (Transform[]).
+ current_pose: ?ptr
// Number of materials.
+ material_count: i32
// Materials array.
+ materials: ?ptr
// Number of meshes.
+ mesh_count: i32
// Mesh material number.
+ mesh_material: ?ptr
// Meshes array.
+ meshes: ?ptr
// Skeleton for animation.
+ skeleton: ModelSkeleton
// Local transform matrix.
+ transform: Matrix
// The number of materials.
+ get material_total: uint
// A copy of one of the model's meshes. Panics when there is no such mesh.
+ fn mesh(index: uint) Mesh
// The number of meshes.
+ get mesh_total: uint
// Set material for a mesh.
+ fn set_mesh_material(mesh_id: i32, material_id: i32) void
// Uses `shader` for one of the model's materials; the first by default.
+ fn set_shader(shader: Shader, material: uint (0)) void
// Sets a texture on one of the model's materials; the first by default. Does nothing when the model has no such material.
+ fn set_texture(texture: Texture, map: MaterialMapIndex (.albedo), material: uint (0)) void
}
Model
Model, meshes, materials and animation data.
bone_matrices
Bones animated transformation matrices.
current_pose
Current animation pose (Transform[]).
material_count
Number of materials.
materials
Materials array.
mesh_count
Number of meshes.
mesh_material
Mesh material number.
meshes
Meshes array.
skeleton
Skeleton for animation.
Local transform matrix.
material_total
The number of materials.
mesh
A copy of one of the model's meshes. Panics when there is no such mesh.
mesh_total
The number of meshes.
set_mesh_material
Set material for a mesh.
set_shader
Uses shader for one of the model's materials; the first by default.
set_texture
Sets a texture on one of the model's materials; the first by default. Does nothing
when the model has no such material.
// ModelAnimation, contains a full animation sequence.
+ struct ModelAnimation {
// Number of bones (per pose).
+ bone_count: i32
// Number of animation key frames.
+ keyframe_count: i32
// Animation sequence keyframe poses [keyframe][pose].
+ keyframe_poses: ?ptr
// Animation name.
+ name: [u8 x 32]
}
ModelAnimation
ModelAnimation, contains a full animation sequence.
bone_count
Number of bones (per pose).
keyframe_count
Number of animation key frames.
keyframe_poses
Animation sequence keyframe poses [keyframe][pose].
name
Animation name.
// Skeleton, animation bones hierarchy.
+ struct ModelSkeleton {
// Bones base transformation (Transform[]).
+ bind_pose: ?ptr
// Number of bones.
+ bone_count: i32
// Bones information (skeleton).
+ bones: ?ptr
}
ModelSkeleton
Skeleton, animation bones hierarchy.
bind_pose
Bones base transformation (Transform[]).
bone_count
Number of bones.
bones
Bones information (skeleton).
// Music, audio stream, anything longer than ~10 seconds should be streamed.
+ struct Music {
// Audio context data, depends on type.
+ ctx_data: ?ptr
// Type of music context (audio filetype).
+ ctx_type: i32
// Total number of frames (considering channels).
+ frame_count: u32
// Music looping enable.
+ looping: bool
// Audio stream.
+ stream: AudioStream
}
Music
Music, audio stream, anything longer than ~10 seconds should be streamed.
ctx_data
Audio context data, depends on type.
ctx_type
Type of music context (audio filetype).
frame_count
Total number of frames (considering channels).
looping
Music looping enable.
stream
Audio stream.
// NPatchInfo, n-patch layout info.
+ struct NPatchInfo {
// Bottom border offset.
+ bottom: i32
// Layout of the n-patch: 3x3, 1x3 or 3x1.
+ layout: i32
// Left border offset.
+ left: i32
// Right border offset.
+ right: i32
// Texture source rectangle.
+ source: Rectangle
// Top border offset.
+ top: i32
}
NPatchInfo
NPatchInfo, n-patch layout info.
bottom
Bottom border offset.
layout
Layout of the n-patch: 3x3, 1x3 or 3x1.
left
Left border offset.
right
Right border offset.
source
Texture source rectangle.
top
Top border offset.
// Ray, ray for raycasting.
+ struct Ray {
// Ray direction (normalized).
+ direction: Vector3
// Ray position (origin).
+ position: Vector3
}
Ray
Ray, ray for raycasting.
direction
Ray direction (normalized).
position
Ray position (origin).
// RayCollision, ray hit information.
+ struct RayCollision {
// Distance to the nearest hit.
+ distance: f32
// Did the ray hit something?.
+ hit: bool
// Surface normal of hit.
+ normal: Vector3
// Point of the nearest hit.
+ point: Vector3
}
RayCollision
RayCollision, ray hit information.
distance
Distance to the nearest hit.
hit
Did the ray hit something?.
normal
Surface normal of hit.
point
Point of the nearest hit.
// Rectangle, 4 components.
+ struct Rectangle {
// Rectangle height.
+ height: f32
// Rectangle width.
+ width: f32
// Rectangle top-left corner position x.
+ x: f32
// Rectangle top-left corner position y.
+ y: f32
}
Rectangle
Rectangle, 4 components.
height
Rectangle height.
width
Rectangle width.
x
Rectangle top-left corner position x.
y
Rectangle top-left corner position y.
// RenderTexture, fbo for texture rendering.
+ struct RenderTexture {
// Depth buffer attachment texture.
+ depth: Texture
// OpenGL framebuffer object id.
+ id: u32
// Color buffer attachment texture.
+ texture: Texture
}
RenderTexture
RenderTexture, fbo for texture rendering.
depth
Depth buffer attachment texture.
id
OpenGL framebuffer object id.
texture
Color buffer attachment texture.
// Shader.
+ struct Shader {
// Shader program id.
+ id: u32
// Shader locations array (RL_MAX_SHADER_LOCATIONS).
+ locs: ?ptr
// The location of a uniform, or -1 when the shader has none by that name.
+ fn location(uniform: String) i32
// Sets a `vec4` uniform to a color, each channel from 0 to 1.
+ fn set_color(location: i32, color: Color) void
// Sets a `float` uniform.
+ fn set_float(location: i32, value: f32) void
// Sets an `int` uniform.
+ fn set_int(location: i32, value: i32) void
// Points one of the locations raylib fills in by itself, e.g. `.matrix_model`, at a uniform of this shader.
+ fn set_location(index: ShaderLocationIndex, location: i32) void
// Sets a `mat4` uniform.
+ fn set_matrix(location: i32, value: Matrix) void
// Sets a `vec2` uniform.
+ fn set_vec2(location: i32, value: Vector2) void
// Sets a `vec3` uniform.
+ fn set_vec3(location: i32, value: Vector3) void
// Sets a `vec4` uniform.
+ fn set_vec4(location: i32, value: Vector4) void
}
Shader
Shader.
id
Shader program id.
locs
Shader locations array (RL_MAX_SHADER_LOCATIONS).
location
The location of a uniform, or -1 when the shader has none by that name.
set_color
Sets a vec4 uniform to a color, each channel from 0 to 1.
set_float
Sets a float uniform.
set_int
Sets an int uniform.
set_location
Points one of the locations raylib fills in by itself, e.g. .matrix_model, at a
uniform of this shader.
set_matrix
Sets a mat4 uniform.
set_vec2
Sets a vec2 uniform.
set_vec3
Sets a vec3 uniform.
set_vec4
Sets a vec4 uniform.
// Sound.
+ struct Sound {
// Total number of frames (considering channels).
+ frame_count: u32
// Audio stream.
+ stream: AudioStream
}
Sound
Sound.
frame_count
Total number of frames (considering channels).
stream
Audio stream.
// Texture, tex data stored in GPU memory (VRAM).
+ struct Texture {
// Data format (PixelFormat type).
+ format: i32
// Texture base height.
+ height: i32
// OpenGL texture id.
+ id: u32
// Mipmap levels, 1 by default.
+ mipmaps: i32
// Texture base width.
+ width: i32
// Generate GPU mipmaps for a texture.
+ fn gen_mipmaps() void
}
Texture
Texture, tex data stored in GPU memory (VRAM).
Data format (PixelFormat type).
height
Texture base height.
id
OpenGL texture id.
mipmaps
Mipmap levels, 1 by default.
width
Texture base width.
gen_mipmaps
Generate GPU mipmaps for a texture.
// Transform, vertex transformation data.
+ struct Transform {
// Rotation.
+ rotation: Vector4
// Scale.
+ scale: Vector3
// Translation.
+ translation: Vector3
}
Transform, vertex transformation data.
rotation
Rotation.
scale
Scale.
translation
Translation.
// Vector2, 2 components.
+ struct Vector2 {
// Vector x component.
+ x: f32
// Vector y component.
+ y: f32
// Adds the components: `a + b`.
+ fn add(other: Vector2) Vector2
// The distance between two points.
+ fn distance(other: Vector2) f32
// The dot product.
+ fn dot(other: Vector2) f32
// The length.
+ fn length() f32
// The squared length, cheaper when only comparing lengths.
+ fn length_sqr() f32
// The point `amount` of the way to `to`: 0 gives this vector, 1 gives `to`.
+ fn lerp(to: Vector2, amount: f32) Vector2
// Multiplies the components pairwise.
+ fn multiply(other: Vector2) Vector2
// The vector pointing the other way.
+ fn negate() Vector2
// The vector with length 1 in the same direction; a zero vector stays zero.
+ fn normalize() Vector2
// The vector rotated by `angle` radians.
+ fn rotate(angle: f32) Vector2
// Multiplies both components by `factor`.
+ fn scale(factor: f32) Vector2
// Subtracts the components: `a - b`.
+ fn sub(other: Vector2) Vector2
}
Vector2
Vector2, 2 components.
x
Vector x component.
y
Vector y component.
add
Adds the components: a + b.
distance
The distance between two points.
dot
The dot product.
length
The length.
length_sqr
The squared length, cheaper when only comparing lengths.
lerp
The point amount of the way to to: 0 gives this vector, 1 gives to.
multiply
Multiplies the components pairwise.
negate
The vector pointing the other way.
normalize
The vector with length 1 in the same direction; a zero vector stays zero.
rotate
The vector rotated by angle radians.
scale
Multiplies both components by factor.
sub
Subtracts the components: a - b.
// Vector3, 3 components.
+ struct Vector3 {
// Vector x component.
+ x: f32
// Vector y component.
+ y: f32
// Vector z component.
+ z: f32
// Adds the components: `a + b`.
+ fn add(other: Vector3) Vector3
// The cross product: perpendicular to both vectors.
+ fn cross(other: Vector3) Vector3
// The distance between two points.
+ fn distance(other: Vector3) f32
// The dot product.
+ fn dot(other: Vector3) f32
// The length.
+ fn length() f32
// The squared length, cheaper when only comparing lengths.
+ fn length_sqr() f32
// The point `amount` of the way to `to`: 0 gives this vector, 1 gives `to`.
+ fn lerp(to: Vector3, amount: f32) Vector3
// Multiplies the components pairwise.
+ fn multiply(other: Vector3) Vector3
// The vector pointing the other way.
+ fn negate() Vector3
// The vector with length 1 in the same direction; a zero vector stays zero.
+ fn normalize() Vector3
// The vector rotated `angle` radians around `axis` (Rodrigues' formula).
+ fn rotate_by_axis_angle(axis: Vector3, angle: f32) Vector3
// Multiplies every component by `factor`.
+ fn scale(factor: f32) Vector3
// Subtracts the components: `a - b`.
+ fn sub(other: Vector3) Vector3
// The point moved by a transform matrix.
+ fn transform(mat: Matrix) Vector3
}
Vector3
Vector3, 3 components.
x
Vector x component.
y
Vector y component.
z
Vector z component.
add
Adds the components: a + b.
cross
The cross product: perpendicular to both vectors.
distance
The distance between two points.
dot
The dot product.
length
The length.
length_sqr
The squared length, cheaper when only comparing lengths.
lerp
The point amount of the way to to: 0 gives this vector, 1 gives to.
multiply
Multiplies the components pairwise.
negate
The vector pointing the other way.
normalize
The vector with length 1 in the same direction; a zero vector stays zero.
rotate_by_axis_angle
The vector rotated angle radians around axis (Rodrigues' formula).
scale
Multiplies every component by factor.
sub
Subtracts the components: a - b.
The point moved by a transform matrix.
// Vector4, 4 components.
+ struct Vector4 {
// Vector w component.
+ w: f32
// Vector x component.
+ x: f32
// Vector y component.
+ y: f32
// Vector z component.
+ z: f32
// Adds the components: `a + b`.
+ fn add(other: Vector4) Vector4
// Multiplies every component by `factor`.
+ fn scale(factor: f32) Vector4
// Subtracts the components: `a - b`.
+ fn sub(other: Vector4) Vector4
}
Vector4
Vector4, 4 components.
w
Vector w component.
x
Vector x component.
y
Vector y component.
z
Vector z component.
add
Adds the components: a + b.
scale
Multiplies every component by factor.
sub
Subtracts the components: a - b.
// VrDeviceInfo, Head-Mounted-Display device parameters.
+ struct VrDeviceInfo {
// Chromatic aberration correction parameters.
+ chroma_ab_correction: [f32 x 4]
// Distance between eye and display in meters.
+ eye_to_screen_distance: f32
// Horizontal resolution in pixels.
+ h_resolution: i32
// Horizontal size in meters.
+ h_screen_size: f32
// IPD (distance between pupils) in meters.
+ interpupillary_distance: f32
// Lens distortion constant parameters.
+ lens_distortion_values: [f32 x 4]
// Lens separation distance in meters.
+ lens_separation_distance: f32
// Vertical resolution in pixels.
+ v_resolution: i32
// Vertical size in meters.
+ v_screen_size: f32
}
VrDeviceInfo
VrDeviceInfo, Head-Mounted-Display device parameters.
chroma_ab_correction
Chromatic aberration correction parameters.
eye_to_screen_distance
Distance between eye and display in meters.
h_resolution
Horizontal resolution in pixels.
h_screen_size
Horizontal size in meters.
interpupillary_distance
IPD (distance between pupils) in meters.
lens_distortion_values
Lens distortion constant parameters.
lens_separation_distance
Lens separation distance in meters.
v_resolution
Vertical resolution in pixels.
v_screen_size
Vertical size in meters.
// VrStereoConfig, VR stereo rendering configuration for simulator.
+ struct VrStereoConfig {
// VR left lens center.
+ left_lens_center: [f32 x 2]
// VR left screen center.
+ left_screen_center: [f32 x 2]
// VR projection matrices (per eye).
+ projection: [Matrix x 2]
// VR right lens center.
+ right_lens_center: [f32 x 2]
// VR right screen center.
+ right_screen_center: [f32 x 2]
// VR distortion scale.
+ scale: [f32 x 2]
// VR distortion scale in.
+ scale_in: [f32 x 2]
// VR view offset matrices (per eye).
+ view_offset: [Matrix x 2]
}
VrStereoConfig
VrStereoConfig, VR stereo rendering configuration for simulator.
left_lens_center
VR left lens center.
left_screen_center
VR left screen center.
projection
VR projection matrices (per eye).
right_lens_center
VR right lens center.
right_screen_center
VR right screen center.
scale
VR distortion scale.
scale_in
VR distortion scale in.
view_offset
VR view offset matrices (per eye).
// Wave, audio wave data.
+ struct Wave {
// Number of channels (1-mono, 2-stereo, ...).
+ channels: u32
// Buffer data pointer.
+ data: ?ptr
// Total number of frames (considering channels).
+ frame_count: u32
// Frequency (samples per second).
+ sample_rate: u32
// Bit depth (bits per sample): 8, 16, 32 (24 not supported).
+ sample_size: u32
// Convert wave data to desired format.
+ fn convert_format(sample_rate: i32, sample_size: i32, channels: i32) void
// Crop a wave to defined frames range.
+ fn crop(init_frame: i32, final_frame: i32) void
}
Wave
Wave, audio wave data.
channels
Number of channels (1-mono, 2-stereo, ...).
data
Buffer data pointer.
frame_count
Total number of frames (considering channels).
sample_rate
Frequency (samples per second).
sample_size
Bit depth (bits per sample): 8, 16, 32 (24 not supported).
Convert wave data to desired format.
crop
Crop a wave to defined frames range.