1139 lines
98 KiB
Core
1139 lines
98 KiB
Core
|
|
PI :: 3.14159265358979323846
|
|
DEG2RAD :: PI/180.0
|
|
RAD2DEG :: 180.0/PI
|
|
|
|
Vector2 :: struct
|
|
x: F32
|
|
y: F32
|
|
|
|
Vector3 :: struct
|
|
x: F32
|
|
y: F32
|
|
z: F32
|
|
|
|
Vector4 :: struct
|
|
x: F32
|
|
y: F32
|
|
z: F32
|
|
w: F32
|
|
|
|
Color :: struct
|
|
r: uchar
|
|
g: uchar
|
|
b: uchar
|
|
a: uchar
|
|
|
|
Rectangle :: struct
|
|
x: F32
|
|
y: F32
|
|
width: F32
|
|
height: F32
|
|
|
|
Image :: struct
|
|
data: *void
|
|
width: int
|
|
height: int
|
|
mipmaps: int
|
|
format: int
|
|
|
|
Texture :: struct
|
|
id: uint
|
|
width: int
|
|
height: int
|
|
mipmaps: int
|
|
format: int
|
|
|
|
Texture2D :: Texture
|
|
TextureCubemap :: Texture
|
|
|
|
RenderTexture :: struct
|
|
id: uint
|
|
texture: Texture
|
|
depth: Texture
|
|
|
|
RenderTexture2D :: RenderTexture
|
|
|
|
// N-Patch layout info
|
|
NPatchInfo :: struct
|
|
source: Rectangle // Texture source rectangle
|
|
left: int // Left border offset
|
|
top: int // Top border offset
|
|
right: int // Right border offset
|
|
bottom: int // Bottom border offset
|
|
layout: NPatchLayout // Layout of the n-patch: 3x3 1x3 or 3x1
|
|
|
|
// Font character info
|
|
GlyphInfo :: struct
|
|
value: rune // Character value (Unicode)
|
|
offsetX: int // Character offset X when drawing
|
|
offsetY: int // Character offset Y when drawing
|
|
advanceX: int // Character advance position X
|
|
image: Image // Character image data
|
|
|
|
// Font type includes texture and charSet array data
|
|
Font :: struct
|
|
baseSize: int // Base size (default chars height)
|
|
charsCount: int // Number of characters
|
|
charsPadding: int // Padding around the chars
|
|
texture: Texture2D // Characters texture atlas
|
|
recs: *Rectangle // Characters rectangles in texture
|
|
chars: *GlyphInfo // Characters info data
|
|
|
|
// Camera type defines a camera position/orientation in 3d space
|
|
Camera3D :: struct
|
|
position: Vector3 // Camera position
|
|
target: Vector3 // Camera target it looks-at
|
|
up: Vector3 // Camera up vector (rotation over its axis)
|
|
fovy: F32 // Camera field-of-view apperture in Y (degrees) in perspective used as near plane width in orthographic
|
|
projection: CameraProjection // Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
|
|
|
|
Camera :: Camera3D // Camera type fallback defaults to Camera3D
|
|
|
|
// Camera2D type defines a 2d camera
|
|
Camera2D :: struct
|
|
offset: Vector2 // Camera offset (displacement from target)
|
|
target: Vector2 // Camera target (rotation and zoom origin)
|
|
rotation: F32 // Camera rotation in degrees
|
|
zoom: F32 // Camera zoom (scaling) should be 1.0f by default
|
|
|
|
// Vertex data definning a mesh
|
|
// NOTE: Data stored in CPU memory (and GPU)
|
|
Mesh :: struct
|
|
vertexCount: int // Number of vertices stored in arrays
|
|
triangleCount: int // Number of triangles stored (indexed or not)
|
|
|
|
// Default vertex data
|
|
vertices: *F32 // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
|
|
texcoords: *F32 // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
|
|
texcoords2: *F32 // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)
|
|
normals: *F32 // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
|
|
tangents: *F32 // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
|
|
colors: *U8 // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
|
|
indices: *U16 // Vertex indices (in case vertex data comes indexed)
|
|
|
|
// Animation vertex data
|
|
animVertices: *F32 // Animated vertex positions (after bones transformations)
|
|
animNormals: *F32 // Animated normals (after bones transformations)
|
|
boneIds: *U8 // Vertex bone ids up to 4 bones influence by vertex (skinning)
|
|
boneWeights: *F32 // Vertex bone weight up to 4 bones influence by vertex (skinning)
|
|
|
|
// OpenGL identifiers
|
|
vaoId: U32 // OpenGL Vertex Array Object id
|
|
vboId: *U32 // OpenGL Vertex Buffer Objects id (default vertex data)
|
|
|
|
// Shader type (generic)
|
|
Shader :: struct
|
|
id: uint // Shader program id
|
|
locs: *int // Shader locations array (MAX_SHADER_LOCATIONS)
|
|
|
|
// Material texture map
|
|
MaterialMap :: struct
|
|
texture: Texture2D // Material map texture
|
|
color: Color // Material map color
|
|
value: F32 // Material map value
|
|
|
|
// Material type (generic)
|
|
Material :: struct
|
|
shader: Shader // Material shader
|
|
maps: *MaterialMap // Material maps array (MAX_MATERIAL_MAPS)
|
|
params: [4]F32 // Material generic parameters (if required)
|
|
|
|
// Transformation properties
|
|
Transform :: struct
|
|
translation: Vector3 // Translation
|
|
rotation: Quaternion // Rotation
|
|
scale: Vector3 // Scale
|
|
|
|
// Bone information
|
|
BoneInfo :: struct
|
|
name: [32]char // Bone name
|
|
parent: int // Bone parent
|
|
|
|
// Model type
|
|
Model :: struct
|
|
transform: Matrix // Local transform matrix
|
|
|
|
meshCount: int // Number of meshes
|
|
materialCount: int // Number of materials
|
|
meshes: *Mesh // Meshes array
|
|
materials: *Material // Materials array
|
|
meshMaterial: *int // Mesh material number
|
|
|
|
// Animation data
|
|
boneCount: int // Number of bones
|
|
bones: *BoneInfo // Bones information (skeleton)
|
|
bindPose: *Transform // Bones base transformation (pose)
|
|
|
|
// Model animation
|
|
ModelAnimation :: struct
|
|
boneCount: int // Number of bones
|
|
frameCount: int // Number of animation frames
|
|
bones: *BoneInfo // Bones information (skeleton)
|
|
framePoses: **Transform // Poses array by frame
|
|
|
|
// Ray type (useful for raycast)
|
|
Ray :: struct
|
|
position: Vector3 // Ray position (origin)
|
|
direction: Vector3 // Ray direction
|
|
|
|
// RayCollision ray hit information
|
|
RayCollision :: struct
|
|
hit: bool // Did the ray hit something?
|
|
distance: F32 // Distance to nearest hit
|
|
point: Vector3 // Point of nearest hit
|
|
normal: Vector3 // Surface normal of hit
|
|
|
|
// Bounding box type
|
|
BoundingBox :: struct
|
|
min: Vector3 // Minimum vertex box-corner
|
|
max: Vector3 // Maximum vertex box-corner
|
|
|
|
// Wave type defines audio wave data
|
|
Wave :: struct
|
|
frameCount: uint // Total number of frames (considering channels)
|
|
sampleRate: uint // Frequency (samples per second)
|
|
sampleSize: uint // Bit depth (bits per sample): 8 16 32 (24 not supported)
|
|
channels: uint // Number of channels (1-mono 2-stereo)
|
|
data: *void // Buffer data pointer
|
|
|
|
// Audio stream type
|
|
// NOTE: Actual structs are defined internally in raudio module
|
|
AudioStream :: struct
|
|
buffer: *void // Pointer to internal data used by the audio system
|
|
processor: *void // Pointer to internal data processor useful for audio effects
|
|
|
|
sampleRate: uint // Frequency (samples per second)
|
|
sampleSize: uint // Bit depth (bits per sample): 8 16 32 (24 not supported)
|
|
channels: uint // Number of channels (1-mono 2-stereo)
|
|
|
|
// Sound source type
|
|
Sound :: struct
|
|
stream: AudioStream // Audio stream
|
|
frameCount: uint // Total number of frames (considering channels)
|
|
|
|
// Music stream type (audio file streaming from memory)
|
|
// NOTE: Anything longer than ~10 seconds should be streamed
|
|
Music :: struct
|
|
stream: AudioStream // Audio stream
|
|
frameCount: uint // Total number of frames (considering channels)
|
|
looping: bool // Music looping enable
|
|
|
|
ctxType: int // Type of music context (audio filetype)
|
|
ctxData: *void // Audio context data depends on type
|
|
|
|
// Head-Mounted-Display device parameters
|
|
VrDeviceInfo :: struct
|
|
hResolution: int // Horizontal resolution in pixels
|
|
vResolution: int // Vertical resolution in pixels
|
|
hScreenSize: F32 // Horizontal size in meters
|
|
vScreenSize: F32 // Vertical size in meters
|
|
vScreenCenter: F32 // Screen center in meters
|
|
eyeToScreenDistance: F32 // Distance between eye and display in meters
|
|
lensSeparationDistance: F32 // Lens separation distance in meters
|
|
interpupillaryDistance: F32 // IPD (distance between pupils) in meters
|
|
lensDistortionValues: [4]F32 // Lens distortion constant parameters
|
|
chromaAbCorrection: [4]F32 // Chromatic aberration correction parameters
|
|
|
|
// VR Stereo rendering configuration for simulator
|
|
VrStereoConfig :: struct
|
|
projection: [2]Matrix // VR projection matrices (per eye)
|
|
viewOffset: [2]Matrix // VR view offset matrices (per eye)
|
|
leftLensCenter: [2]F32 // VR left lens center
|
|
rightLensCenter: [2]F32 // VR right lens center
|
|
leftScreenCenter: [2]F32 // VR left screen center
|
|
rightScreenCenter: [2]F32 // VR right screen center
|
|
scale: [2]F32 // VR distortion scale
|
|
scaleIn: [2]F32 // VR distortion scale in
|
|
|
|
// File path list
|
|
FilePathList :: struct
|
|
capacity: uint // Filepaths max entries
|
|
count: uint // Filepaths entries count
|
|
paths: **char // Filepaths entries
|
|
|
|
// Some Basic Colors
|
|
// NOTE: Custom raylib color palette for amazing visuals on WHITE background
|
|
LIGHTGRAY := Color{ 200, 200, 200, 255 } // Light Gray
|
|
GRAY := Color{ 130, 130, 130, 255 } // Gray
|
|
DARKGRAY := Color{ 80, 80, 80, 255 } // Dark Gray
|
|
YELLOW := Color{ 253, 249, 0, 255 } // Yellow
|
|
GOLD := Color{ 255, 203, 0, 255 } // Gold
|
|
ORANGE := Color{ 255, 161, 0, 255 } // Orange
|
|
PINK := Color{ 255, 109, 194, 255 } // Pink
|
|
RED := Color{ 230, 41, 55, 255 } // Red
|
|
MAROON := Color{ 190, 33, 55, 255 } // Maroon
|
|
GREEN := Color{ 0, 228, 48, 255 } // Green
|
|
LIME := Color{ 0, 158, 47, 255 } // Lime
|
|
DARKGREEN := Color{ 0, 117, 44, 255 } // Dark Green
|
|
SKYBLUE := Color{ 102, 191, 255, 255 } // Sky Blue
|
|
BLUE := Color{ 0, 121, 241, 255 } // Blue
|
|
DARKBLUE := Color{ 0, 82, 172, 255 } // Dark Blue
|
|
PURPLE := Color{ 200, 122, 255, 255 } // Purple
|
|
VIOLET := Color{ 135, 60, 190, 255 } // Violet
|
|
DARKPURPLE := Color{ 112, 31, 126, 255 } // Dark Purple
|
|
BEIGE := Color{ 211, 176, 131, 255 } // Beige
|
|
BROWN := Color{ 127, 106, 79, 255 } // Brown
|
|
DARKBROWN := Color{ 76, 63, 47, 255 } // Dark Brown
|
|
WHITE := Color{ 255, 255, 255, 255 } // White
|
|
BLACK := Color{ 0, 0, 0, 255 } // Black
|
|
BLANK := Color{ 0, 0, 0, 0 } // Blank (Transparent)
|
|
MAGENTA := Color{ 255, 0, 255, 255 } // Magenta
|
|
RAYWHITE := Color{ 245, 245, 245, 255 } // My own White (raylib logo)
|
|
|
|
FLAG_VSYNC_HINT :: 0x00000040 // Set to try enabling V-Sync on GPU
|
|
FLAG_FULLSCREEN_MODE :: 0x00000002 // Set to run program in fullscreen
|
|
FLAG_WINDOW_RESIZABLE :: 0x00000004 // Set to allow resizable window
|
|
FLAG_WINDOW_UNDECORATED :: 0x00000008 // Set to disable window decoration (frame and buttons)
|
|
FLAG_WINDOW_HIDDEN :: 0x00000080 // Set to hide window
|
|
FLAG_WINDOW_MINIMIZED :: 0x00000200 // Set to minimize window (iconify)
|
|
FLAG_WINDOW_MAXIMIZED :: 0x00000400 // Set to maximize window (expanded to monitor)
|
|
FLAG_WINDOW_UNFOCUSED :: 0x00000800 // Set to window non focused
|
|
FLAG_WINDOW_TOPMOST :: 0x00001000 // Set to window always on top
|
|
FLAG_WINDOW_ALWAYS_RUN :: 0x00000100 // Set to allow windows running while minimized
|
|
FLAG_WINDOW_TRANSPARENT :: 0x00000010 // Set to allow transparent framebuffer
|
|
FLAG_WINDOW_HIGHDPI :: 0x00002000 // Set to support HighDPI
|
|
FLAG_WINDOW_MOUSE_PASSTHROUGH :: 0x00004000 // Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED
|
|
FLAG_MSAA_4X_HINT :: 0x00000020 // Set to try enabling MSAA 4X
|
|
FLAG_INTERLACED_HINT :: 0x00010000 // Set to try enabling interlaced video format (for V3D)
|
|
|
|
LOG_ALL :: 0 // Display all logs
|
|
LOG_TRACE :: 1 // Trace logging, intended for internal use only
|
|
LOG_DEBUG :: 2 // Debug logging, used for internal debugging, it should be disabled on release builds
|
|
LOG_INFO :: 3 // Info logging, used for program execution info
|
|
LOG_WARNING :: 4 // Warning logging, used on recoverable failures
|
|
LOG_ERROR :: 5 // Error logging, used on unrecoverable failures
|
|
LOG_FATAL :: 6 // Fatal logging, used to abort program: exit(EXIT_FAILURE)
|
|
LOG_NONE :: 7 // Disable logging
|
|
|
|
KEY_NULL :: 0 // Key: NULL, used for no key pressed
|
|
// Alphanumeric keys
|
|
KEY_APOSTROPHE :: 39 // Key: '
|
|
KEY_COMMA :: 44 // Key: ,
|
|
KEY_MINUS :: 45 // Key: -
|
|
KEY_PERIOD :: 46 // Key: .
|
|
KEY_SLASH :: 47 // Key: /
|
|
KEY_ZERO :: 48 // Key: 0
|
|
KEY_ONE :: 49 // Key: 1
|
|
KEY_TWO :: 50 // Key: 2
|
|
KEY_THREE :: 51 // Key: 3
|
|
KEY_FOUR :: 52 // Key: 4
|
|
KEY_FIVE :: 53 // Key: 5
|
|
KEY_SIX :: 54 // Key: 6
|
|
KEY_SEVEN :: 55 // Key: 7
|
|
KEY_EIGHT :: 56 // Key: 8
|
|
KEY_NINE :: 57 // Key: 9
|
|
KEY_SEMICOLON :: 59 // Key: ;
|
|
KEY_EQUAL :: 61 // Key: ::
|
|
KEY_A :: 65 // Key: A | a
|
|
KEY_B :: 66 // Key: B | b
|
|
KEY_C :: 67 // Key: C | c
|
|
KEY_D :: 68 // Key: D | d
|
|
KEY_E :: 69 // Key: E | e
|
|
KEY_F :: 70 // Key: F | f
|
|
KEY_G :: 71 // Key: G | g
|
|
KEY_H :: 72 // Key: H | h
|
|
KEY_I :: 73 // Key: I | i
|
|
KEY_J :: 74 // Key: J | j
|
|
KEY_K :: 75 // Key: K | k
|
|
KEY_L :: 76 // Key: L | l
|
|
KEY_M :: 77 // Key: M | m
|
|
KEY_N :: 78 // Key: N | n
|
|
KEY_O :: 79 // Key: O | o
|
|
KEY_P :: 80 // Key: P | p
|
|
KEY_Q :: 81 // Key: Q | q
|
|
KEY_R :: 82 // Key: R | r
|
|
KEY_S :: 83 // Key: S | s
|
|
KEY_T :: 84 // Key: T | t
|
|
KEY_U :: 85 // Key: U | u
|
|
KEY_V :: 86 // Key: V | v
|
|
KEY_W :: 87 // Key: W | w
|
|
KEY_X :: 88 // Key: X | x
|
|
KEY_Y :: 89 // Key: Y | y
|
|
KEY_Z :: 90 // Key: Z | z
|
|
KEY_LEFT_BRACKET :: 91 // Key: [
|
|
KEY_BACKSLASH :: 92 // Key: '\'
|
|
KEY_RIGHT_BRACKET :: 93 // Key: ]
|
|
KEY_GRAVE :: 96 // Key: `
|
|
// Function keys
|
|
KEY_SPACE :: 32 // Key: Space
|
|
KEY_ESCAPE :: 256 // Key: Esc
|
|
KEY_ENTER :: 257 // Key: Enter
|
|
KEY_TAB :: 258 // Key: Tab
|
|
KEY_BACKSPACE :: 259 // Key: Backspace
|
|
KEY_INSERT :: 260 // Key: Ins
|
|
KEY_DELETE :: 261 // Key: Del
|
|
KEY_RIGHT :: 262 // Key: Cursor right
|
|
KEY_LEFT :: 263 // Key: Cursor left
|
|
KEY_DOWN :: 264 // Key: Cursor down
|
|
KEY_UP :: 265 // Key: Cursor up
|
|
KEY_PAGE_UP :: 266 // Key: Page up
|
|
KEY_PAGE_DOWN :: 267 // Key: Page down
|
|
KEY_HOME :: 268 // Key: Home
|
|
KEY_END :: 269 // Key: End
|
|
KEY_CAPS_LOCK :: 280 // Key: Caps lock
|
|
KEY_SCROLL_LOCK :: 281 // Key: Scroll down
|
|
KEY_NUM_LOCK :: 282 // Key: Num lock
|
|
KEY_PRINT_SCREEN :: 283 // Key: Print screen
|
|
KEY_PAUSE :: 284 // Key: Pause
|
|
KEY_F1 :: 290 // Key: F1
|
|
KEY_F2 :: 291 // Key: F2
|
|
KEY_F3 :: 292 // Key: F3
|
|
KEY_F4 :: 293 // Key: F4
|
|
KEY_F5 :: 294 // Key: F5
|
|
KEY_F6 :: 295 // Key: F6
|
|
KEY_F7 :: 296 // Key: F7
|
|
KEY_F8 :: 297 // Key: F8
|
|
KEY_F9 :: 298 // Key: F9
|
|
KEY_F10 :: 299 // Key: F10
|
|
KEY_F11 :: 300 // Key: F11
|
|
KEY_F12 :: 301 // Key: F12
|
|
KEY_LEFT_SHIFT :: 340 // Key: Shift left
|
|
KEY_LEFT_CONTROL :: 341 // Key: Control left
|
|
KEY_LEFT_ALT :: 342 // Key: Alt left
|
|
KEY_LEFT_SUPER :: 343 // Key: Super left
|
|
KEY_RIGHT_SHIFT :: 344 // Key: Shift right
|
|
KEY_RIGHT_CONTROL :: 345 // Key: Control right
|
|
KEY_RIGHT_ALT :: 346 // Key: Alt right
|
|
KEY_RIGHT_SUPER :: 347 // Key: Super right
|
|
KEY_KB_MENU :: 348 // Key: KB menu
|
|
// Keypad keys
|
|
KEY_KP_0 :: 320 // Key: Keypad 0
|
|
KEY_KP_1 :: 321 // Key: Keypad 1
|
|
KEY_KP_2 :: 322 // Key: Keypad 2
|
|
KEY_KP_3 :: 323 // Key: Keypad 3
|
|
KEY_KP_4 :: 324 // Key: Keypad 4
|
|
KEY_KP_5 :: 325 // Key: Keypad 5
|
|
KEY_KP_6 :: 326 // Key: Keypad 6
|
|
KEY_KP_7 :: 327 // Key: Keypad 7
|
|
KEY_KP_8 :: 328 // Key: Keypad 8
|
|
KEY_KP_9 :: 329 // Key: Keypad 9
|
|
KEY_KP_DECIMAL :: 330 // Key: Keypad .
|
|
KEY_KP_DIVIDE :: 331 // Key: Keypad /
|
|
KEY_KP_MULTIPLY :: 332 // Key: Keypad *
|
|
KEY_KP_SUBTRACT :: 333 // Key: Keypad -
|
|
KEY_KP_ADD :: 334 // Key: Keypad +
|
|
KEY_KP_ENTER :: 335 // Key: Keypad Enter
|
|
KEY_KP_EQUAL :: 336 // Key: Keypad ::
|
|
// Android key buttons
|
|
KEY_BACK :: 4 // Key: Android back button
|
|
KEY_MENU :: 82 // Key: Android menu button
|
|
KEY_VOLUME_UP :: 24 // Key: Android volume up button
|
|
KEY_VOLUME_DOWN :: 25 // Key: Android volume down button
|
|
|
|
|
|
MOUSE_BUTTON_LEFT :: 0 // Mouse button left
|
|
MOUSE_BUTTON_RIGHT :: 1 // Mouse button right
|
|
MOUSE_BUTTON_MIDDLE :: 2 // Mouse button middle (pressed wheel)
|
|
MOUSE_BUTTON_SIDE :: 3 // Mouse button side (advanced mouse device)
|
|
MOUSE_BUTTON_EXTRA :: 4 // Mouse button extra (advanced mouse device)
|
|
MOUSE_BUTTON_FORWARD :: 5 // Mouse button forward (advanced mouse device)
|
|
MOUSE_BUTTON_BACK :: 6 // Mouse button back (advanced mouse device)
|
|
|
|
|
|
InitWindow :: #foreign (width: int, height: int, title: *char) // Initialize window and OpenGL context
|
|
WindowShouldClose :: #foreign (): bool // Check if KEY_ESCAPE pressed or Close icon pressed
|
|
CloseWindow :: #foreign () // Close window and unload OpenGL context
|
|
IsWindowReady :: #foreign (): bool // Check if window has been initialized successfully
|
|
IsWindowFullscreen :: #foreign (): bool // Check if window is currently fullscreen
|
|
IsWindowHidden :: #foreign (): bool // Check if window is currently hidden (only PLATFORM_DESKTOP)
|
|
IsWindowMinimized :: #foreign (): bool // Check if window is currently minimized (only PLATFORM_DESKTOP)
|
|
IsWindowMaximized :: #foreign (): bool // Check if window is currently maximized (only PLATFORM_DESKTOP)
|
|
IsWindowFocused :: #foreign (): bool // Check if window is currently focused (only PLATFORM_DESKTOP)
|
|
IsWindowResized :: #foreign (): bool // Check if window has been resized last frame
|
|
IsWindowState :: #foreign (flag: ConfigFlag): bool // Check if one specific window flag is enabled
|
|
SetWindowState :: #foreign (flags: ConfigFlags) // Set window configuration state using flags (only PLATFORM_DESKTOP)
|
|
ClearWindowState :: #foreign (flags: ConfigFlags) // Clear window configuration state flags
|
|
ToggleFullscreen :: #foreign () // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)
|
|
MaximizeWindow :: #foreign () // Set window state: maximized, if resizable (only PLATFORM_DESKTOP)
|
|
MinimizeWindow :: #foreign () // Set window state: minimized, if resizable (only PLATFORM_DESKTOP)
|
|
RestoreWindow :: #foreign () // Set window state: not minimized/maximized (only PLATFORM_DESKTOP)
|
|
SetWindowIcon :: #foreign (image: Image) // Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP)
|
|
SetWindowIcons :: #foreign (images: *Image, count: int) // Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)
|
|
SetWindowTitle :: #foreign (title: *char) // Set title for window (only PLATFORM_DESKTOP)
|
|
SetWindowPosition :: #foreign (x: int, y: int) // Set window position on screen (only PLATFORM_DESKTOP)
|
|
SetWindowMonitor :: #foreign (monitor: int) // Set monitor for the current window (fullscreen mode)
|
|
SetWindowMinSize :: #foreign (width: int, height: int) // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
|
|
SetWindowSize :: #foreign (width: int, height: int) // Set window dimensions
|
|
SetWindowOpacity :: #foreign (opacity: F32) // Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)
|
|
GetWindowHandle :: #foreign (): *void // Get native window handle
|
|
GetScreenWidth :: #foreign (): int // Get current screen width
|
|
GetScreenHeight :: #foreign (): int // Get current screen height
|
|
GetRenderWidth :: #foreign (): int // Get current render width (it considers HiDPI)
|
|
GetRenderHeight :: #foreign (): int // Get current render height (it considers HiDPI)
|
|
GetMonitorCount :: #foreign (): int // Get number of connected monitors
|
|
GetCurrentMonitor :: #foreign (): int // Get current connected monitor
|
|
GetMonitorPosition :: #foreign (monitor: int): Vector2 // Get specified monitor position
|
|
GetMonitorWidth :: #foreign (monitor: int): int // Get specified monitor width (current video mode used by monitor)
|
|
GetMonitorHeight :: #foreign (monitor: int): int // Get specified monitor height (current video mode used by monitor)
|
|
GetMonitorPhysicalWidth :: #foreign (monitor: int): int // Get specified monitor physical width in millimetres
|
|
GetMonitorPhysicalHeight :: #foreign (monitor: int): int // Get specified monitor physical height in millimetres
|
|
GetMonitorRefreshRate :: #foreign (monitor: int): int // Get specified monitor refresh rate
|
|
GetWindowPosition :: #foreign (): Vector2 // Get window position XY on monitor
|
|
GetWindowScaleDPI :: #foreign (): Vector2 // Get window scale DPI factor
|
|
GetMonitorName :: #foreign (monitor: int): *char // Get the human-readable, UTF-8 encoded name of the primary monitor
|
|
SetClipboardText :: #foreign (text: *char) // Set clipboard text content
|
|
GetClipboardText :: #foreign (): *char // Get clipboard text content
|
|
EnableEventWaiting :: #foreign () // Enable waiting for events on EndDrawing(), no automatic event polling
|
|
DisableEventWaiting :: #foreign () // Disable waiting for events on EndDrawing(), automatic events polling
|
|
|
|
|
|
// Custom frame control functions
|
|
// NOTE: Those functions are intended for advance users that want full control over the frame processing
|
|
// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents()
|
|
// To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL
|
|
|
|
SwapScreenBuffer :: #foreign () // Swap back buffer with front buffer (screen drawing)
|
|
PollInputEvents :: #foreign () // Register all input events
|
|
WaitTime :: #foreign (seconds: F64) // Wait for some time (halt program execution)
|
|
|
|
|
|
// Cursor-related functions
|
|
|
|
ShowCursor :: #foreign () // Shows cursor
|
|
HideCursor :: #foreign () // Hides cursor
|
|
IsCursorHidden :: #foreign (): bool // Check if cursor is not visible
|
|
EnableCursor :: #foreign () // Enables cursor (unlock cursor)
|
|
DisableCursor :: #foreign () // Disables cursor (lock cursor)
|
|
IsCursorOnScreen :: #foreign (): bool // Check if cursor is on the current screen.
|
|
|
|
// Drawing-related functions
|
|
|
|
ClearBackground :: #foreign (color: Color) // Set background color (framebuffer clear color)
|
|
BeginDrawing :: #foreign () // Setup canvas (framebuffer) to start drawing
|
|
EndDrawing :: #foreign () // End canvas drawing and swap buffers (double buffering)
|
|
BeginMode2D :: #foreign (camera: Camera2D) // Initialize 2D mode with custom camera (2D)
|
|
EndMode2D :: #foreign () // Ends 2D mode with custom camera
|
|
BeginMode3D :: #foreign (camera: Camera3D) // Initializes 3D mode with custom camera (3D)
|
|
EndMode3D :: #foreign () // Ends 3D mode and returns to default 2D orthographic mode
|
|
BeginTextureMode :: #foreign (target: RenderTexture2D) // Initializes render texture for drawing
|
|
EndTextureMode :: #foreign () // Ends drawing to render texture
|
|
BeginShaderMode :: #foreign (shader: Shader) // Begin custom shader drawing
|
|
EndShaderMode :: #foreign () // End custom shader drawing (use default shader)
|
|
BeginBlendMode :: #foreign (mode: BlendMode) // Begin blending mode (alpha, additive, multiplied)
|
|
EndBlendMode :: #foreign () // End blending mode (reset to default: alpha blending)
|
|
BeginScissorMode :: #foreign (x: int, y: int, width: int, height: int) // Begin scissor mode (define screen area for following drawing)
|
|
EndScissorMode :: #foreign () // End scissor mode
|
|
BeginVrStereoMode :: #foreign (config: VrStereoConfig) // Begin stereo rendering (requires VR simulator)
|
|
EndVrStereoMode :: #foreign () // End stereo rendering (requires VR simulator)
|
|
|
|
// VR stereo config functions for VR simulator
|
|
|
|
// LoadVrStereoConfig :: #foreign (device: VrDeviceInfo): VrStereoConfig // Load VR stereo config for VR simulator device parameters
|
|
// UnloadVrStereoConfig :: #foreign (config: VrStereoConfig) // Unload VR stereo config
|
|
|
|
// Shader management functions
|
|
// NOTE: Shader functionality is not available on OpenGL 1.1
|
|
|
|
LoadShader :: #foreign (vsFileName: *char, fsFileName: *char): Shader // Load shader from files and bind default locations
|
|
LoadShaderFromMemory :: #foreign (vsCode: *char, fsCode: *char): Shader // Load shader from code strings and bind default locations
|
|
IsShaderReady :: #foreign (shader: Shader): bool // Check if a shader is ready
|
|
GetShaderLocation :: #foreign (shader: Shader, uniformName: *char): int // Get shader uniform location
|
|
GetShaderLocationAttrib :: #foreign (shader: Shader, attribName: *char): int // Get shader attribute location
|
|
SetShaderValue :: #foreign (shader: Shader, locIndex: ShaderLocationIndex, value: *void, uniformType: ShaderUniformDataType) // Set shader uniform value
|
|
SetShaderValueV :: #foreign (shader: Shader, locIndex: ShaderLocationIndex, value: *void, uniformType: ShaderUniformDataType, count: int) // Set shader uniform value vector
|
|
SetShaderValueMatrix :: #foreign (shader: Shader, locIndex: ShaderLocationIndex, mat: Matrix) // Set shader uniform value (matrix 4x4)
|
|
SetShaderValueTexture :: #foreign (shader: Shader, locIndex: ShaderLocationIndex, texture: Texture2D) // Set shader uniform value for texture (sampler2d)
|
|
UnloadShader :: #foreign (shader: Shader) // Unload shader from GPU memory (VRAM)
|
|
|
|
// Screen-space-related functions
|
|
|
|
GetMouseRay :: #foreign (mousePosition: Vector2, camera: Camera): Ray // Get a ray trace from mouse position
|
|
GetCameraMatrix :: #foreign (camera: Camera): Matrix // Get camera transform matrix (view matrix)
|
|
GetCameraMatrix2D :: #foreign (camera: Camera2D): Matrix // Get camera 2d transform matrix
|
|
GetWorldToScreen :: #foreign (position: Vector3, camera: Camera): Vector2 // Get the screen space position for a 3d world space position
|
|
GetScreenToWorld2D :: #foreign (position: Vector2, camera: Camera2D): Vector2 // Get the world space position for a 2d camera screen space position
|
|
GetWorldToScreenEx :: #foreign (position: Vector3, camera: Camera, width: int, height: int): Vector2 // Get size position for a 3d world space position
|
|
GetWorldToScreen2D :: #foreign (position: Vector2, camera: Camera2D): Vector2 // Get the screen space position for a 2d camera world space position
|
|
|
|
// Timing-related functions
|
|
|
|
SetTargetFPS :: #foreign (fps: int) // Set target FPS (maximum)
|
|
GetFPS :: #foreign (): int // Returns current FPS
|
|
GetFrameTime :: #foreign (): F32 // Returns time in seconds for last frame drawn (delta time)
|
|
GetTime :: #foreign (): F64 // Returns elapsed time in seconds since InitWindow()
|
|
|
|
// Misc. functions
|
|
|
|
GetRandomValue :: #foreign (min: int, max: int): int // Returns a random value between min and max (both included)
|
|
SetRandomSeed :: #foreign (seed: uint) // Set the seed for the random number generator
|
|
TakeScreenshot :: #foreign (fileName: *char) // Takes a screenshot of current screen (filename extension defines format)
|
|
SetConfigFlags :: #foreign (flags: ConfigFlags) // Setup init configuration flags (view FLAGS)
|
|
|
|
TraceLog :: #foreign (logLevel: TraceLogLevel, text: *char, ...) // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR)
|
|
SetTraceLogLevel :: #foreign (logLevel: TraceLogLevel) // Set the current threshold (minimum) log level
|
|
MemAlloc :: #foreign (size: uint): *void // Internal memory allocator
|
|
MemRealloc :: #foreign (ptr: *void, size: uint): *void // Internal memory reallocator
|
|
MemFree :: #foreign (ptr: *void) // Internal memory free
|
|
|
|
OpenURL :: #foreign (url: *char) // Open URL with default system browser (if available)
|
|
|
|
// Set custom callbacks
|
|
// WARNING: Callbacks setup is intended for advance users
|
|
|
|
SetTraceLogCallback :: #foreign (callback: TraceLogCallback) // Set custom trace log
|
|
SetLoadFileDataCallback :: #foreign (callback: LoadFileDataCallback) // Set custom file binary data loader
|
|
SetSaveFileDataCallback :: #foreign (callback: SaveFileDataCallback) // Set custom file binary data saver
|
|
SetLoadFileTextCallback :: #foreign (callback: LoadFileTextCallback) // Set custom file text data loader
|
|
SetSaveFileTextCallback :: #foreign (callback: SaveFileTextCallback) // Set custom file text data saver
|
|
|
|
// Files management functions
|
|
|
|
LoadFileData :: #foreign (fileName: *char, bytesRead: *uint): *uchar // Load file data as byte array (read)
|
|
UnloadFileData :: #foreign (data: *uchar) // Unload file data allocated by LoadFileData()
|
|
SaveFileData :: #foreign (fileName: *char, data: *void, bytesToWrite: uint): bool // Save data to file from byte array (write), returns true on success
|
|
ExportDataAsCode :: #foreign (data: *void, size: uint, fileName: *char): bool // Export data to code (.h), returns true on success
|
|
LoadFileText :: #foreign (fileName: *char): *uchar // Load text data from file (read), returns a '\0' terminated string
|
|
UnloadFileText :: #foreign (text: *uchar) // Unload file text data allocated by LoadFileText()
|
|
SaveFileText :: #foreign (fileName: *char, text: *uchar): bool // Save text data to file (write), string must be '\0' terminated, returns true on success
|
|
FileExists :: #foreign (fileName: *char): bool // Check if file exists
|
|
DirectoryExists :: #foreign (dirPath: *char): bool // Check if a directory path exists
|
|
IsFileExtension :: #foreign (fileName: *char, ext: *char): bool // Check file extension (including point: .png, .wav)
|
|
GetFileLength :: #foreign (fileName: *char): int // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)
|
|
GetFileExtension :: #foreign (fileName: *char): *char // Get pointer to extension for a filename string (includes dot: '.png')
|
|
GetFileName :: #foreign (filePath: *char): *char // Get pointer to filename for a path string
|
|
GetFileNameWithoutExt :: #foreign (filePath: *char): *char // Get filename string without extension (uses static string)
|
|
GetDirectoryPath :: #foreign (filePath: *char): *char // Get full path for a given fileName with path (uses static string)
|
|
GetPrevDirectoryPath :: #foreign (dirPath: *char): *char // Get previous directory path for a given path (uses static string)
|
|
GetWorkingDirectory :: #foreign (): *char // Get current working directory (uses static string)
|
|
GetApplicationDirectory :: #foreign (): *char // Get the directory if the running application (uses static string)
|
|
ChangeDirectory :: #foreign (dir: *char): bool // Change working directory, return true on success
|
|
IsPathFile :: #foreign (path: *char): bool // Check if a given path is a file or a directory
|
|
LoadDirectoryFiles :: #foreign (dirPath: *char): FilePathList // Load directory filepaths
|
|
LoadDirectoryFilesEx :: #foreign (basePath: *char, filter: *char, scanSubdirs: bool): FilePathList // Load directory filepaths with extension filtering and recursive directory scan
|
|
UnloadDirectoryFiles :: #foreign (files: FilePathList) // Unload filepaths
|
|
IsFileDropped :: #foreign (): bool // Check if a file has been dropped into window
|
|
LoadDroppedFiles :: #foreign (): FilePathList // Load dropped filepaths
|
|
UnloadDroppedFiles :: #foreign (files: FilePathList) // Unload dropped filepaths
|
|
GetFileModTime :: #foreign (fileName: *char): long // Get file modification time (last write time)
|
|
|
|
// Compression/Encoding functionality
|
|
|
|
CompressData :: #foreign (data: *void, dataSize: int, compDataSize: *int): *uchar // Compress data (DEFLATE algorithm), memory must be MemFree()
|
|
DecompressData :: #foreign (compData: *void, compDataSize: int, dataSize: *int): *uchar // Decompress data (DEFLATE algorithm), memory must be MemFree()
|
|
EncodeDataBase64 :: #foreign (data: *void, dataSize: int, outputSize: *int): *uchar // Encode data to Base64 string, memory must be MemFree()
|
|
DecodeDataBase64 :: #foreign (data: *void, outputSize: *int): *uchar // Decode Base64 string data, memory must be MemFree()
|
|
|
|
//------------------------------------------------------------------------------------
|
|
// Input Handling Functions (Module: core)
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// Input-related functions: keyboard
|
|
|
|
IsKeyPressed :: #foreign (key: int): bool // Detect if a key has been pressed once
|
|
IsKeyDown :: #foreign (key: int): bool // Detect if a key is being pressed
|
|
IsKeyReleased :: #foreign (key: int): bool // Detect if a key has been released once
|
|
IsKeyUp :: #foreign (key: int): bool // Detect if a key is NOT being pressed
|
|
SetExitKey :: #foreign (key: int) // Set a custom key to exit program (default is ESC)
|
|
GetKeyPressed :: #foreign (): int // Get key pressed (keycode), call it multiple times for keys queued
|
|
GetCharPressed :: #foreign (): rune // Get char pressed (unicode), call it multiple times for chars queued
|
|
|
|
// Input-related functions: gamepads
|
|
|
|
IsGamepadAvailable :: #foreign (gamepad: int): bool // Check if a gamepad is available
|
|
GetGamepadName :: #foreign (gamepad: int): *char // Get gamepad internal name id
|
|
IsGamepadButtonPressed :: #foreign (gamepad: int, button: GamepadButton): bool // Check if a gamepad button has been pressed once
|
|
IsGamepadButtonDown :: #foreign (gamepad: int, button: GamepadButton): bool // Check if a gamepad button is being pressed
|
|
IsGamepadButtonReleased :: #foreign (gamepad: int, button: GamepadButton): bool // Check if a gamepad button has been released once
|
|
IsGamepadButtonUp :: #foreign (gamepad: int, button: GamepadButton): bool // Check if a gamepad button is NOT being pressed
|
|
GetGamepadButtonPressed :: #foreign (): GamepadButton // Get the last gamepad button pressed
|
|
GetGamepadAxisCount :: #foreign (gamepad: int): int // Get gamepad axis count for a gamepad
|
|
GetGamepadAxisMovement :: #foreign (gamepad: int, axis: GamepadAxis): F32 // Get axis movement value for a gamepad axis
|
|
SetGamepadMappings :: #foreign (mappings: *char): int // Set internal gamepad mappings (SDL_GameControllerDB)
|
|
|
|
// Input-related functions: mouse
|
|
|
|
IsMouseButtonPressed :: #foreign (button: int): bool // Detect if a mouse button has been pressed once
|
|
IsMouseButtonDown :: #foreign (button: int): bool // Detect if a mouse button is being pressed
|
|
IsMouseButtonReleased :: #foreign (button: int): bool // Detect if a mouse button has been released once
|
|
IsMouseButtonUp :: #foreign (button: int): bool // Detect if a mouse button is NOT being pressed
|
|
GetMouseX :: #foreign (): int // Returns mouse position X
|
|
GetMouseY :: #foreign (): int // Returns mouse position Y
|
|
GetMousePosition :: #foreign (): Vector2 // Returns mouse position XY
|
|
GetMouseDelta :: #foreign (): Vector2 // Returns mouse delta XY
|
|
SetMousePosition :: #foreign (x: int, y: int) // Set mouse position XY
|
|
SetMouseOffset :: #foreign (offsetX: int, offsetY: int) // Set mouse offset
|
|
SetMouseScale :: #foreign (scaleX: F32, scaleY: F32) // Set mouse scaling
|
|
GetMouseWheelMove :: #foreign (): F32 // Returns mouse wheel movement Y
|
|
GetMouseWheelMoveV :: #foreign (): Vector2 // Get mouse wheel movement for both X and Y
|
|
SetMouseCursor :: #foreign (cursor: MouseCursor) // Set mouse cursor
|
|
|
|
// Input-related functions: touch
|
|
|
|
GetTouchX :: #foreign (): int // Returns touch position X for touch point 0 (relative to screen size)
|
|
GetTouchY :: #foreign (): int // Returns touch position Y for touch point 0 (relative to screen size)
|
|
GetTouchPosition :: #foreign (index: int): Vector2 // Returns touch position XY for a touch point index (relative to screen size)
|
|
GetTouchPointId :: #foreign (index: int): int // Get touch point identifier for given index
|
|
GetTouchPointCount :: #foreign (): int // Get number of touch points
|
|
|
|
//------------------------------------------------------------------------------------
|
|
// Gestures and Touch Handling Functions (Module: rgestures)
|
|
//------------------------------------------------------------------------------------
|
|
|
|
SetGesturesEnabled :: #foreign (flags: Gestures) // Enable a set of gestures using flags
|
|
IsGestureDetected :: #foreign (gesture: Gesture): bool // Check if a gesture have been detected
|
|
GetGestureDetected :: #foreign (): Gesture // Get latest detected gesture
|
|
GetGestureHoldDuration :: #foreign (): F32 // Get gesture hold time in milliseconds
|
|
GetGestureDragVector :: #foreign (): Vector2 // Get gesture drag vector
|
|
GetGestureDragAngle :: #foreign (): F32 // Get gesture drag angle
|
|
GetGesturePinchVector :: #foreign (): Vector2 // Get gesture pinch delta
|
|
GetGesturePinchAngle :: #foreign (): F32 // Get gesture pinch angle
|
|
|
|
//------------------------------------------------------------------------------------
|
|
// Camera System Functions (Module: camera)
|
|
//------------------------------------------------------------------------------------
|
|
|
|
UpdateCamera :: #foreign (camera: *Camera, mode: CameraMode) // Set camera mode (multiple camera modes available)
|
|
UpdateCameraPro :: #foreign (camera: *Camera, movement: Vector3, rotation: Vector3, zoom: F32) // Update camera movement/rotation
|
|
|
|
//------------------------------------------------------------------------------------
|
|
// Basic Shapes Drawing Functions (Module: shapes)
|
|
//------------------------------------------------------------------------------------
|
|
// Set texture and rectangle to be used on shapes drawing
|
|
// NOTE: It can be useful when using basic shapes and one single font,
|
|
// defining a font char white rectangle would allow drawing everything in a single draw call
|
|
|
|
SetShapesTexture :: #foreign (texture: Texture2D, source: Rectangle)
|
|
|
|
// Basic shapes drawing functions
|
|
|
|
DrawPixel :: #foreign (posX: int, posY: int, color: Color) // Draw a pixel
|
|
DrawPixelV :: #foreign (position: Vector2, color: Color) // Draw a pixel (Vector version)
|
|
DrawLine :: #foreign (startPosX: int, startPosY: int, endPosX: int, endPosY: int, color: Color) // Draw a line
|
|
DrawLineV :: #foreign (startPos: Vector2, endPos: Vector2, color: Color) // Draw a line (Vector version)
|
|
DrawLineEx :: #foreign (startPos: Vector2, endPos: Vector2, thick: F32, color: Color) // Draw a line defining thickness
|
|
DrawLineBezier :: #foreign (startPos: Vector2, endPos: Vector2, thick: F32, color: Color) // Draw a line using cubic-bezier curves in-out
|
|
DrawLineBezierQuad :: #foreign (startPos: Vector2, endPos: Vector2, controlPos: Vector2, thick: F32, color: Color) // Draw line using quadratic bezier curves with a control point
|
|
DrawLineBezierCubic :: #foreign (startPos: Vector2, endPos: Vector2, startControlPos: Vector2, endControlPos: Vector2, thick: F32, color: Color) // Draw line using cubic bezier curves with 2 control points
|
|
DrawLineStrip :: #foreign (points: *Vector2, pointCount: int, color: Color) // Draw lines sequence
|
|
DrawCircle :: #foreign (centerX: int, centerY: int, radius: F32, color: Color) // Draw a color-filled circle
|
|
DrawCircleSector :: #foreign (center: Vector2, radius: F32, startAngle: F32, endAngle: F32, segments: int, color: Color) // Draw a piece of a circle
|
|
DrawCircleSectorLines :: #foreign (center: Vector2, radius: F32, startAngle: F32, endAngle: F32, segments: int, color: Color) // Draw circle sector outline
|
|
DrawCircleGradient :: #foreign (centerX: int, centerY: int, radius: F32, color1: Color, color2: Color) // Draw a gradient-filled circle
|
|
DrawCircleV :: #foreign (center: Vector2, radius: F32, color: Color) // Draw a color-filled circle (Vector version)
|
|
DrawCircleLines :: #foreign (centerX: int, centerY: int, radius: F32, color: Color) // Draw circle outline
|
|
DrawEllipse :: #foreign (centerX: int, centerY: int, radiusH: F32, radiusV: F32, color: Color) // Draw ellipse
|
|
DrawEllipseLines :: #foreign (centerX: int, centerY: int, radiusH: F32, radiusV: F32, color: Color) // Draw ellipse outline
|
|
DrawRing :: #foreign (center: Vector2, innerRadius: F32, outerRadius: F32, startAngle: F32, endAngle: F32, segments: int, color: Color) // Draw ring
|
|
DrawRingLines :: #foreign (center: Vector2, innerRadius: F32, outerRadius: F32, startAngle: F32, endAngle: F32, segments: int, color: Color) // Draw ring outline
|
|
DrawRectangle :: #foreign (posX: int, posY: int, width: int, height: int, color: Color) // Draw a color-filled rectangle
|
|
DrawRectangleV :: #foreign (position: Vector2, size: Vector2, color: Color) // Draw a color-filled rectangle (Vector version)
|
|
DrawRectangleRec :: #foreign (rec: Rectangle, color: Color) // Draw a color-filled rectangle
|
|
DrawRectanglePro :: #foreign (rec: Rectangle, origin: Vector2, rotation: F32, color: Color) // Draw a color-filled rectangle with pro parameters
|
|
DrawRectangleGradientV :: #foreign (posX: int, posY: int, width: int, height: int, color1: Color, color2: Color) // Draw a vertical-gradient-filled rectangle
|
|
DrawRectangleGradientH :: #foreign (posX: int, posY: int, width: int, height: int, color1: Color, color2: Color) // Draw a horizontal-gradient-filled rectangle
|
|
DrawRectangleGradientEx :: #foreign (rec: Rectangle, col1: Color, col2: Color, col3: Color, col4: Color) // Draw a gradient-filled rectangle with custom vertex colors
|
|
DrawRectangleLines :: #foreign (posX: int, posY: int, width: int, height: int, color: Color) // Draw rectangle outline
|
|
DrawRectangleLinesEx :: #foreign (rec: Rectangle, lineThick: F32, color: Color) // Draw rectangle outline with extended parameters
|
|
DrawRectangleRounded :: #foreign (rec: Rectangle, roundness: F32, segments: int, color: Color) // Draw rectangle with rounded edges
|
|
DrawRectangleRoundedLines :: #foreign (rec: Rectangle, roundness: F32, segments: int, lineThick: F32, color: Color) // Draw rectangle with rounded edges outline
|
|
DrawTriangle :: #foreign (v1: Vector2, v2: Vector2, v3: Vector2, color: Color) // Draw a color-filled triangle (vertex in counter-clockwise order!)
|
|
DrawTriangleLines :: #foreign (v1: Vector2, v2: Vector2, v3: Vector2, color: Color) // Draw triangle outline (vertex in counter-clockwise order!)
|
|
DrawTriangleFan :: #foreign (points: *Vector2, pointCount: int, color: Color) // Draw a triangle fan defined by points (first vertex is the center)
|
|
DrawTriangleStrip :: #foreign (points: *Vector2, pointCount: int, color: Color) // Draw a triangle strip defined by points
|
|
DrawPoly :: #foreign (center: Vector2, sides: int, radius: F32, rotation: F32, color: Color) // Draw a regular polygon (Vector version)
|
|
DrawPolyLines :: #foreign (center: Vector2, sides: int, radius: F32, rotation: F32, color: Color) // Draw a polygon outline of n sides
|
|
DrawPolyLinesEx :: #foreign (center: Vector2, sides: int, radius: F32, rotation: F32, lineThick: F32, color: Color) // Draw a polygon outline of n sides with extended parameters
|
|
|
|
// Basic shapes collision detection functions
|
|
CheckCollisionRecs :: #foreign (rec1: Rectangle, rec2: Rectangle): bool // Check collision between two rectangles
|
|
CheckCollisionCircles :: #foreign (center1: Vector2, radius1: F32, center2: Vector2, radius2: F32): bool // Check collision between two circles
|
|
CheckCollisionCircleRec :: #foreign (center: Vector2, radius: F32, rec: Rectangle): bool // Check collision between circle and rectangle
|
|
CheckCollisionPointRec :: #foreign (point: Vector2, rec: Rectangle): bool // Check if point is inside rectangle
|
|
CheckCollisionPointCircle :: #foreign (point: Vector2, center: Vector2, radius: F32): bool // Check if point is inside circle
|
|
CheckCollisionPointTriangle :: #foreign (point: Vector2, p1: Vector2, p2: Vector2, p3: Vector2): bool // Check if point is inside a triangle
|
|
CheckCollisionPointPoly :: #foreign (point: Vector2, points: *Vector2, pointCount: int): bool // Check if point is within a polygon described by array of vertices
|
|
CheckCollisionLines :: #foreign (startPos1: Vector2, endPos1: Vector2, startPos2: Vector2, endPos2: Vector2, collisionPoint: *Vector2): bool // Check the collision between two lines defined by two points each, returns collision point by reference
|
|
CheckCollisionPointLine :: #foreign (point: Vector2, p1: Vector2, p2: Vector2, threshold: int): bool // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]
|
|
GetCollisionRec :: #foreign (rec1: Rectangle, rec2: Rectangle): Rectangle // Get collision rectangle for two rectangles collision
|
|
|
|
|
|
|
|
// Image loading functions
|
|
// NOTE: These functions do not require GPU access
|
|
|
|
LoadImage :: #foreign (fileName: *char): Image // Load image from file into CPU memory (RAM)
|
|
LoadImageRaw :: #foreign (fileName: *char, width: int, height: int, format: PixelFormat, headerSize: int): Image // Load image from RAW file data
|
|
LoadImageAnim :: #foreign (fileName: *char, frames: *int): Image // Load image sequence from file (frames appended to image.data)
|
|
LoadImageFromMemory :: #foreign (fileType: *char, fileData: *void, dataSize: int): Image // Load image from memory buffer, fileType refers to extension: i.e. '.png'
|
|
LoadImageFromTexture :: #foreign (texture: Texture2D): Image // Load image from GPU texture data
|
|
LoadImageFromScreen :: #foreign (): Image // Load image from screen buffer and (screenshot)
|
|
IsImageReady :: #foreign (image: Image): bool // Check if an image is ready
|
|
UnloadImage :: #foreign (image: Image) // Unload image from CPU memory (RAM)
|
|
ExportImage :: #foreign (image: Image, fileName: *char): bool // Export image data to file, returns true on success
|
|
ExportImageAsCode :: #foreign (image: Image, fileName: *char): bool // Export image as code file defining an array of bytes, returns true on success
|
|
|
|
// Image generation functions
|
|
|
|
GenImageColor :: #foreign (width: int, height: int, color: Color): Image // Generate image: plain color
|
|
GenImageGradientV :: #foreign (width: int, height: int, top: Color, bottom: Color): Image // Generate image: vertical gradient
|
|
GenImageGradientH :: #foreign (width: int, height: int, left: Color, right: Color): Image // Generate image: horizontal gradient
|
|
GenImageGradientRadial :: #foreign (width: int, height: int, density: F32, inner: Color, outer: Color): Image // Generate image: radial gradient
|
|
GenImageChecked :: #foreign (width: int, height: int, checksX: int, checksY: int, col1: Color, col2: Color): Image // Generate image: checked
|
|
GenImageWhiteNoise :: #foreign (width: int, height: int, factor: F32): Image // Generate image: white noise
|
|
GenImagePerlinNoise :: #foreign (width: int, height: int, offsetX: int, offsetY: int, scale: F32): Image // Generate image: perlin noise
|
|
GenImageCellular :: #foreign (width: int, height: int, tileSize: int): Image // Generate image: cellular algorithm, bigger tileSize means bigger cells
|
|
GenImageText :: #foreign (width: int, height: int, text: *char): Image // Generate image: grayscale image from text data
|
|
|
|
// Image manipulation functions
|
|
|
|
ImageCopy :: #foreign (image: Image): Image // Create an image duplicate (useful for transformations)
|
|
ImageFromImage :: #foreign (image: Image, rec: Rectangle): Image // Create an image from another image piece
|
|
ImageText :: #foreign (text: *char, fontSize: int, color: Color): Image // Create an image from text (default font)
|
|
ImageTextEx :: #foreign (font: Font, text: *char, fontSize: F32, spacing: F32, tint: Color): Image // Create an image from text (custom sprite font)
|
|
ImageFormat :: #foreign (image: *Image, newFormat: PixelFormat) // Convert image data to desired format
|
|
ImageToPOT :: #foreign (image: *Image, fill: Color) // Convert image to POT (power-of-two)
|
|
ImageCrop :: #foreign (image: *Image, crop: Rectangle) // Crop an image to a defined rectangle
|
|
ImageAlphaCrop :: #foreign (image: *Image, threshold: F32) // Crop image depending on alpha value
|
|
ImageAlphaClear :: #foreign (image: *Image, color: Color, threshold: F32) // Clear alpha channel to desired color
|
|
ImageAlphaMask :: #foreign (image: *Image, alphaMask: Image) // Apply alpha mask to image
|
|
ImageAlphaPremultiply :: #foreign (image: *Image) // Premultiply alpha channel
|
|
ImageBlurGaussian :: #foreign (image: *Image, blurSize: int) // Apply Gaussian blur using a box blur approximation
|
|
ImageResize :: #foreign (image: *Image, newWidth: int, newHeight: int) // Resize image (Bicubic scaling algorithm)
|
|
ImageResizeNN :: #foreign (image: *Image, newWidth: int, newHeight: int) // Resize image (Nearest-Neighbor scaling algorithm)
|
|
ImageResizeCanvas :: #foreign (image: *Image, newWidth: int, newHeight: int, offsetX: int, offsetY: int, fill: Color) // Resize canvas and fill with color
|
|
ImageMipmaps :: #foreign (image: *Image) // Compute all mipmap levels for a provided image
|
|
ImageDither :: #foreign (image: *Image, rBpp: int, gBpp: int, bBpp: int, aBpp: int) // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
|
|
ImageFlipVertical :: #foreign (image: *Image) // Flip image vertically
|
|
ImageFlipHorizontal :: #foreign (image: *Image) // Flip image horizontally
|
|
ImageRotateCW :: #foreign (image: *Image) // Rotate image clockwise 90deg
|
|
ImageRotateCCW :: #foreign (image: *Image) // Rotate image counter-clockwise 90deg
|
|
ImageColorTint :: #foreign (image: *Image, color: Color) // Modify image color: tint
|
|
ImageColorInvert :: #foreign (image: *Image) // Modify image color: invert
|
|
ImageColorGrayscale :: #foreign (image: *Image) // Modify image color: grayscale
|
|
ImageColorContrast :: #foreign (image: *Image, contrast: F32) // Modify image color: contrast (-100 to 100)
|
|
ImageColorBrightness :: #foreign (image: *Image, brightness: int) // Modify image color: brightness (-255 to 255)
|
|
ImageColorReplace :: #foreign (image: *Image, color: Color, replace: Color) // Modify image color: replace color
|
|
LoadImageColors :: #foreign (image: Image): *Color // Load color data from image as a Color array (RGBA - 32bit)
|
|
LoadImagePalette :: #foreign (image: Image, maxPaletteSize: int, colorCount: *int): *Color // Load colors palette from image as a Color array (RGBA - 32bit)
|
|
UnloadImageColors :: #foreign (colors: *Color) // Unload color data loaded with LoadImageColors()
|
|
UnloadImagePalette :: #foreign (colors: *Color) // Unload colors palette loaded with LoadImagePalette()
|
|
GetImageAlphaBorder :: #foreign (image: Image, threshold: F32): Rectangle // Get image alpha border rectangle
|
|
GetImageColor :: #foreign (image: Image, x: int, y: int): Color // Get image pixel color at (x, y) position
|
|
|
|
// Image drawing functions
|
|
// NOTE: Image software-rendering functions (CPU)
|
|
ImageClearBackground :: #foreign (dst: *Image, color: Color) // Clear image background with given color
|
|
ImageDrawPixel :: #foreign (dst: *Image, posX: int, posY: int, color: Color) // Draw pixel within an image
|
|
ImageDrawPixelV :: #foreign (dst: *Image, position: Vector2, color: Color) // Draw pixel within an image (Vector version)
|
|
ImageDrawLine :: #foreign (dst: *Image, startPosX: int, startPosY: int, endPosX: int, endPosY: int, color: Color) // Draw line within an image
|
|
ImageDrawLineV :: #foreign (dst: *Image, start: Vector2, end: Vector2, color: Color) // Draw line within an image (Vector version)
|
|
ImageDrawCircle :: #foreign (dst: *Image, centerX: int, centerY: int, radius: int, color: Color) // Draw a filled circle within an image
|
|
ImageDrawCircleV :: #foreign (dst: *Image, center: Vector2, radius: int, color: Color) // Draw a filled circle within an image (Vector version)
|
|
ImageDrawCircleLines :: #foreign (dst: *Image, centerX: int, centerY: int, radius: int, color: Color) // Draw circle outline within an image
|
|
ImageDrawCircleLinesV :: #foreign (dst: *Image, center: Vector2, radius: int, color: Color) // Draw circle outline within an image (Vector version)
|
|
ImageDrawRectangle :: #foreign (dst: *Image, posX: int, posY: int, width: int, height: int, color: Color) // Draw rectangle within an image
|
|
ImageDrawRectangleV :: #foreign (dst: *Image, position: Vector2, size: Vector2, color: Color) // Draw rectangle within an image (Vector version)
|
|
ImageDrawRectangleRec :: #foreign (dst: *Image, rec: Rectangle, color: Color) // Draw rectangle within an image
|
|
ImageDrawRectangleLines :: #foreign (dst: *Image, rec: Rectangle, thick: int, color: Color) // Draw rectangle lines within an image
|
|
ImageDraw :: #foreign (dst: *Image, src: Image, srcRec: Rectangle, dstRec: Rectangle, tint: Color) // Draw a source image within a destination image (tint applied to source)
|
|
ImageDrawText :: #foreign (dst: *Image, text: *char, posX: int, posY: int, fontSize: int, color: Color) // Draw text (using default font) within an image (destination)
|
|
ImageDrawTextEx :: #foreign (dst: *Image, font: Font, text: *char, position: Vector2, fontSize: F32, spacing: F32, tint: Color) // Draw text (custom sprite font) within an image (destination)
|
|
|
|
// Texture loading functions
|
|
// NOTE: These functions require GPU access
|
|
|
|
LoadTexture :: #foreign (fileName: *char): Texture2D // Load texture from file into GPU memory (VRAM)
|
|
LoadTextureFromImage :: #foreign (image: Image): Texture2D // Load texture from image data
|
|
LoadTextureCubemap :: #foreign (image: Image, layout: CubemapLayout): TextureCubemap // Load cubemap from image, multiple image cubemap layouts supported
|
|
LoadRenderTexture :: #foreign (width: int, height: int): RenderTexture2D // Load texture for rendering (framebuffer)
|
|
IsTextureReady :: #foreign (texture: Texture2D): bool // Check if a texture is ready
|
|
UnloadTexture :: #foreign (texture: Texture2D) // Unload texture from GPU memory (VRAM)
|
|
IsRenderTextureReady :: #foreign (target: RenderTexture2D): bool // Check if a render texture is ready
|
|
UnloadRenderTexture :: #foreign (target: RenderTexture2D) // Unload render texture from GPU memory (VRAM)
|
|
UpdateTexture :: #foreign (texture: Texture2D, pixels: *void) // Update GPU texture with new data
|
|
UpdateTextureRec :: #foreign (texture: Texture2D, rec: Rectangle, pixels: *void) // Update GPU texture rectangle with new data
|
|
|
|
// Texture configuration functions
|
|
|
|
GenTextureMipmaps :: #foreign (texture: *Texture2D) // Generate GPU mipmaps for a texture
|
|
SetTextureFilter :: #foreign (texture: Texture2D, filter: TextureFilter) // Set texture scaling filter mode
|
|
SetTextureWrap :: #foreign (texture: Texture2D, wrap: TextureWrap) // Set texture wrapping mode
|
|
|
|
// Texture drawing functions
|
|
DrawTexture :: #foreign (texture: Texture2D, posX: int, posY: int, tint: Color) // Draw a Texture2D
|
|
DrawTextureV :: #foreign (texture: Texture2D, position: Vector2, tint: Color) // Draw a Texture2D with position defined as Vector2
|
|
DrawTextureEx :: #foreign (texture: Texture2D, position: Vector2, rotation: F32, scale: F32, tint: Color) // Draw a Texture2D with extended parameters
|
|
DrawTextureRec :: #foreign (texture: Texture2D, source: Rectangle, position: Vector2, tint: Color) // Draw a part of a texture defined by a rectangle
|
|
DrawTexturePro :: #foreign (texture: Texture2D, source: Rectangle, dest: Rectangle, origin: Vector2, rotation: F32, tint: Color) // Draw a part of a texture defined by a rectangle with 'pro' parameters
|
|
DrawTextureNPatch :: #foreign (texture: Texture2D, nPatchInfo: NPatchInfo, dest: Rectangle, origin: Vector2, rotation: F32, tint: Color) // Draws a texture (or part of it) that stretches or shrinks nicely
|
|
|
|
// Color/pixel related functions
|
|
|
|
Fade :: #foreign (color: Color, alpha: F32): Color // Get color with alpha applied, alpha goes from 0.0f to 1.0f
|
|
ColorToInt :: #foreign (color: Color): uint // Get hexadecimal value for a Color
|
|
ColorNormalize :: #foreign (color: Color): Vector4 // Get Color normalized as float [0..1]
|
|
ColorFromNormalized :: #foreign (normalized: Vector4): Color // Get Color from normalized values [0..1]
|
|
ColorToHSV :: #foreign (color: Color): Vector3 // Get HSV values for a Color, hue [0..360], saturation/value [0..1]
|
|
ColorFromHSV :: #foreign (hue: F32, saturation: F32, value: F32): Color // Get a Color from HSV values, hue [0..360], saturation/value [0..1]
|
|
ColorTint :: #foreign (color: Color, tint: Color): Color // Get color multiplied with another color
|
|
ColorBrightness :: #foreign (color: Color, factor: F32): Color // Get color with brightness correction, brightness factor goes from -1.0f to 1.0f
|
|
ColorContrast :: #foreign (color: Color, contrast: F32): Color // Get color with contrast correction, contrast values between -1.0f and 1.0f
|
|
ColorAlpha :: #foreign (color: Color, alpha: F32): Color // Get color with alpha applied, alpha goes from 0.0f to 1.0f
|
|
ColorAlphaBlend :: #foreign (dst: Color, src: Color, tint: Color): Color // Get src alpha-blended into dst color with tint
|
|
GetColor :: #foreign (hexValue: uint): Color // Get Color structure from hexadecimal value
|
|
GetPixelColor :: #foreign (srcPtr: *void, format: PixelFormat): Color // Get Color from a source pixel pointer of certain format
|
|
SetPixelColor :: #foreign (dstPtr: *void, color: Color, format: PixelFormat) // Set color formatted into destination pixel pointer
|
|
GetPixelDataSize :: #foreign (width: inr, height: int, format: PixelFormat): int // Get pixel data size in bytes for certain format
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
// Font Loading and Text Drawing Functions (Module: text)
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// Font loading/unloading functions
|
|
|
|
GetFontDefault :: #foreign (): Font // Get the default Font
|
|
LoadFont :: #foreign (fileName: *char): Font // Load font from file into GPU memory (VRAM)
|
|
LoadFontEx :: #foreign (fileName: *char, fontSize: int, fontChars: *rune, glyphCount: int): Font // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set
|
|
LoadFontFromImage :: #foreign (image: Image, key: Color, firstChar: rune): Font // Load font from Image (XNA style)
|
|
LoadFontFromMemory :: #foreign (fileType: *char, fileData: *void, dataSize: int, fontSize: int, fontChars: *rune, glyphCount: int): Font // Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
|
|
IsFontReady :: #foreign (font: Font): bool // Check if a font is ready
|
|
LoadFontData :: #foreign (fileData: *void, dataSize: int, fontSize: int, fontChars: *rune, glyphCount: int, type: FontType): *GlyphInfo // Load font data for further use
|
|
GenImageFontAtlas :: #foreign (chars: *GlyphInfo, recs: **Rectangle, glyphCount: int, fontSize: int, padding: int, packMethod: int): Image // Generate image font atlas using chars info
|
|
UnloadFontData :: #foreign (chars: *GlyphInfo, glyphCount: int) // Unload font chars info data (RAM)
|
|
UnloadFont :: #foreign (font: Font) // Unload font from GPU memory (VRAM)
|
|
ExportFontAsCode :: #foreign (font: Font, fileName: *char): bool // Export font as code file, returns true on success
|
|
|
|
// Text drawing functions
|
|
|
|
DrawFPS :: #foreign (posX: int, posY: int) // Draw current FPS
|
|
DrawText :: #foreign (text: *char, posX: int, posY: int, fontSize: int, color: Color) // Draw text (using default font)
|
|
DrawTextEx :: #foreign (font: Font, text: *char, position: Vector2, fontSize: F32, spacing: F32, tint: Color) // Draw text using font and additional parameters
|
|
DrawTextPro :: #foreign (font: Font, text: *char, position: Vector2, origin: Vector2, rotation: F32, fontSize: F32, spacing: F32, tint: Color) // Draw text using Font and pro parameters (rotation)
|
|
DrawTextCodepoint :: #foreign (font: Font, codepoint: rune, position: Vector2, fontSize: F32, tint: Color) // Draw one character (codepoint)
|
|
DrawTextCodepoints :: #foreign (font: Font, codepoints: *rune, count: int, position: Vector2, fontSize: F32, spacing: F32, tint: Color) // Draw multiple character (codepoint)
|
|
|
|
// Text font info functions
|
|
|
|
MeasureText :: #foreign (text: *char, fontSize: int): int // Measure string width for default font
|
|
MeasureTextEx :: #foreign (font: Font, text: *char, fontSize: F32, spacing: F32): Vector2 // Measure string size for Font
|
|
GetGlyphIndex :: #foreign (font: Font, codepoint: rune): int // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found
|
|
GetGlyphInfo :: #foreign (font: Font, codepoint: rune): GlyphInfo // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found
|
|
GetGlyphAtlasRec :: #foreign (font: Font, codepoint: rune): Rectangle // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found
|
|
|
|
// Text codepoints management functions (unicode characters)
|
|
|
|
LoadUTF8 :: #foreign (codepoints: *rune, length: int): *uchar // Load UTF-8 text encoded from codepoints array
|
|
UnloadUTF8 :: #foreign (text: *uchar) // Unload UTF-8 text encoded from codepoints array
|
|
LoadCodepoints :: #foreign (text: *void, count: *int): *rune // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter
|
|
UnloadCodepoints :: #foreign (codepoints: *rune) // Unload codepoints data from memory
|
|
GetCodepointCount :: #foreign (text : *char): int // Get total number of codepoints in a UTF-8 encoded string
|
|
GetCodepoint :: #foreign (text: *char, codepointSize: *int): rune // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
|
GetCodepointNext :: #foreign (text: *char, codepointSize: *int): rune // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
|
GetCodepointPrevious :: #foreign (text: *char, codepointSize: *int): rune // Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
|
CodepointToUTF8 :: #foreign (codepoint: rune, utf8Size: *int): *char // Encode one codepoint into UTF-8 byte array (array length returned as parameter)
|
|
|
|
// Text strings management functions (no UTF-8 strings, only byte chars)
|
|
// NOTE: Some strings allocate memory internally for returned strings, just be careful!
|
|
|
|
TextCopy :: #foreign (dst: *uchar, src: *char): int // Copy one string to another, returns bytes copied
|
|
TextIsEqual :: #foreign (text1: *char, text2: *char): bool // Check if two text string are equal
|
|
TextLength :: #foreign (text: *char): uint // Get text length, checks for '\0' ending
|
|
|
|
// TextFormat is defined at the bottom of this file
|
|
|
|
TextFormat :: #foreign (str: *char, ...): *char
|
|
TextSubtext :: #foreign (text: *char, position: int, length: int): *char // Get a piece of a text string
|
|
TextReplace :: #foreign (text: *uchar, replace: *char, by: *char): *uchar // Replace text string (WARNING: memory must be freed!)
|
|
TextInsert :: #foreign (text: *char, insert: *char, position: int): *uchar // Insert text in a position (WARNING: memory must be freed!)
|
|
TextJoin :: #foreign (textList: **char, count: int, delimiter: *char): *char // Join text strings with delimiter
|
|
TextSplit :: #foreign (text: *char, delimiter: byte, count: *int): **char // Split text into multiple strings
|
|
TextAppend :: #foreign (text: *uchar, append: *char, position: *int) // Append text at specific position and move cursor!
|
|
TextFindIndex :: #foreign (text: *char, find: *char): int // Find first text occurrence within a string
|
|
TextToUpper :: #foreign (text: *char): *char // Get upper case version of provided string
|
|
TextToLower :: #foreign (text: *char): *char // Get lower case version of provided string
|
|
TextToPascal :: #foreign (text: *char): *char // Get Pascal case notation version of provided string
|
|
TextToInteger :: #foreign (text: *char): int // Get integer value from text (negative values not supported)
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
// Basic 3d Shapes Drawing Functions (Module: models)
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// Basic geometric 3D shapes drawing functions
|
|
|
|
DrawLine3D :: #foreign (startPos: Vector3, endPos: Vector3, color: Color) // Draw a line in 3D world space
|
|
DrawPoint3D :: #foreign (position: Vector3, color: Color) // Draw a point in 3D space, actually a small line
|
|
DrawCircle3D :: #foreign (center: Vector3, radius: F32, rotationAxis: Vector3, rotationAngle: F32, color: Color) // Draw a circle in 3D world space
|
|
DrawTriangle3D :: #foreign (v1: Vector3, v2: Vector3, v3: Vector3, color: Color) // Draw a color-filled triangle (vertex in counter-clockwise order!)
|
|
DrawTriangleStrip3D :: #foreign (points: *Vector3, pointCount: int, color: Color) // Draw a triangle strip defined by points
|
|
DrawCube :: #foreign (position: Vector3, width: F32, height: F32, length: F32, color: Color) // Draw cube
|
|
DrawCubeV :: #foreign (position: Vector3, size: Vector3, color: Color) // Draw cube (Vector version)
|
|
DrawCubeWires :: #foreign (position: Vector3, width: F32, height: F32, length: F32, color: Color) // Draw cube wires
|
|
DrawCubeWiresV :: #foreign (position: Vector3, size: Vector3, color: Color) // Draw cube wires (Vector version)
|
|
DrawSphere :: #foreign (centerPos: Vector3, radius: F32, color: Color) // Draw sphere
|
|
DrawSphereEx :: #foreign (centerPos: Vector3, radius: F32, rings: int, slices: int, color: Color) // Draw sphere with extended parameters
|
|
DrawSphereWires :: #foreign (centerPos: Vector3, radius: F32, rings: int, slices: int, color: Color) // Draw sphere wires
|
|
DrawCylinder :: #foreign (position: Vector3, radiusTop: F32, radiusBottom: F32, height: F32, slices: int, color: Color) // Draw a cylinder/cone
|
|
DrawCylinderEx :: #foreign (startPos: Vector3, endPos: Vector3, startRadius: F32, endRadius: F32, sides: int, color: Color) // Draw a cylinder with base at startPos and top at endPos
|
|
DrawCylinderWires :: #foreign (position: Vector3, radiusTop: F32, radiusBottom: F32, height: F32, slices: int, color: Color) // Draw a cylinder/cone wires
|
|
DrawCylinderWiresEx :: #foreign (startPos: Vector3, endPos: Vector3, startRadius: F32, endRadius: F32, sides: int, color: Color) // Draw a cylinder wires with base at startPos and top at endPos
|
|
DrawCapsule :: #foreign (startPos: Vector3, endPos: Vector3, radius: F32, slices: int, rings: int, color: Color) // Draw a capsule with the center of its sphere caps at startPos and endPos
|
|
DrawCapsuleWires :: #foreign (startPos: Vector3, endPos: Vector3, radius: F32, slices: int, rings: int, color: Color) // Draw capsule wireframe with the center of its sphere caps at startPos and endPos
|
|
DrawPlane :: #foreign (centerPos: Vector3, size: Vector2, color: Color) // Draw a plane XZ
|
|
DrawRay :: #foreign (ray: Ray, color: Color) // Draw a ray line
|
|
DrawGrid :: #foreign (slices: int, spacing: F32) // Draw a grid (centered at (0, 0, 0))
|
|
|
|
//------------------------------------------------------------------------------------
|
|
// Model 3d Loading and Drawing Functions (Module: models)
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// Model management functions
|
|
|
|
LoadModel :: #foreign (fileName: *char): Model // Load model from files (meshes and materials)
|
|
LoadModelFromMesh :: #foreign (mesh: Mesh): Model // Load model from generated mesh (default material)
|
|
IsModelReady :: #foreign (model: Model): bool // Check if a model is ready
|
|
UnloadModel :: #foreign (model: Model) // Unload model (including meshes) from memory (RAM and/or VRAM)
|
|
GetModelBoundingBox :: #foreign (model: Model): BoundingBox // Compute model bounding box limits (considers all meshes)
|
|
|
|
// Model drawing functions
|
|
|
|
DrawModel :: #foreign (model: Model, position: Vector3, scale: F32, tint: Color) // Draw a model (with texture if set)
|
|
DrawModelEx :: #foreign (model: Model, position: Vector3, rotationAxis: Vector3, rotationAngle: F32, scale: Vector3, tint: Color) // Draw a model with extended parameters
|
|
DrawModelWires :: #foreign (model: Model, position: Vector3, scale: F32, tint: Color) // Draw a model wires (with texture if set)
|
|
DrawModelWiresEx :: #foreign (model: Model, position: Vector3, rotationAxis: Vector3, rotationAngle: F32, scale: Vector3, tint: Color) // Draw a model wires (with texture if set) with extended parameters
|
|
DrawBoundingBox :: #foreign (box: BoundingBox, color: Color) // Draw bounding box (wires)
|
|
DrawBillboard :: #foreign (camera: Camera, texture: Texture2D, position: Vector3, size: F32, tint: Color) // Draw a billboard texture
|
|
DrawBillboardRec :: #foreign (camera: Camera, texture: Texture2D, source: Rectangle, position: Vector3, size: Vector2, tint: Color) // Draw a billboard texture defined by source
|
|
DrawBillboardPro :: #foreign (camera: Camera, texture: Texture2D, source: Rectangle, position: Vector3, up: Vector3, size: Vector2, origin: Vector2, rotation: F32, tint: Color) // Draw a billboard texture defined by source and rotation
|
|
|
|
// Mesh management functions
|
|
|
|
UploadMesh :: #foreign (mesh: *Mesh, is_dynamic: bool) // Upload mesh vertex data in GPU and provide VAO/VBO ids
|
|
UpdateMeshBuffer :: #foreign (mesh: Mesh, index: int, data: *void, dataSize: int, offset: int) // Update mesh vertex data in GPU for a specific buffer index
|
|
UnloadMesh :: #foreign (mesh: Mesh) // Unload mesh data from CPU and GPU
|
|
DrawMesh :: #foreign (mesh: Mesh, material: Material, transform: Matrix) // Draw a 3d mesh with material and transform
|
|
DrawMeshInstanced :: #foreign (mesh: Mesh, material: Material, transforms: *Matrix, instances: int) // Draw multiple mesh instances with material and different transforms
|
|
ExportMesh :: #foreign (mesh: Mesh, fileName: *char): bool // Export mesh data to file, returns true on success
|
|
GetMeshBoundingBox :: #foreign (mesh: Mesh): BoundingBox // Compute mesh bounding box limits
|
|
GenMeshTangents :: #foreign (mesh: *Mesh) // Compute mesh tangents
|
|
|
|
// Mesh generation functions
|
|
|
|
GenMeshPoly :: #foreign (sides: int, radius: F32): Mesh // Generate polygonal mesh
|
|
GenMeshPlane :: #foreign (width: F32, lengthL: F32, resX: int, resZ: int): Mesh // Generate plane mesh (with subdivisions)
|
|
GenMeshCube :: #foreign (width: F32, height: F32, length: F32): Mesh // Generate cuboid mesh
|
|
GenMeshSphere :: #foreign (radius: F32, rings: int, slices: int): Mesh // Generate sphere mesh (standard sphere)
|
|
GenMeshHemiSphere :: #foreign (radius: F32, rings: int, slices: int): Mesh // Generate half-sphere mesh (no bottom cap)
|
|
GenMeshCylinder :: #foreign (radius: F32, height: F32, slices: int): Mesh // Generate cylinder mesh
|
|
GenMeshCone :: #foreign (radius: F32, height: F32, slices: int): Mesh // Generate cone/pyramid mesh
|
|
GenMeshTorus :: #foreign (radius: F32, size: F32, radSeg: int, sides: int): Mesh // Generate torus mesh
|
|
GenMeshKnot :: #foreign (radius: F32, size: F32, radSeg: int, sides: int): Mesh // Generate trefoil knot mesh
|
|
GenMeshHeightmap :: #foreign (heightmap: Image, size: Vector3): Mesh // Generate heightmap mesh from image data
|
|
GenMeshCubicmap :: #foreign (cubicmap: Image, cubeSize: Vector3): Mesh // Generate cubes-based map mesh from image data
|
|
|
|
// Material loading/unloading functions
|
|
|
|
LoadMaterials :: #foreign (fileName: *char, materialCount: *int): *Material // Load materials from model file
|
|
LoadMaterialDefault :: #foreign (): Material // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
|
|
IsMaterialReady :: #foreign (material: Material): bool // Check if a material is ready
|
|
UnloadMaterial :: #foreign (material: Material) // Unload material from GPU memory (VRAM)
|
|
SetMaterialTexture :: #foreign (material: *Material, mapType: MaterialMapIndex, texture: Texture2D) // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)
|
|
SetModelMeshMaterial :: #foreign (model: *Model, meshId: int, materialId: int) // Set material for a mesh
|
|
|
|
// Model animations loading/unloading functions
|
|
|
|
LoadModelAnimations :: #foreign (fileName: *char, animCount: *uint): *ModelAnimation // Load model animations from file
|
|
UpdateModelAnimation :: #foreign (model: Model, anim: ModelAnimation, frame: int) // Update model animation pose
|
|
UnloadModelAnimation :: #foreign (anim: ModelAnimation) // Unload animation data
|
|
UnloadModelAnimations :: #foreign (animations: *ModelAnimation, count: uint) // Unload animation array data
|
|
IsModelAnimationValid :: #foreign (model: Model, anim: ModelAnimation): bool // Check model animation skeleton match
|
|
|
|
// Collision detection functions
|
|
|
|
CheckCollisionSpheres :: #foreign (center1: Vector3, radius1: F32, center2: Vector3, radius2: F32): bool // Check collision between two spheres
|
|
CheckCollisionBoxes :: #foreign (box1: BoundingBox, box2: BoundingBox): bool // Check collision between two bounding boxes
|
|
CheckCollisionBoxSphere :: #foreign (box: BoundingBox, center: Vector3, radius: F32): bool // Check collision between box and sphere
|
|
GetRayCollisionSphere :: #foreign (ray: Ray, center: Vector3, radius: F32): RayCollision // Get collision info between ray and sphere
|
|
GetRayCollisionBox :: #foreign (ray: Ray, box: BoundingBox): RayCollision // Get collision info between ray and box
|
|
GetRayCollisionMesh :: #foreign (ray: Ray, mesh: Mesh, transform: Matrix): RayCollision // Get collision info between ray and mesh
|
|
GetRayCollisionTriangle :: #foreign (ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3): RayCollision // Get collision info between ray and triangle
|
|
GetRayCollisionQuad :: #foreign (ray: Ray, p1: Vector4, p2: Vector4, p3: Vector4, p4: Vector3): RayCollision // Get collision info between ray and quad
|
|
|
|
//------------------------------------------------------------------------------------
|
|
// Audio Loading and Playing Functions (Module: audio)
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// Audio device management functions
|
|
|
|
InitAudioDevice :: #foreign () // Initialize audio device and context
|
|
CloseAudioDevice :: #foreign () // Close the audio device and context
|
|
IsAudioDeviceReady :: #foreign (): bool // Check if audio device has been initialized successfully
|
|
SetMasterVolume :: #foreign (volume: F32) // Set master volume (listener)
|
|
|
|
// Wave/Sound loading/unloading functions
|
|
|
|
LoadWave :: #foreign (fileName: *char): Wave // Load wave data from file
|
|
LoadWaveFromMemory :: #foreign (fileType: *char, fileData: *void, dataSize: int): Wave // Load wave from memory buffer, fileType refers to extension: i.e. '.wav'
|
|
IsWaveReady :: #foreign (wave: Wave): bool // Checks if wave data is ready
|
|
LoadSound :: #foreign (fileName: *char): Sound // Load sound from file
|
|
LoadSoundFromWave :: #foreign (wave: Wave): Sound // Load sound from wave data
|
|
IsSoundReady :: #foreign (sound: Sound): bool // Checks if a sound is ready
|
|
UpdateSound :: #foreign (sound: Sound, data: *void, sampleCount: int) // Update sound buffer with new data
|
|
UnloadWave :: #foreign (wave: Wave) // Unload wave data
|
|
UnloadSound :: #foreign (sound: Sound) // Unload sound
|
|
ExportWave :: #foreign (wave: Wave, fileName: *char): bool // Export wave data to file, returns true on success
|
|
ExportWaveAsCode :: #foreign (wave: Wave, fileName: *char): bool // Export wave sample data to code (.h), returns true on success
|
|
|
|
// Wave/Sound management functions
|
|
|
|
PlaySound :: #foreign (sound: Sound) // Play a sound
|
|
StopSound :: #foreign (sound: Sound) // Stop playing a sound
|
|
PauseSound :: #foreign (sound: Sound) // Pause a sound
|
|
ResumeSound :: #foreign (sound: Sound) // Resume a paused sound
|
|
IsSoundPlaying :: #foreign (sound: Sound): bool // Check if a sound is currently playing
|
|
SetSoundVolume :: #foreign (sound: Sound, volume: F32) // Set volume for a sound (1.0 is max level)
|
|
SetSoundPitch :: #foreign (sound: Sound, pitch: F32) // Set pitch for a sound (1.0 is base level)
|
|
SetSoundPan :: #foreign (sound: Sound, pan: F32) // Set pan for a sound (0.5 is center)
|
|
WaveCopy :: #foreign (wave: Wave): Wave // Copy a wave to a new wave
|
|
WaveCrop :: #foreign (wave: *Wave, initSample: int, finalSample: int) // Crop a wave to defined samples range
|
|
WaveFormat :: #foreign (wave: *Wave, sampleRate: int, sampleSize: int, channels: int) // Convert wave data to desired format
|
|
LoadWaveSamples :: #foreign (wave: Wave): *F32 // Load samples data from wave as a 32bit float data array
|
|
UnloadWaveSamples :: #foreign (samples: *F32) // Unload samples data loaded with LoadWaveSamples()
|
|
|
|
// Music management functions
|
|
|
|
LoadMusicStream :: #foreign (fileName: *char): Music // Load music stream from file
|
|
LoadMusicStreamFromMemory :: #foreign (fileType: *char, data: *void, dataSize: int): Music // Load music stream from data
|
|
IsMusicReady :: #foreign (music: Music): bool // Checks if a music stream is ready
|
|
UnloadMusicStream :: #foreign (music: Music) // Unload music stream
|
|
PlayMusicStream :: #foreign (music: Music) // Start music playing
|
|
IsMusicStreamPlaying :: #foreign (music: Music): bool // Check if music is playing
|
|
UpdateMusicStream :: #foreign (music: Music) // Updates buffers for music streaming
|
|
StopMusicStream :: #foreign (music: Music) // Stop music playing
|
|
PauseMusicStream :: #foreign (music: Music) // Pause music playing
|
|
ResumeMusicStream :: #foreign (music: Music) // Resume playing paused music
|
|
SeekMusicStream :: #foreign (music: Music, position: F32) // Seek music to a position (in seconds)
|
|
SetMusicVolume :: #foreign (music: Music, volume: F32) // Set volume for music (1.0 is max level)
|
|
SetMusicPitch :: #foreign (music: Music, pitch: F32) // Set pitch for a music (1.0 is base level)
|
|
SetMusicPan :: #foreign (music: Music, pan: F32) // Set pan for a music (0.5 is center)
|
|
GetMusicTimeLength :: #foreign (music: Music): F32 // Get music time length (in seconds)
|
|
GetMusicTimePlayed :: #foreign (music: Music): F32 // Get current music time played (in seconds)
|
|
|
|
// AudioStream management functions
|
|
|
|
LoadAudioStream :: #foreign (sampleRate: uint, sampleSize: uint, channels: uint): AudioStream // Load audio stream (to stream raw audio pcm data)
|
|
IsAudioStreamReady :: #foreign (stream: AudioStream): bool // Checks if an audio stream is ready
|
|
UnloadAudioStream :: #foreign (stream: AudioStream) // Unload audio stream and free memory
|
|
UpdateAudioStream :: #foreign (stream: AudioStream, data: *void, frameCount: int) // Update audio stream buffers with data
|
|
IsAudioStreamProcessed :: #foreign (stream: AudioStream): bool // Check if any audio stream buffers requires refill
|
|
PlayAudioStream :: #foreign (stream: AudioStream) // Play audio stream
|
|
PauseAudioStream :: #foreign (stream: AudioStream) // Pause audio stream
|
|
ResumeAudioStream :: #foreign (stream: AudioStream) // Resume audio stream
|
|
IsAudioStreamPlaying :: #foreign (stream: AudioStream): bool // Check if audio stream is playing
|
|
StopAudioStream :: #foreign (stream: AudioStream) // Stop audio stream
|
|
SetAudioStreamVolume :: #foreign (stream: AudioStream, volume: F32) // Set volume for audio stream (1.0 is max level)
|
|
SetAudioStreamPitch :: #foreign (stream: AudioStream, pitch: F32) // Set pitch for audio stream (1.0 is base level)
|
|
SetAudioStreamPan :: #foreign (stream: AudioStream, pan: F32) // Set pan for audio stream (0.5 is centered)
|
|
SetAudioStreamBufferSizeDefault :: #foreign (size: int) // Default size for new audio streams
|
|
SetAudioStreamCallback :: #foreign (stream: AudioStream, callback: AudioCallback) // Audio thread callback to request new data
|
|
|
|
AttachAudioStreamProcessor :: #foreign (stream: AudioStream, processor: AudioCallback) // Attach audio stream processor to stream
|
|
DetachAudioStreamProcessor :: #foreign (stream: AudioStream, processor: AudioCallback) // Detach audio stream processor from stream
|
|
|
|
AttachAudioMixedProcessor :: #foreign (processor: AudioCallback) // Attach audio stream processor to the entire audio pipeline
|
|
DetachAudioMixedProcessor :: #foreign (processor: AudioCallback) // Detach audio stream processor from the entire audio pipeline
|