github.com/Konstantin8105/c4go@v0.0.0-20240505174241-768bb1c65a51/tests/raylib/raylib.h (about) 1 /********************************************************************************************** 2 * 3 * raylib v4.5-dev - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) 4 * 5 * FEATURES: 6 * - NO external dependencies, all required libraries included with raylib 7 * - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, 8 * MacOS, Haiku, Android, Raspberry Pi, DRM native, HTML5. 9 * - Written in plain C code (C99) in PascalCase/camelCase notation 10 * - Hardware accelerated with OpenGL (1.1, 2.1, 3.3, 4.3 or ES2 - choose at compile) 11 * - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] 12 * - Multiple Fonts formats supported (TTF, XNA fonts, AngelCode fonts) 13 * - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC) 14 * - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more! 15 * - Flexible Materials system, supporting classic maps and PBR maps 16 * - Animated 3D models supported (skeletal bones animation) (IQM) 17 * - Shaders support, including Model shaders and Postprocessing shaders 18 * - Powerful math module for Vector, Matrix and Quaternion operations: [raymath] 19 * - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD) 20 * - VR stereo rendering with configurable HMD device parameters 21 * - Bindings to multiple programming languages available! 22 * 23 * NOTES: 24 * - One default Font is loaded on InitWindow()->LoadFontDefault() [core, text] 25 * - One default Texture2D is loaded on rlglInit(), 1x1 white pixel R8G8B8A8 [rlgl] (OpenGL 3.3 or ES2) 26 * - One default Shader is loaded on rlglInit()->rlLoadShaderDefault() [rlgl] (OpenGL 3.3 or ES2) 27 * - One default RenderBatch is loaded on rlglInit()->rlLoadRenderBatch() [rlgl] (OpenGL 3.3 or ES2) 28 * 29 * DEPENDENCIES (included): 30 * [rcore] rglfw (Camilla Löwy - github.com/glfw/glfw) for window/context management and input (PLATFORM_DESKTOP) 31 * [rlgl] glad (David Herberth - github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading (PLATFORM_DESKTOP) 32 * [raudio] miniaudio (David Reid - github.com/mackron/miniaudio) for audio device/context management 33 * 34 * OPTIONAL DEPENDENCIES (included): 35 * [rcore] msf_gif (Miles Fogle) for GIF recording 36 * [rcore] sinfl (Micha Mettke) for DEFLATE decompression algorithm 37 * [rcore] sdefl (Micha Mettke) for DEFLATE compression algorithm 38 * [rtextures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...) 39 * [rtextures] stb_image_write (Sean Barret) for image writing (BMP, TGA, PNG, JPG) 40 * [rtextures] stb_image_resize (Sean Barret) for image resizing algorithms 41 * [rtext] stb_truetype (Sean Barret) for ttf fonts loading 42 * [rtext] stb_rect_pack (Sean Barret) for rectangles packing 43 * [rmodels] par_shapes (Philip Rideout) for parametric 3d shapes generation 44 * [rmodels] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL) 45 * [rmodels] cgltf (Johannes Kuhlmann) for models loading (glTF) 46 * [rmodels] Model3D (bzt) for models loading (M3D, https://bztsrc.gitlab.io/model3d) 47 * [raudio] dr_wav (David Reid) for WAV audio file loading 48 * [raudio] dr_flac (David Reid) for FLAC audio file loading 49 * [raudio] dr_mp3 (David Reid) for MP3 audio file loading 50 * [raudio] stb_vorbis (Sean Barret) for OGG audio loading 51 * [raudio] jar_xm (Joshua Reisenauer) for XM audio module loading 52 * [raudio] jar_mod (Joshua Reisenauer) for MOD audio module loading 53 * 54 * 55 * LICENSE: zlib/libpng 56 * 57 * raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, 58 * BSD-like license that allows static linking with closed source software: 59 * 60 * Copyright (c) 2013-2022 Ramon Santamaria (@raysan5) 61 * 62 * This software is provided "as-is", without any express or implied warranty. In no event 63 * will the authors be held liable for any damages arising from the use of this software. 64 * 65 * Permission is granted to anyone to use this software for any purpose, including commercial 66 * applications, and to alter it and redistribute it freely, subject to the following restrictions: 67 * 68 * 1. The origin of this software must not be misrepresented; you must not claim that you 69 * wrote the original software. If you use this software in a product, an acknowledgment 70 * in the product documentation would be appreciated but is not required. 71 * 72 * 2. Altered source versions must be plainly marked as such, and must not be misrepresented 73 * as being the original software. 74 * 75 * 3. This notice may not be removed or altered from any source distribution. 76 * 77 **********************************************************************************************/ 78 79 #ifndef RAYLIB_H 80 #define RAYLIB_H 81 82 #include <stdarg.h> // Required for: va_list - Only used by TraceLogCallback 83 84 #define RAYLIB_VERSION "4.5-dev" 85 86 // Function specifiers in case library is build/used as a shared library (Windows) 87 // NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll 88 #if defined(_WIN32) 89 #if defined(BUILD_LIBTYPE_SHARED) 90 #if defined(__TINYC__) 91 #define __declspec(x) __attribute__((x)) 92 #endif 93 #define RLAPI __declspec(dllexport) // We are building the library as a Win32 shared library (.dll) 94 #elif defined(USE_LIBTYPE_SHARED) 95 #define RLAPI __declspec(dllimport) // We are using the library as a Win32 shared library (.dll) 96 #endif 97 #endif 98 99 #ifndef RLAPI 100 #define RLAPI // Functions defined as 'extern' by default (implicit specifiers) 101 #endif 102 103 //---------------------------------------------------------------------------------- 104 // Some basic Defines 105 //---------------------------------------------------------------------------------- 106 #ifndef PI 107 #define PI 3.14159265358979323846f 108 #endif 109 #ifndef DEG2RAD 110 #define DEG2RAD (PI/180.0f) 111 #endif 112 #ifndef RAD2DEG 113 #define RAD2DEG (180.0f/PI) 114 #endif 115 116 // Allow custom memory allocators 117 // NOTE: Require recompiling raylib sources 118 #ifndef RL_MALLOC 119 #define RL_MALLOC(sz) malloc(sz) 120 #endif 121 #ifndef RL_CALLOC 122 #define RL_CALLOC(n,sz) calloc(n,sz) 123 #endif 124 #ifndef RL_REALLOC 125 #define RL_REALLOC(ptr,sz) realloc(ptr,sz) 126 #endif 127 #ifndef RL_FREE 128 #define RL_FREE(ptr) free(ptr) 129 #endif 130 131 // NOTE: MSVC C++ compiler does not support compound literals (C99 feature) 132 // Plain structures in C++ (without constructors) can be initialized with { } 133 #if defined(__cplusplus) 134 #define CLITERAL(type) type 135 #else 136 #define CLITERAL(type) (type) 137 #endif 138 139 // NOTE: We set some defines with some data types declared by raylib 140 // Other modules (raymath, rlgl) also require some of those types, so, 141 // to be able to use those other modules as standalone (not depending on raylib) 142 // this defines are very useful for internal check and avoid type (re)definitions 143 #define RL_COLOR_TYPE 144 #define RL_RECTANGLE_TYPE 145 #define RL_VECTOR2_TYPE 146 #define RL_VECTOR3_TYPE 147 #define RL_VECTOR4_TYPE 148 #define RL_QUATERNION_TYPE 149 #define RL_MATRIX_TYPE 150 151 // Some Basic Colors 152 // NOTE: Custom raylib color palette for amazing visuals on WHITE background 153 #define LIGHTGRAY CLITERAL(Color){ 200, 200, 200, 255 } // Light Gray 154 #define GRAY CLITERAL(Color){ 130, 130, 130, 255 } // Gray 155 #define DARKGRAY CLITERAL(Color){ 80, 80, 80, 255 } // Dark Gray 156 #define YELLOW CLITERAL(Color){ 253, 249, 0, 255 } // Yellow 157 #define GOLD CLITERAL(Color){ 255, 203, 0, 255 } // Gold 158 #define ORANGE CLITERAL(Color){ 255, 161, 0, 255 } // Orange 159 #define PINK CLITERAL(Color){ 255, 109, 194, 255 } // Pink 160 #define RED CLITERAL(Color){ 230, 41, 55, 255 } // Red 161 #define MAROON CLITERAL(Color){ 190, 33, 55, 255 } // Maroon 162 #define GREEN CLITERAL(Color){ 0, 228, 48, 255 } // Green 163 #define LIME CLITERAL(Color){ 0, 158, 47, 255 } // Lime 164 #define DARKGREEN CLITERAL(Color){ 0, 117, 44, 255 } // Dark Green 165 #define SKYBLUE CLITERAL(Color){ 102, 191, 255, 255 } // Sky Blue 166 #define BLUE CLITERAL(Color){ 0, 121, 241, 255 } // Blue 167 #define DARKBLUE CLITERAL(Color){ 0, 82, 172, 255 } // Dark Blue 168 #define PURPLE CLITERAL(Color){ 200, 122, 255, 255 } // Purple 169 #define VIOLET CLITERAL(Color){ 135, 60, 190, 255 } // Violet 170 #define DARKPURPLE CLITERAL(Color){ 112, 31, 126, 255 } // Dark Purple 171 #define BEIGE CLITERAL(Color){ 211, 176, 131, 255 } // Beige 172 #define BROWN CLITERAL(Color){ 127, 106, 79, 255 } // Brown 173 #define DARKBROWN CLITERAL(Color){ 76, 63, 47, 255 } // Dark Brown 174 175 #define WHITE CLITERAL(Color){ 255, 255, 255, 255 } // White 176 #define BLACK CLITERAL(Color){ 0, 0, 0, 255 } // Black 177 #define BLANK CLITERAL(Color){ 0, 0, 0, 0 } // Blank (Transparent) 178 #define MAGENTA CLITERAL(Color){ 255, 0, 255, 255 } // Magenta 179 #define RAYWHITE CLITERAL(Color){ 245, 245, 245, 255 } // My own White (raylib logo) 180 181 //---------------------------------------------------------------------------------- 182 // Structures Definition 183 //---------------------------------------------------------------------------------- 184 // Boolean type 185 #if (defined(__STDC__) && __STDC_VERSION__ >= 199901L) || (defined(_MSC_VER) && _MSC_VER >= 1800) 186 #include <stdbool.h> 187 #elif !defined(__cplusplus) && !defined(bool) 188 typedef enum bool { false = 0, true = !false } bool; 189 #define RL_BOOL_TYPE 190 #endif 191 192 // Vector2, 2 components 193 typedef struct Vector2 { 194 float x; // Vector x component 195 float y; // Vector y component 196 } Vector2; 197 198 // Vector3, 3 components 199 typedef struct Vector3 { 200 float x; // Vector x component 201 float y; // Vector y component 202 float z; // Vector z component 203 } Vector3; 204 205 // Vector4, 4 components 206 typedef struct Vector4 { 207 float x; // Vector x component 208 float y; // Vector y component 209 float z; // Vector z component 210 float w; // Vector w component 211 } Vector4; 212 213 // Quaternion, 4 components (Vector4 alias) 214 typedef Vector4 Quaternion; 215 216 // Matrix, 4x4 components, column major, OpenGL style, right handed 217 typedef struct Matrix { 218 float m0, m4, m8, m12; // Matrix first row (4 components) 219 float m1, m5, m9, m13; // Matrix second row (4 components) 220 float m2, m6, m10, m14; // Matrix third row (4 components) 221 float m3, m7, m11, m15; // Matrix fourth row (4 components) 222 } Matrix; 223 224 // Color, 4 components, R8G8B8A8 (32bit) 225 typedef struct Color { 226 unsigned char r; // Color red value 227 unsigned char g; // Color green value 228 unsigned char b; // Color blue value 229 unsigned char a; // Color alpha value 230 } Color; 231 232 // Rectangle, 4 components 233 typedef struct Rectangle { 234 float x; // Rectangle top-left corner position x 235 float y; // Rectangle top-left corner position y 236 float width; // Rectangle width 237 float height; // Rectangle height 238 } Rectangle; 239 240 // Image, pixel data stored in CPU memory (RAM) 241 typedef struct Image { 242 void *data; // Image raw data 243 int width; // Image base width 244 int height; // Image base height 245 int mipmaps; // Mipmap levels, 1 by default 246 int format; // Data format (PixelFormat type) 247 } Image; 248 249 // Texture, tex data stored in GPU memory (VRAM) 250 typedef struct Texture { 251 unsigned int id; // OpenGL texture id 252 int width; // Texture base width 253 int height; // Texture base height 254 int mipmaps; // Mipmap levels, 1 by default 255 int format; // Data format (PixelFormat type) 256 } Texture; 257 258 // Texture2D, same as Texture 259 typedef Texture Texture2D; 260 261 // TextureCubemap, same as Texture 262 typedef Texture TextureCubemap; 263 264 // RenderTexture, fbo for texture rendering 265 typedef struct RenderTexture { 266 unsigned int id; // OpenGL framebuffer object id 267 Texture texture; // Color buffer attachment texture 268 Texture depth; // Depth buffer attachment texture 269 } RenderTexture; 270 271 // RenderTexture2D, same as RenderTexture 272 typedef RenderTexture RenderTexture2D; 273 274 // NPatchInfo, n-patch layout info 275 typedef struct NPatchInfo { 276 Rectangle source; // Texture source rectangle 277 int left; // Left border offset 278 int top; // Top border offset 279 int right; // Right border offset 280 int bottom; // Bottom border offset 281 int layout; // Layout of the n-patch: 3x3, 1x3 or 3x1 282 } NPatchInfo; 283 284 // GlyphInfo, font characters glyphs info 285 typedef struct GlyphInfo { 286 int value; // Character value (Unicode) 287 int offsetX; // Character offset X when drawing 288 int offsetY; // Character offset Y when drawing 289 int advanceX; // Character advance position X 290 Image image; // Character image data 291 } GlyphInfo; 292 293 // Font, font texture and GlyphInfo array data 294 typedef struct Font { 295 int baseSize; // Base size (default chars height) 296 int glyphCount; // Number of glyph characters 297 int glyphPadding; // Padding around the glyph characters 298 Texture2D texture; // Texture atlas containing the glyphs 299 Rectangle *recs; // Rectangles in texture for the glyphs 300 GlyphInfo *glyphs; // Glyphs info data 301 } Font; 302 303 // Camera, defines position/orientation in 3d space 304 typedef struct Camera3D { 305 Vector3 position; // Camera position 306 Vector3 target; // Camera target it looks-at 307 Vector3 up; // Camera up vector (rotation over its axis) 308 float fovy; // Camera field-of-view aperture in Y (degrees) in perspective, used as near plane width in orthographic 309 int projection; // Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC 310 } Camera3D; 311 312 typedef Camera3D Camera; // Camera type fallback, defaults to Camera3D 313 314 // Camera2D, defines position/orientation in 2d space 315 typedef struct Camera2D { 316 Vector2 offset; // Camera offset (displacement from target) 317 Vector2 target; // Camera target (rotation and zoom origin) 318 float rotation; // Camera rotation in degrees 319 float zoom; // Camera zoom (scaling), should be 1.0f by default 320 } Camera2D; 321 322 // Mesh, vertex data and vao/vbo 323 typedef struct Mesh { 324 int vertexCount; // Number of vertices stored in arrays 325 int triangleCount; // Number of triangles stored (indexed or not) 326 327 // Vertex attributes data 328 float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) 329 float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) 330 float *texcoords2; // Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5) 331 float *normals; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) 332 float *tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) 333 unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) 334 unsigned short *indices; // Vertex indices (in case vertex data comes indexed) 335 336 // Animation vertex data 337 float *animVertices; // Animated vertex positions (after bones transformations) 338 float *animNormals; // Animated normals (after bones transformations) 339 unsigned char *boneIds; // Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) 340 float *boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning) 341 342 // OpenGL identifiers 343 unsigned int vaoId; // OpenGL Vertex Array Object id 344 unsigned int *vboId; // OpenGL Vertex Buffer Objects id (default vertex data) 345 } Mesh; 346 347 // Shader 348 typedef struct Shader { 349 unsigned int id; // Shader program id 350 int *locs; // Shader locations array (RL_MAX_SHADER_LOCATIONS) 351 } Shader; 352 353 // MaterialMap 354 typedef struct MaterialMap { 355 Texture2D texture; // Material map texture 356 Color color; // Material map color 357 float value; // Material map value 358 } MaterialMap; 359 360 // Material, includes shader and maps 361 typedef struct Material { 362 Shader shader; // Material shader 363 MaterialMap *maps; // Material maps array (MAX_MATERIAL_MAPS) 364 float params[4]; // Material generic parameters (if required) 365 } Material; 366 367 // Transform, vertex transformation data 368 typedef struct Transform { 369 Vector3 translation; // Translation 370 Quaternion rotation; // Rotation 371 Vector3 scale; // Scale 372 } Transform; 373 374 // Bone, skeletal animation bone 375 typedef struct BoneInfo { 376 char name[32]; // Bone name 377 int parent; // Bone parent 378 } BoneInfo; 379 380 // Model, meshes, materials and animation data 381 typedef struct Model { 382 Matrix transform; // Local transform matrix 383 384 int meshCount; // Number of meshes 385 int materialCount; // Number of materials 386 Mesh *meshes; // Meshes array 387 Material *materials; // Materials array 388 int *meshMaterial; // Mesh material number 389 390 // Animation data 391 int boneCount; // Number of bones 392 BoneInfo *bones; // Bones information (skeleton) 393 Transform *bindPose; // Bones base transformation (pose) 394 } Model; 395 396 // ModelAnimation 397 typedef struct ModelAnimation { 398 int boneCount; // Number of bones 399 int frameCount; // Number of animation frames 400 BoneInfo *bones; // Bones information (skeleton) 401 Transform **framePoses; // Poses array by frame 402 } ModelAnimation; 403 404 // Ray, ray for raycasting 405 typedef struct Ray { 406 Vector3 position; // Ray position (origin) 407 Vector3 direction; // Ray direction 408 } Ray; 409 410 // RayCollision, ray hit information 411 typedef struct RayCollision { 412 bool hit; // Did the ray hit something? 413 float distance; // Distance to nearest hit 414 Vector3 point; // Point of nearest hit 415 Vector3 normal; // Surface normal of hit 416 } RayCollision; 417 418 // BoundingBox 419 typedef struct BoundingBox { 420 Vector3 min; // Minimum vertex box-corner 421 Vector3 max; // Maximum vertex box-corner 422 } BoundingBox; 423 424 // Wave, audio wave data 425 typedef struct Wave { 426 unsigned int frameCount; // Total number of frames (considering channels) 427 unsigned int sampleRate; // Frequency (samples per second) 428 unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) 429 unsigned int channels; // Number of channels (1-mono, 2-stereo, ...) 430 void *data; // Buffer data pointer 431 } Wave; 432 433 // Opaque structs declaration 434 // NOTE: Actual structs are defined internally in raudio module 435 typedef struct rAudioBuffer rAudioBuffer; 436 typedef struct rAudioProcessor rAudioProcessor; 437 438 // AudioStream, custom audio stream 439 typedef struct AudioStream { 440 rAudioBuffer *buffer; // Pointer to internal data used by the audio system 441 rAudioProcessor *processor; // Pointer to internal data processor, useful for audio effects 442 443 unsigned int sampleRate; // Frequency (samples per second) 444 unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) 445 unsigned int channels; // Number of channels (1-mono, 2-stereo, ...) 446 } AudioStream; 447 448 // Sound 449 typedef struct Sound { 450 AudioStream stream; // Audio stream 451 unsigned int frameCount; // Total number of frames (considering channels) 452 } Sound; 453 454 // Music, audio stream, anything longer than ~10 seconds should be streamed 455 typedef struct Music { 456 AudioStream stream; // Audio stream 457 unsigned int frameCount; // Total number of frames (considering channels) 458 bool looping; // Music looping enable 459 460 int ctxType; // Type of music context (audio filetype) 461 void *ctxData; // Audio context data, depends on type 462 } Music; 463 464 // VrDeviceInfo, Head-Mounted-Display device parameters 465 typedef struct VrDeviceInfo { 466 int hResolution; // Horizontal resolution in pixels 467 int vResolution; // Vertical resolution in pixels 468 float hScreenSize; // Horizontal size in meters 469 float vScreenSize; // Vertical size in meters 470 float vScreenCenter; // Screen center in meters 471 float eyeToScreenDistance; // Distance between eye and display in meters 472 float lensSeparationDistance; // Lens separation distance in meters 473 float interpupillaryDistance; // IPD (distance between pupils) in meters 474 float lensDistortionValues[4]; // Lens distortion constant parameters 475 float chromaAbCorrection[4]; // Chromatic aberration correction parameters 476 } VrDeviceInfo; 477 478 // VrStereoConfig, VR stereo rendering configuration for simulator 479 typedef struct VrStereoConfig { 480 Matrix projection[2]; // VR projection matrices (per eye) 481 Matrix viewOffset[2]; // VR view offset matrices (per eye) 482 float leftLensCenter[2]; // VR left lens center 483 float rightLensCenter[2]; // VR right lens center 484 float leftScreenCenter[2]; // VR left screen center 485 float rightScreenCenter[2]; // VR right screen center 486 float scale[2]; // VR distortion scale 487 float scaleIn[2]; // VR distortion scale in 488 } VrStereoConfig; 489 490 // File path list 491 typedef struct FilePathList { 492 unsigned int capacity; // Filepaths max entries 493 unsigned int count; // Filepaths entries count 494 char **paths; // Filepaths entries 495 } FilePathList; 496 497 //---------------------------------------------------------------------------------- 498 // Enumerators Definition 499 //---------------------------------------------------------------------------------- 500 // System/Window config flags 501 // NOTE: Every bit registers one state (use it with bit masks) 502 // By default all flags are set to 0 503 typedef enum { 504 FLAG_VSYNC_HINT = 0x00000040, // Set to try enabling V-Sync on GPU 505 FLAG_FULLSCREEN_MODE = 0x00000002, // Set to run program in fullscreen 506 FLAG_WINDOW_RESIZABLE = 0x00000004, // Set to allow resizable window 507 FLAG_WINDOW_UNDECORATED = 0x00000008, // Set to disable window decoration (frame and buttons) 508 FLAG_WINDOW_HIDDEN = 0x00000080, // Set to hide window 509 FLAG_WINDOW_MINIMIZED = 0x00000200, // Set to minimize window (iconify) 510 FLAG_WINDOW_MAXIMIZED = 0x00000400, // Set to maximize window (expanded to monitor) 511 FLAG_WINDOW_UNFOCUSED = 0x00000800, // Set to window non focused 512 FLAG_WINDOW_TOPMOST = 0x00001000, // Set to window always on top 513 FLAG_WINDOW_ALWAYS_RUN = 0x00000100, // Set to allow windows running while minimized 514 FLAG_WINDOW_TRANSPARENT = 0x00000010, // Set to allow transparent framebuffer 515 FLAG_WINDOW_HIGHDPI = 0x00002000, // Set to support HighDPI 516 FLAG_WINDOW_MOUSE_PASSTHROUGH = 0x00004000, // Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED 517 FLAG_MSAA_4X_HINT = 0x00000020, // Set to try enabling MSAA 4X 518 FLAG_INTERLACED_HINT = 0x00010000 // Set to try enabling interlaced video format (for V3D) 519 } ConfigFlags; 520 521 // Trace log level 522 // NOTE: Organized by priority level 523 typedef enum { 524 LOG_ALL = 0, // Display all logs 525 LOG_TRACE, // Trace logging, intended for internal use only 526 LOG_DEBUG, // Debug logging, used for internal debugging, it should be disabled on release builds 527 LOG_INFO, // Info logging, used for program execution info 528 LOG_WARNING, // Warning logging, used on recoverable failures 529 LOG_ERROR, // Error logging, used on unrecoverable failures 530 LOG_FATAL, // Fatal logging, used to abort program: exit(EXIT_FAILURE) 531 LOG_NONE // Disable logging 532 } TraceLogLevel; 533 534 // Keyboard keys (US keyboard layout) 535 // NOTE: Use GetKeyPressed() to allow redefining 536 // required keys for alternative layouts 537 typedef enum { 538 KEY_NULL = 0, // Key: NULL, used for no key pressed 539 // Alphanumeric keys 540 KEY_APOSTROPHE = 39, // Key: ' 541 KEY_COMMA = 44, // Key: , 542 KEY_MINUS = 45, // Key: - 543 KEY_PERIOD = 46, // Key: . 544 KEY_SLASH = 47, // Key: / 545 KEY_ZERO = 48, // Key: 0 546 KEY_ONE = 49, // Key: 1 547 KEY_TWO = 50, // Key: 2 548 KEY_THREE = 51, // Key: 3 549 KEY_FOUR = 52, // Key: 4 550 KEY_FIVE = 53, // Key: 5 551 KEY_SIX = 54, // Key: 6 552 KEY_SEVEN = 55, // Key: 7 553 KEY_EIGHT = 56, // Key: 8 554 KEY_NINE = 57, // Key: 9 555 KEY_SEMICOLON = 59, // Key: ; 556 KEY_EQUAL = 61, // Key: = 557 KEY_A = 65, // Key: A | a 558 KEY_B = 66, // Key: B | b 559 KEY_C = 67, // Key: C | c 560 KEY_D = 68, // Key: D | d 561 KEY_E = 69, // Key: E | e 562 KEY_F = 70, // Key: F | f 563 KEY_G = 71, // Key: G | g 564 KEY_H = 72, // Key: H | h 565 KEY_I = 73, // Key: I | i 566 KEY_J = 74, // Key: J | j 567 KEY_K = 75, // Key: K | k 568 KEY_L = 76, // Key: L | l 569 KEY_M = 77, // Key: M | m 570 KEY_N = 78, // Key: N | n 571 KEY_O = 79, // Key: O | o 572 KEY_P = 80, // Key: P | p 573 KEY_Q = 81, // Key: Q | q 574 KEY_R = 82, // Key: R | r 575 KEY_S = 83, // Key: S | s 576 KEY_T = 84, // Key: T | t 577 KEY_U = 85, // Key: U | u 578 KEY_V = 86, // Key: V | v 579 KEY_W = 87, // Key: W | w 580 KEY_X = 88, // Key: X | x 581 KEY_Y = 89, // Key: Y | y 582 KEY_Z = 90, // Key: Z | z 583 KEY_LEFT_BRACKET = 91, // Key: [ 584 KEY_BACKSLASH = 92, // Key: '\' 585 KEY_RIGHT_BRACKET = 93, // Key: ] 586 KEY_GRAVE = 96, // Key: ` 587 // Function keys 588 KEY_SPACE = 32, // Key: Space 589 KEY_ESCAPE = 256, // Key: Esc 590 KEY_ENTER = 257, // Key: Enter 591 KEY_TAB = 258, // Key: Tab 592 KEY_BACKSPACE = 259, // Key: Backspace 593 KEY_INSERT = 260, // Key: Ins 594 KEY_DELETE = 261, // Key: Del 595 KEY_RIGHT = 262, // Key: Cursor right 596 KEY_LEFT = 263, // Key: Cursor left 597 KEY_DOWN = 264, // Key: Cursor down 598 KEY_UP = 265, // Key: Cursor up 599 KEY_PAGE_UP = 266, // Key: Page up 600 KEY_PAGE_DOWN = 267, // Key: Page down 601 KEY_HOME = 268, // Key: Home 602 KEY_END = 269, // Key: End 603 KEY_CAPS_LOCK = 280, // Key: Caps lock 604 KEY_SCROLL_LOCK = 281, // Key: Scroll down 605 KEY_NUM_LOCK = 282, // Key: Num lock 606 KEY_PRINT_SCREEN = 283, // Key: Print screen 607 KEY_PAUSE = 284, // Key: Pause 608 KEY_F1 = 290, // Key: F1 609 KEY_F2 = 291, // Key: F2 610 KEY_F3 = 292, // Key: F3 611 KEY_F4 = 293, // Key: F4 612 KEY_F5 = 294, // Key: F5 613 KEY_F6 = 295, // Key: F6 614 KEY_F7 = 296, // Key: F7 615 KEY_F8 = 297, // Key: F8 616 KEY_F9 = 298, // Key: F9 617 KEY_F10 = 299, // Key: F10 618 KEY_F11 = 300, // Key: F11 619 KEY_F12 = 301, // Key: F12 620 KEY_LEFT_SHIFT = 340, // Key: Shift left 621 KEY_LEFT_CONTROL = 341, // Key: Control left 622 KEY_LEFT_ALT = 342, // Key: Alt left 623 KEY_LEFT_SUPER = 343, // Key: Super left 624 KEY_RIGHT_SHIFT = 344, // Key: Shift right 625 KEY_RIGHT_CONTROL = 345, // Key: Control right 626 KEY_RIGHT_ALT = 346, // Key: Alt right 627 KEY_RIGHT_SUPER = 347, // Key: Super right 628 KEY_KB_MENU = 348, // Key: KB menu 629 // Keypad keys 630 KEY_KP_0 = 320, // Key: Keypad 0 631 KEY_KP_1 = 321, // Key: Keypad 1 632 KEY_KP_2 = 322, // Key: Keypad 2 633 KEY_KP_3 = 323, // Key: Keypad 3 634 KEY_KP_4 = 324, // Key: Keypad 4 635 KEY_KP_5 = 325, // Key: Keypad 5 636 KEY_KP_6 = 326, // Key: Keypad 6 637 KEY_KP_7 = 327, // Key: Keypad 7 638 KEY_KP_8 = 328, // Key: Keypad 8 639 KEY_KP_9 = 329, // Key: Keypad 9 640 KEY_KP_DECIMAL = 330, // Key: Keypad . 641 KEY_KP_DIVIDE = 331, // Key: Keypad / 642 KEY_KP_MULTIPLY = 332, // Key: Keypad * 643 KEY_KP_SUBTRACT = 333, // Key: Keypad - 644 KEY_KP_ADD = 334, // Key: Keypad + 645 KEY_KP_ENTER = 335, // Key: Keypad Enter 646 KEY_KP_EQUAL = 336, // Key: Keypad = 647 // Android key buttons 648 KEY_BACK = 4, // Key: Android back button 649 KEY_MENU = 82, // Key: Android menu button 650 KEY_VOLUME_UP = 24, // Key: Android volume up button 651 KEY_VOLUME_DOWN = 25 // Key: Android volume down button 652 } KeyboardKey; 653 654 // Add backwards compatibility support for deprecated names 655 #define MOUSE_LEFT_BUTTON MOUSE_BUTTON_LEFT 656 #define MOUSE_RIGHT_BUTTON MOUSE_BUTTON_RIGHT 657 #define MOUSE_MIDDLE_BUTTON MOUSE_BUTTON_MIDDLE 658 659 // Mouse buttons 660 typedef enum { 661 MOUSE_BUTTON_LEFT = 0, // Mouse button left 662 MOUSE_BUTTON_RIGHT = 1, // Mouse button right 663 MOUSE_BUTTON_MIDDLE = 2, // Mouse button middle (pressed wheel) 664 MOUSE_BUTTON_SIDE = 3, // Mouse button side (advanced mouse device) 665 MOUSE_BUTTON_EXTRA = 4, // Mouse button extra (advanced mouse device) 666 MOUSE_BUTTON_FORWARD = 5, // Mouse button forward (advanced mouse device) 667 MOUSE_BUTTON_BACK = 6, // Mouse button back (advanced mouse device) 668 } MouseButton; 669 670 // Mouse cursor 671 typedef enum { 672 MOUSE_CURSOR_DEFAULT = 0, // Default pointer shape 673 MOUSE_CURSOR_ARROW = 1, // Arrow shape 674 MOUSE_CURSOR_IBEAM = 2, // Text writing cursor shape 675 MOUSE_CURSOR_CROSSHAIR = 3, // Cross shape 676 MOUSE_CURSOR_POINTING_HAND = 4, // Pointing hand cursor 677 MOUSE_CURSOR_RESIZE_EW = 5, // Horizontal resize/move arrow shape 678 MOUSE_CURSOR_RESIZE_NS = 6, // Vertical resize/move arrow shape 679 MOUSE_CURSOR_RESIZE_NWSE = 7, // Top-left to bottom-right diagonal resize/move arrow shape 680 MOUSE_CURSOR_RESIZE_NESW = 8, // The top-right to bottom-left diagonal resize/move arrow shape 681 MOUSE_CURSOR_RESIZE_ALL = 9, // The omni-directional resize/move cursor shape 682 MOUSE_CURSOR_NOT_ALLOWED = 10 // The operation-not-allowed shape 683 } MouseCursor; 684 685 // Gamepad buttons 686 typedef enum { 687 GAMEPAD_BUTTON_UNKNOWN = 0, // Unknown button, just for error checking 688 GAMEPAD_BUTTON_LEFT_FACE_UP, // Gamepad left DPAD up button 689 GAMEPAD_BUTTON_LEFT_FACE_RIGHT, // Gamepad left DPAD right button 690 GAMEPAD_BUTTON_LEFT_FACE_DOWN, // Gamepad left DPAD down button 691 GAMEPAD_BUTTON_LEFT_FACE_LEFT, // Gamepad left DPAD left button 692 GAMEPAD_BUTTON_RIGHT_FACE_UP, // Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) 693 GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, // Gamepad right button right (i.e. PS3: Square, Xbox: X) 694 GAMEPAD_BUTTON_RIGHT_FACE_DOWN, // Gamepad right button down (i.e. PS3: Cross, Xbox: A) 695 GAMEPAD_BUTTON_RIGHT_FACE_LEFT, // Gamepad right button left (i.e. PS3: Circle, Xbox: B) 696 GAMEPAD_BUTTON_LEFT_TRIGGER_1, // Gamepad top/back trigger left (first), it could be a trailing button 697 GAMEPAD_BUTTON_LEFT_TRIGGER_2, // Gamepad top/back trigger left (second), it could be a trailing button 698 GAMEPAD_BUTTON_RIGHT_TRIGGER_1, // Gamepad top/back trigger right (one), it could be a trailing button 699 GAMEPAD_BUTTON_RIGHT_TRIGGER_2, // Gamepad top/back trigger right (second), it could be a trailing button 700 GAMEPAD_BUTTON_MIDDLE_LEFT, // Gamepad center buttons, left one (i.e. PS3: Select) 701 GAMEPAD_BUTTON_MIDDLE, // Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX) 702 GAMEPAD_BUTTON_MIDDLE_RIGHT, // Gamepad center buttons, right one (i.e. PS3: Start) 703 GAMEPAD_BUTTON_LEFT_THUMB, // Gamepad joystick pressed button left 704 GAMEPAD_BUTTON_RIGHT_THUMB // Gamepad joystick pressed button right 705 } GamepadButton; 706 707 // Gamepad axis 708 typedef enum { 709 GAMEPAD_AXIS_LEFT_X = 0, // Gamepad left stick X axis 710 GAMEPAD_AXIS_LEFT_Y = 1, // Gamepad left stick Y axis 711 GAMEPAD_AXIS_RIGHT_X = 2, // Gamepad right stick X axis 712 GAMEPAD_AXIS_RIGHT_Y = 3, // Gamepad right stick Y axis 713 GAMEPAD_AXIS_LEFT_TRIGGER = 4, // Gamepad back trigger left, pressure level: [1..-1] 714 GAMEPAD_AXIS_RIGHT_TRIGGER = 5 // Gamepad back trigger right, pressure level: [1..-1] 715 } GamepadAxis; 716 717 // Material map index 718 typedef enum { 719 MATERIAL_MAP_ALBEDO = 0, // Albedo material (same as: MATERIAL_MAP_DIFFUSE) 720 MATERIAL_MAP_METALNESS, // Metalness material (same as: MATERIAL_MAP_SPECULAR) 721 MATERIAL_MAP_NORMAL, // Normal material 722 MATERIAL_MAP_ROUGHNESS, // Roughness material 723 MATERIAL_MAP_OCCLUSION, // Ambient occlusion material 724 MATERIAL_MAP_EMISSION, // Emission material 725 MATERIAL_MAP_HEIGHT, // Heightmap material 726 MATERIAL_MAP_CUBEMAP, // Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) 727 MATERIAL_MAP_IRRADIANCE, // Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) 728 MATERIAL_MAP_PREFILTER, // Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) 729 MATERIAL_MAP_BRDF // Brdf material 730 } MaterialMapIndex; 731 732 #define MATERIAL_MAP_DIFFUSE MATERIAL_MAP_ALBEDO 733 #define MATERIAL_MAP_SPECULAR MATERIAL_MAP_METALNESS 734 735 // Shader location index 736 typedef enum { 737 SHADER_LOC_VERTEX_POSITION = 0, // Shader location: vertex attribute: position 738 SHADER_LOC_VERTEX_TEXCOORD01, // Shader location: vertex attribute: texcoord01 739 SHADER_LOC_VERTEX_TEXCOORD02, // Shader location: vertex attribute: texcoord02 740 SHADER_LOC_VERTEX_NORMAL, // Shader location: vertex attribute: normal 741 SHADER_LOC_VERTEX_TANGENT, // Shader location: vertex attribute: tangent 742 SHADER_LOC_VERTEX_COLOR, // Shader location: vertex attribute: color 743 SHADER_LOC_MATRIX_MVP, // Shader location: matrix uniform: model-view-projection 744 SHADER_LOC_MATRIX_VIEW, // Shader location: matrix uniform: view (camera transform) 745 SHADER_LOC_MATRIX_PROJECTION, // Shader location: matrix uniform: projection 746 SHADER_LOC_MATRIX_MODEL, // Shader location: matrix uniform: model (transform) 747 SHADER_LOC_MATRIX_NORMAL, // Shader location: matrix uniform: normal 748 SHADER_LOC_VECTOR_VIEW, // Shader location: vector uniform: view 749 SHADER_LOC_COLOR_DIFFUSE, // Shader location: vector uniform: diffuse color 750 SHADER_LOC_COLOR_SPECULAR, // Shader location: vector uniform: specular color 751 SHADER_LOC_COLOR_AMBIENT, // Shader location: vector uniform: ambient color 752 SHADER_LOC_MAP_ALBEDO, // Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE) 753 SHADER_LOC_MAP_METALNESS, // Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR) 754 SHADER_LOC_MAP_NORMAL, // Shader location: sampler2d texture: normal 755 SHADER_LOC_MAP_ROUGHNESS, // Shader location: sampler2d texture: roughness 756 SHADER_LOC_MAP_OCCLUSION, // Shader location: sampler2d texture: occlusion 757 SHADER_LOC_MAP_EMISSION, // Shader location: sampler2d texture: emission 758 SHADER_LOC_MAP_HEIGHT, // Shader location: sampler2d texture: height 759 SHADER_LOC_MAP_CUBEMAP, // Shader location: samplerCube texture: cubemap 760 SHADER_LOC_MAP_IRRADIANCE, // Shader location: samplerCube texture: irradiance 761 SHADER_LOC_MAP_PREFILTER, // Shader location: samplerCube texture: prefilter 762 SHADER_LOC_MAP_BRDF // Shader location: sampler2d texture: brdf 763 } ShaderLocationIndex; 764 765 #define SHADER_LOC_MAP_DIFFUSE SHADER_LOC_MAP_ALBEDO 766 #define SHADER_LOC_MAP_SPECULAR SHADER_LOC_MAP_METALNESS 767 768 // Shader uniform data type 769 typedef enum { 770 SHADER_UNIFORM_FLOAT = 0, // Shader uniform type: float 771 SHADER_UNIFORM_VEC2, // Shader uniform type: vec2 (2 float) 772 SHADER_UNIFORM_VEC3, // Shader uniform type: vec3 (3 float) 773 SHADER_UNIFORM_VEC4, // Shader uniform type: vec4 (4 float) 774 SHADER_UNIFORM_INT, // Shader uniform type: int 775 SHADER_UNIFORM_IVEC2, // Shader uniform type: ivec2 (2 int) 776 SHADER_UNIFORM_IVEC3, // Shader uniform type: ivec3 (3 int) 777 SHADER_UNIFORM_IVEC4, // Shader uniform type: ivec4 (4 int) 778 SHADER_UNIFORM_SAMPLER2D // Shader uniform type: sampler2d 779 } ShaderUniformDataType; 780 781 // Shader attribute data types 782 typedef enum { 783 SHADER_ATTRIB_FLOAT = 0, // Shader attribute type: float 784 SHADER_ATTRIB_VEC2, // Shader attribute type: vec2 (2 float) 785 SHADER_ATTRIB_VEC3, // Shader attribute type: vec3 (3 float) 786 SHADER_ATTRIB_VEC4 // Shader attribute type: vec4 (4 float) 787 } ShaderAttributeDataType; 788 789 // Pixel formats 790 // NOTE: Support depends on OpenGL version and platform 791 typedef enum { 792 PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) 793 PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels) 794 PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp 795 PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp 796 PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) 797 PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha) 798 PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, // 32 bpp 799 PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float) 800 PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float) 801 PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float) 802 PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha) 803 PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha) 804 PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp 805 PIXELFORMAT_COMPRESSED_DXT5_RGBA, // 8 bpp 806 PIXELFORMAT_COMPRESSED_ETC1_RGB, // 4 bpp 807 PIXELFORMAT_COMPRESSED_ETC2_RGB, // 4 bpp 808 PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, // 8 bpp 809 PIXELFORMAT_COMPRESSED_PVRT_RGB, // 4 bpp 810 PIXELFORMAT_COMPRESSED_PVRT_RGBA, // 4 bpp 811 PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, // 8 bpp 812 PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA // 2 bpp 813 } PixelFormat; 814 815 // Texture parameters: filter mode 816 // NOTE 1: Filtering considers mipmaps if available in the texture 817 // NOTE 2: Filter is accordingly set for minification and magnification 818 typedef enum { 819 TEXTURE_FILTER_POINT = 0, // No filter, just pixel approximation 820 TEXTURE_FILTER_BILINEAR, // Linear filtering 821 TEXTURE_FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) 822 TEXTURE_FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x 823 TEXTURE_FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x 824 TEXTURE_FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x 825 } TextureFilter; 826 827 // Texture parameters: wrap mode 828 typedef enum { 829 TEXTURE_WRAP_REPEAT = 0, // Repeats texture in tiled mode 830 TEXTURE_WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode 831 TEXTURE_WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode 832 TEXTURE_WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode 833 } TextureWrap; 834 835 // Cubemap layouts 836 typedef enum { 837 CUBEMAP_LAYOUT_AUTO_DETECT = 0, // Automatically detect layout type 838 CUBEMAP_LAYOUT_LINE_VERTICAL, // Layout is defined by a vertical line with faces 839 CUBEMAP_LAYOUT_LINE_HORIZONTAL, // Layout is defined by an horizontal line with faces 840 CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces 841 CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces 842 CUBEMAP_LAYOUT_PANORAMA // Layout is defined by a panorama image (equirectangular map) 843 } CubemapLayout; 844 845 // Font type, defines generation method 846 typedef enum { 847 FONT_DEFAULT = 0, // Default font generation, anti-aliased 848 FONT_BITMAP, // Bitmap font generation, no anti-aliasing 849 FONT_SDF // SDF font generation, requires external shader 850 } FontType; 851 852 // Color blending modes (pre-defined) 853 typedef enum { 854 BLEND_ALPHA = 0, // Blend textures considering alpha (default) 855 BLEND_ADDITIVE, // Blend textures adding colors 856 BLEND_MULTIPLIED, // Blend textures multiplying colors 857 BLEND_ADD_COLORS, // Blend textures adding colors (alternative) 858 BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative) 859 BLEND_ALPHA_PREMULTIPLY, // Blend premultiplied textures considering alpha 860 BLEND_CUSTOM, // Blend textures using custom src/dst factors (use rlSetBlendMode()) 861 BLEND_CUSTOM_SEPARATE // Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendModeSeparate()) 862 } BlendMode; 863 864 // Gesture 865 // NOTE: It could be used as flags to enable only some gestures 866 typedef enum { 867 GESTURE_NONE = 0, // No gesture 868 GESTURE_TAP = 1, // Tap gesture 869 GESTURE_DOUBLETAP = 2, // Double tap gesture 870 GESTURE_HOLD = 4, // Hold gesture 871 GESTURE_DRAG = 8, // Drag gesture 872 GESTURE_SWIPE_RIGHT = 16, // Swipe right gesture 873 GESTURE_SWIPE_LEFT = 32, // Swipe left gesture 874 GESTURE_SWIPE_UP = 64, // Swipe up gesture 875 GESTURE_SWIPE_DOWN = 128, // Swipe down gesture 876 GESTURE_PINCH_IN = 256, // Pinch in gesture 877 GESTURE_PINCH_OUT = 512 // Pinch out gesture 878 } Gesture; 879 880 // Camera system modes 881 typedef enum { 882 CAMERA_CUSTOM = 0, // Custom camera 883 CAMERA_FREE, // Free camera 884 CAMERA_ORBITAL, // Orbital camera 885 CAMERA_FIRST_PERSON, // First person camera 886 CAMERA_THIRD_PERSON // Third person camera 887 } CameraMode; 888 889 // Camera projection 890 typedef enum { 891 CAMERA_PERSPECTIVE = 0, // Perspective projection 892 CAMERA_ORTHOGRAPHIC // Orthographic projection 893 } CameraProjection; 894 895 // N-patch layout 896 typedef enum { 897 NPATCH_NINE_PATCH = 0, // Npatch layout: 3x3 tiles 898 NPATCH_THREE_PATCH_VERTICAL, // Npatch layout: 1x3 tiles 899 NPATCH_THREE_PATCH_HORIZONTAL // Npatch layout: 3x1 tiles 900 } NPatchLayout; 901 902 // Callbacks to hook some internal functions 903 // WARNING: This callbacks are intended for advance users 904 typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args); // Logging: Redirect trace log messages 905 typedef unsigned char *(*LoadFileDataCallback)(const char *fileName, unsigned int *bytesRead); // FileIO: Load binary data 906 typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, unsigned int bytesToWrite); // FileIO: Save binary data 907 typedef char *(*LoadFileTextCallback)(const char *fileName); // FileIO: Load text data 908 typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileIO: Save text data 909 910 //------------------------------------------------------------------------------------ 911 // Global Variables Definition 912 //------------------------------------------------------------------------------------ 913 // It's lonely here... 914 915 //------------------------------------------------------------------------------------ 916 // Window and Graphics Device Functions (Module: core) 917 //------------------------------------------------------------------------------------ 918 919 #if defined(__cplusplus) 920 extern "C" { // Prevents name mangling of functions 921 #endif 922 923 // Window-related functions 924 RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context 925 RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed 926 RLAPI void CloseWindow(void); // Close window and unload OpenGL context 927 RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully 928 RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen 929 RLAPI bool IsWindowHidden(void); // Check if window is currently hidden (only PLATFORM_DESKTOP) 930 RLAPI bool IsWindowMinimized(void); // Check if window is currently minimized (only PLATFORM_DESKTOP) 931 RLAPI bool IsWindowMaximized(void); // Check if window is currently maximized (only PLATFORM_DESKTOP) 932 RLAPI bool IsWindowFocused(void); // Check if window is currently focused (only PLATFORM_DESKTOP) 933 RLAPI bool IsWindowResized(void); // Check if window has been resized last frame 934 RLAPI bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled 935 RLAPI void SetWindowState(unsigned int flags); // Set window configuration state using flags (only PLATFORM_DESKTOP) 936 RLAPI void ClearWindowState(unsigned int flags); // Clear window configuration state flags 937 RLAPI void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) 938 RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP) 939 RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP) 940 RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP) 941 RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) 942 RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP) 943 RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) 944 RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) 945 RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) 946 RLAPI void SetWindowSize(int width, int height); // Set window dimensions 947 RLAPI void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) 948 RLAPI void *GetWindowHandle(void); // Get native window handle 949 RLAPI int GetScreenWidth(void); // Get current screen width 950 RLAPI int GetScreenHeight(void); // Get current screen height 951 RLAPI int GetRenderWidth(void); // Get current render width (it considers HiDPI) 952 RLAPI int GetRenderHeight(void); // Get current render height (it considers HiDPI) 953 RLAPI int GetMonitorCount(void); // Get number of connected monitors 954 RLAPI int GetCurrentMonitor(void); // Get current connected monitor 955 RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position 956 RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width (current video mode used by monitor) 957 RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height (current video mode used by monitor) 958 RLAPI int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres 959 RLAPI int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres 960 RLAPI int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate 961 RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor 962 RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor 963 RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor 964 RLAPI void SetClipboardText(const char *text); // Set clipboard text content 965 RLAPI const char *GetClipboardText(void); // Get clipboard text content 966 RLAPI void EnableEventWaiting(void); // Enable waiting for events on EndDrawing(), no automatic event polling 967 RLAPI void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling 968 969 // Custom frame control functions 970 // NOTE: Those functions are intended for advance users that want full control over the frame processing 971 // By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents() 972 // To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL 973 RLAPI void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing) 974 RLAPI void PollInputEvents(void); // Register all input events 975 RLAPI void WaitTime(double seconds); // Wait for some time (halt program execution) 976 977 // Cursor-related functions 978 RLAPI void ShowCursor(void); // Shows cursor 979 RLAPI void HideCursor(void); // Hides cursor 980 RLAPI bool IsCursorHidden(void); // Check if cursor is not visible 981 RLAPI void EnableCursor(void); // Enables cursor (unlock cursor) 982 RLAPI void DisableCursor(void); // Disables cursor (lock cursor) 983 RLAPI bool IsCursorOnScreen(void); // Check if cursor is on the screen 984 985 // Drawing-related functions 986 RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color) 987 RLAPI void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing 988 RLAPI void EndDrawing(void); // End canvas drawing and swap buffers (double buffering) 989 RLAPI void BeginMode2D(Camera2D camera); // Begin 2D mode with custom camera (2D) 990 RLAPI void EndMode2D(void); // Ends 2D mode with custom camera 991 RLAPI void BeginMode3D(Camera3D camera); // Begin 3D mode with custom camera (3D) 992 RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode 993 RLAPI void BeginTextureMode(RenderTexture2D target); // Begin drawing to render texture 994 RLAPI void EndTextureMode(void); // Ends drawing to render texture 995 RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing 996 RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) 997 RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied, subtract, custom) 998 RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) 999 RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) 1000 RLAPI void EndScissorMode(void); // End scissor mode 1001 RLAPI void BeginVrStereoMode(VrStereoConfig config); // Begin stereo rendering (requires VR simulator) 1002 RLAPI void EndVrStereoMode(void); // End stereo rendering (requires VR simulator) 1003 1004 // VR stereo config functions for VR simulator 1005 RLAPI VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); // Load VR stereo config for VR simulator device parameters 1006 RLAPI void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR stereo config 1007 1008 // Shader management functions 1009 // NOTE: Shader functionality is not available on OpenGL 1.1 1010 RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations 1011 RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations 1012 RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location 1013 RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location 1014 RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value 1015 RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector 1016 RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4) 1017 RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d) 1018 RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) 1019 1020 // Screen-space-related functions 1021 RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Get a ray trace from mouse position 1022 RLAPI Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix) 1023 RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix 1024 RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position 1025 RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position 1026 RLAPI Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get size position for a 3d world space position 1027 RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position 1028 1029 // Timing-related functions 1030 RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) 1031 RLAPI int GetFPS(void); // Get current FPS 1032 RLAPI float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time) 1033 RLAPI double GetTime(void); // Get elapsed time in seconds since InitWindow() 1034 1035 // Misc. functions 1036 RLAPI int GetRandomValue(int min, int max); // Get a random value between min and max (both included) 1037 RLAPI void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator 1038 RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format) 1039 RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS) 1040 1041 RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) 1042 RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level 1043 RLAPI void *MemAlloc(unsigned int size); // Internal memory allocator 1044 RLAPI void *MemRealloc(void *ptr, unsigned int size); // Internal memory reallocator 1045 RLAPI void MemFree(void *ptr); // Internal memory free 1046 1047 RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available) 1048 1049 // Set custom callbacks 1050 // WARNING: Callbacks setup is intended for advance users 1051 RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log 1052 RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader 1053 RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver 1054 RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader 1055 RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver 1056 1057 // Files management functions 1058 RLAPI unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read) 1059 RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData() 1060 RLAPI bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write), returns true on success 1061 RLAPI bool ExportDataAsCode(const unsigned char *data, unsigned int size, const char *fileName); // Export data to code (.h), returns true on success 1062 RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string 1063 RLAPI void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText() 1064 RLAPI bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success 1065 RLAPI bool FileExists(const char *fileName); // Check if file exists 1066 RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists 1067 RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (including point: .png, .wav) 1068 RLAPI int GetFileLength(const char *fileName); // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) 1069 RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png') 1070 RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string 1071 RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string) 1072 RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string) 1073 RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string) 1074 RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) 1075 RLAPI const char *GetApplicationDirectory(void); // Get the directory if the running application (uses static string) 1076 RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success 1077 RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory 1078 RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths 1079 RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan 1080 RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths 1081 RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window 1082 RLAPI FilePathList LoadDroppedFiles(void); // Load dropped filepaths 1083 RLAPI void UnloadDroppedFiles(FilePathList files); // Unload dropped filepaths 1084 RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) 1085 1086 // Compression/Encoding functionality 1087 RLAPI unsigned char *CompressData(const unsigned char *data, int dataSize, int *compDataSize); // Compress data (DEFLATE algorithm), memory must be MemFree() 1088 RLAPI unsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize); // Decompress data (DEFLATE algorithm), memory must be MemFree() 1089 RLAPI char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize); // Encode data to Base64 string, memory must be MemFree() 1090 RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree() 1091 1092 //------------------------------------------------------------------------------------ 1093 // Input Handling Functions (Module: core) 1094 //------------------------------------------------------------------------------------ 1095 1096 // Input-related functions: keyboard 1097 RLAPI bool IsKeyPressed(int key); // Check if a key has been pressed once 1098 RLAPI bool IsKeyDown(int key); // Check if a key is being pressed 1099 RLAPI bool IsKeyReleased(int key); // Check if a key has been released once 1100 RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed 1101 RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) 1102 RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty 1103 RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty 1104 1105 // Input-related functions: gamepads 1106 RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available 1107 RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id 1108 RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once 1109 RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed 1110 RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once 1111 RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed 1112 RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed 1113 RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad 1114 RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis 1115 RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) 1116 1117 // Input-related functions: mouse 1118 RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once 1119 RLAPI bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed 1120 RLAPI bool IsMouseButtonReleased(int button); // Check if a mouse button has been released once 1121 RLAPI bool IsMouseButtonUp(int button); // Check if a mouse button is NOT being pressed 1122 RLAPI int GetMouseX(void); // Get mouse position X 1123 RLAPI int GetMouseY(void); // Get mouse position Y 1124 RLAPI Vector2 GetMousePosition(void); // Get mouse position XY 1125 RLAPI Vector2 GetMouseDelta(void); // Get mouse delta between frames 1126 RLAPI void SetMousePosition(int x, int y); // Set mouse position XY 1127 RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset 1128 RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling 1129 RLAPI float GetMouseWheelMove(void); // Get mouse wheel movement for X or Y, whichever is larger 1130 RLAPI Vector2 GetMouseWheelMoveV(void); // Get mouse wheel movement for both X and Y 1131 RLAPI void SetMouseCursor(int cursor); // Set mouse cursor 1132 1133 // Input-related functions: touch 1134 RLAPI int GetTouchX(void); // Get touch position X for touch point 0 (relative to screen size) 1135 RLAPI int GetTouchY(void); // Get touch position Y for touch point 0 (relative to screen size) 1136 RLAPI Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size) 1137 RLAPI int GetTouchPointId(int index); // Get touch point identifier for given index 1138 RLAPI int GetTouchPointCount(void); // Get number of touch points 1139 1140 //------------------------------------------------------------------------------------ 1141 // Gestures and Touch Handling Functions (Module: rgestures) 1142 //------------------------------------------------------------------------------------ 1143 RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags 1144 RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected 1145 RLAPI int GetGestureDetected(void); // Get latest detected gesture 1146 RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds 1147 RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector 1148 RLAPI float GetGestureDragAngle(void); // Get gesture drag angle 1149 RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta 1150 RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle 1151 1152 //------------------------------------------------------------------------------------ 1153 // Camera System Functions (Module: rcamera) 1154 //------------------------------------------------------------------------------------ 1155 RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) 1156 RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode 1157 1158 RLAPI void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera) 1159 RLAPI void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera) 1160 RLAPI void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera) 1161 RLAPI void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras) 1162 1163 //------------------------------------------------------------------------------------ 1164 // Basic Shapes Drawing Functions (Module: shapes) 1165 //------------------------------------------------------------------------------------ 1166 // Set texture and rectangle to be used on shapes drawing 1167 // NOTE: It can be useful when using basic shapes and one single font, 1168 // defining a font char white rectangle would allow drawing everything in a single draw call 1169 RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing 1170 1171 // Basic shapes drawing functions 1172 RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel 1173 RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) 1174 RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line 1175 RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) 1176 RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness 1177 RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out 1178 RLAPI void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color); // Draw line using quadratic bezier curves with a control point 1179 RLAPI void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color); // Draw line using cubic bezier curves with 2 control points 1180 RLAPI void DrawLineStrip(Vector2 *points, int pointCount, Color color); // Draw lines sequence 1181 RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle 1182 RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle 1183 RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline 1184 RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle 1185 RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) 1186 RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline 1187 RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse 1188 RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline 1189 RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring 1190 RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline 1191 RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle 1192 RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) 1193 RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle 1194 RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters 1195 RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle 1196 RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle 1197 RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors 1198 RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline 1199 RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters 1200 RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges 1201 RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline 1202 RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) 1203 RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) 1204 RLAPI void DrawTriangleFan(Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) 1205 RLAPI void DrawTriangleStrip(Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points 1206 RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) 1207 RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides 1208 RLAPI void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters 1209 1210 // Basic shapes collision detection functions 1211 RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles 1212 RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles 1213 RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle 1214 RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle 1215 RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle 1216 RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle 1217 RLAPI bool CheckCollisionPointPoly(Vector2 point, Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices 1218 RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference 1219 RLAPI bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] 1220 RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision 1221 1222 //------------------------------------------------------------------------------------ 1223 // Texture Loading and Drawing Functions (Module: textures) 1224 //------------------------------------------------------------------------------------ 1225 1226 // Image loading functions 1227 // NOTE: This functions do not require GPU access 1228 RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) 1229 RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data 1230 RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) 1231 RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' 1232 RLAPI Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data 1233 RLAPI Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot) 1234 RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) 1235 RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success 1236 RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success 1237 1238 // Image generation functions 1239 RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color 1240 RLAPI Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient 1241 RLAPI Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient 1242 RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient 1243 RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked 1244 RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise 1245 RLAPI Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); // Generate image: perlin noise 1246 RLAPI Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm, bigger tileSize means bigger cells 1247 RLAPI Image GenImageText(int width, int height, const char *text); // Generate image: grayscale image from text data 1248 1249 // Image manipulation functions 1250 RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) 1251 RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece 1252 RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) 1253 RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) 1254 RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format 1255 RLAPI void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two) 1256 RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle 1257 RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value 1258 RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color 1259 RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image 1260 RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel 1261 RLAPI void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation 1262 RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) 1263 RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) 1264 RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color 1265 RLAPI void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image 1266 RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) 1267 RLAPI void ImageFlipVertical(Image *image); // Flip image vertically 1268 RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally 1269 RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg 1270 RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg 1271 RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint 1272 RLAPI void ImageColorInvert(Image *image); // Modify image color: invert 1273 RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale 1274 RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) 1275 RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) 1276 RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color 1277 RLAPI Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit) 1278 RLAPI Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount); // Load colors palette from image as a Color array (RGBA - 32bit) 1279 RLAPI void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors() 1280 RLAPI void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette() 1281 RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle 1282 RLAPI Color GetImageColor(Image image, int x, int y); // Get image pixel color at (x, y) position 1283 1284 // Image drawing functions 1285 // NOTE: Image software-rendering functions (CPU) 1286 RLAPI void ImageClearBackground(Image *dst, Color color); // Clear image background with given color 1287 RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); // Draw pixel within an image 1288 RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) 1289 RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image 1290 RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) 1291 RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw a filled circle within an image 1292 RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw a filled circle within an image (Vector version) 1293 RLAPI void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image 1294 RLAPI void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color); // Draw circle outline within an image (Vector version) 1295 RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image 1296 RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) 1297 RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image 1298 RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image 1299 RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) 1300 RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) 1301 RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) 1302 1303 // Texture loading functions 1304 // NOTE: These functions require GPU access 1305 RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) 1306 RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data 1307 RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported 1308 RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) 1309 RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) 1310 RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) 1311 RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data 1312 RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data 1313 1314 // Texture configuration functions 1315 RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture 1316 RLAPI void SetTextureFilter(Texture2D texture, int filter); // Set texture scaling filter mode 1317 RLAPI void SetTextureWrap(Texture2D texture, int wrap); // Set texture wrapping mode 1318 1319 // Texture drawing functions 1320 RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D 1321 RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 1322 RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters 1323 RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle 1324 RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters 1325 RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely 1326 1327 // Color/pixel related functions 1328 RLAPI Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f 1329 RLAPI int ColorToInt(Color color); // Get hexadecimal value for a Color 1330 RLAPI Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1] 1331 RLAPI Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1] 1332 RLAPI Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1] 1333 RLAPI Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1] 1334 RLAPI Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f 1335 RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint 1336 RLAPI Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value 1337 RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format 1338 RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer 1339 RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format 1340 1341 //------------------------------------------------------------------------------------ 1342 // Font Loading and Text Drawing Functions (Module: text) 1343 //------------------------------------------------------------------------------------ 1344 1345 // Font loading/unloading functions 1346 RLAPI Font GetFontDefault(void); // Get the default Font 1347 RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) 1348 RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set 1349 RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) 1350 RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' 1351 RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type); // Load font data for further use 1352 RLAPI Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info 1353 RLAPI void UnloadFontData(GlyphInfo *chars, int glyphCount); // Unload font chars info data (RAM) 1354 RLAPI void UnloadFont(Font font); // Unload font from GPU memory (VRAM) 1355 RLAPI bool ExportFontAsCode(Font font, const char *fileName); // Export font as code file, returns true on success 1356 1357 // Text drawing functions 1358 RLAPI void DrawFPS(int posX, int posY); // Draw current FPS 1359 RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) 1360 RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters 1361 RLAPI void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation) 1362 RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) 1363 RLAPI void DrawTextCodepoints(Font font, const int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint) 1364 1365 // Text font info functions 1366 RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font 1367 RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font 1368 RLAPI int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found 1369 RLAPI GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found 1370 RLAPI Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found 1371 1372 // Text codepoints management functions (unicode characters) 1373 RLAPI char *LoadUTF8(const int *codepoints, int length); // Load UTF-8 text encoded from codepoints array 1374 RLAPI void UnloadUTF8(char *text); // Unload UTF-8 text encoded from codepoints array 1375 RLAPI int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter 1376 RLAPI void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory 1377 RLAPI int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string 1378 RLAPI int GetCodepoint(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure 1379 RLAPI int GetCodepointNext(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure 1380 RLAPI int GetCodepointPrevious(const char *text, int *codepointSize); // Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure 1381 RLAPI const char *CodepointToUTF8(int codepoint, int *utf8Size); // Encode one codepoint into UTF-8 byte array (array length returned as parameter) 1382 1383 // Text strings management functions (no UTF-8 strings, only byte chars) 1384 // NOTE: Some strings allocate memory internally for returned strings, just be careful! 1385 RLAPI int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied 1386 RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal 1387 RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending 1388 RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style) 1389 RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string 1390 RLAPI char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) 1391 RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) 1392 RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter 1393 RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings 1394 RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! 1395 RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string 1396 RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string 1397 RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string 1398 RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string 1399 RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) 1400 1401 //------------------------------------------------------------------------------------ 1402 // Basic 3d Shapes Drawing Functions (Module: models) 1403 //------------------------------------------------------------------------------------ 1404 1405 // Basic geometric 3D shapes drawing functions 1406 RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space 1407 RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line 1408 RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space 1409 RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) 1410 RLAPI void DrawTriangleStrip3D(Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points 1411 RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube 1412 RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) 1413 RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires 1414 RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) 1415 RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere 1416 RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters 1417 RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires 1418 RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone 1419 RLAPI void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos 1420 RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires 1421 RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder wires with base at startPos and top at endPos 1422 RLAPI void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw a capsule with the center of its sphere caps at startPos and endPos 1423 RLAPI void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw capsule wireframe with the center of its sphere caps at startPos and endPos 1424 RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ 1425 RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line 1426 RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) 1427 1428 //------------------------------------------------------------------------------------ 1429 // Model 3d Loading and Drawing Functions (Module: models) 1430 //------------------------------------------------------------------------------------ 1431 1432 // Model management functions 1433 RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) 1434 RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) 1435 RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) 1436 RLAPI void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) 1437 RLAPI BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes) 1438 1439 // Model drawing functions 1440 RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) 1441 RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters 1442 RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) 1443 RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters 1444 RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) 1445 RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture 1446 RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source 1447 RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation 1448 1449 // Mesh management functions 1450 RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids 1451 RLAPI void UpdateMeshBuffer(Mesh mesh, int index, const void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index 1452 RLAPI void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU 1453 RLAPI void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform 1454 RLAPI void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms 1455 RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success 1456 RLAPI BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits 1457 RLAPI void GenMeshTangents(Mesh *mesh); // Compute mesh tangents 1458 1459 // Mesh generation functions 1460 RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh 1461 RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) 1462 RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh 1463 RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) 1464 RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) 1465 RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh 1466 RLAPI Mesh GenMeshCone(float radius, float height, int slices); // Generate cone/pyramid mesh 1467 RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh 1468 RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh 1469 RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data 1470 RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data 1471 1472 // Material loading/unloading functions 1473 RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file 1474 RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) 1475 RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) 1476 RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) 1477 RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh 1478 1479 // Model animations loading/unloading functions 1480 RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, unsigned int *animCount); // Load model animations from file 1481 RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose 1482 RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data 1483 RLAPI void UnloadModelAnimations(ModelAnimation *animations, unsigned int count); // Unload animation array data 1484 RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match 1485 1486 // Collision detection functions 1487 RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres 1488 RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes 1489 RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere 1490 RLAPI RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere 1491 RLAPI RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box 1492 RLAPI RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh 1493 RLAPI RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle 1494 RLAPI RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad 1495 1496 //------------------------------------------------------------------------------------ 1497 // Audio Loading and Playing Functions (Module: audio) 1498 //------------------------------------------------------------------------------------ 1499 typedef void (*AudioCallback)(void *bufferData, unsigned int frames); 1500 1501 // Audio device management functions 1502 RLAPI void InitAudioDevice(void); // Initialize audio device and context 1503 RLAPI void CloseAudioDevice(void); // Close the audio device and context 1504 RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully 1505 RLAPI void SetMasterVolume(float volume); // Set master volume (listener) 1506 1507 // Wave/Sound loading/unloading functions 1508 RLAPI Wave LoadWave(const char *fileName); // Load wave data from file 1509 RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' 1510 RLAPI Sound LoadSound(const char *fileName); // Load sound from file 1511 RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data 1512 RLAPI void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data 1513 RLAPI void UnloadWave(Wave wave); // Unload wave data 1514 RLAPI void UnloadSound(Sound sound); // Unload sound 1515 RLAPI bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success 1516 RLAPI bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success 1517 1518 // Wave/Sound management functions 1519 RLAPI void PlaySound(Sound sound); // Play a sound 1520 RLAPI void StopSound(Sound sound); // Stop playing a sound 1521 RLAPI void PauseSound(Sound sound); // Pause a sound 1522 RLAPI void ResumeSound(Sound sound); // Resume a paused sound 1523 RLAPI void PlaySoundMulti(Sound sound); // Play a sound (using multichannel buffer pool) 1524 RLAPI void StopSoundMulti(void); // Stop any sound playing (using multichannel buffer pool) 1525 RLAPI int GetSoundsPlaying(void); // Get number of sounds playing in the multichannel 1526 RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing 1527 RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) 1528 RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) 1529 RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center) 1530 RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave 1531 RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range 1532 RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format 1533 RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array 1534 RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() 1535 1536 // Music management functions 1537 RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file 1538 RLAPI Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data 1539 RLAPI void UnloadMusicStream(Music music); // Unload music stream 1540 RLAPI void PlayMusicStream(Music music); // Start music playing 1541 RLAPI bool IsMusicStreamPlaying(Music music); // Check if music is playing 1542 RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming 1543 RLAPI void StopMusicStream(Music music); // Stop music playing 1544 RLAPI void PauseMusicStream(Music music); // Pause music playing 1545 RLAPI void ResumeMusicStream(Music music); // Resume playing paused music 1546 RLAPI void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds) 1547 RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) 1548 RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) 1549 RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (0.5 is center) 1550 RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds) 1551 RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) 1552 1553 // AudioStream management functions 1554 RLAPI AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data) 1555 RLAPI void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory 1556 RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data 1557 RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill 1558 RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream 1559 RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream 1560 RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream 1561 RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing 1562 RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream 1563 RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) 1564 RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) 1565 RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 is centered) 1566 RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams 1567 RLAPI void SetAudioStreamCallback(AudioStream stream, AudioCallback callback); // Audio thread callback to request new data 1568 1569 RLAPI void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Attach audio stream processor to stream 1570 RLAPI void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Detach audio stream processor from stream 1571 1572 #if defined(__cplusplus) 1573 } 1574 #endif 1575 1576 #endif // RAYLIB_H