1 module raylib; 2 3 public { 4 import rlgl; 5 } 6 /********************************************************************************************** 7 * 8 * raylib - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) 9 * 10 * FEATURES: 11 * - NO external dependencies, all required libraries included with raylib 12 * - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, MacOS, UWP, Android, Raspberry Pi, HTML5. 13 * - Written in plain C code (C99) in PascalCase/camelCase notation 14 * - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2 - choose at compile) 15 * - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] 16 * - Powerful fonts module (XNA SpriteFonts, BMFonts, TTF) 17 * - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC) 18 * - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more! 19 * - Flexible Materials system, supporting classic maps and PBR maps 20 * - Skeletal Animation support (CPU bones-based animation) 21 * - Shaders support, including Model shaders and Postprocessing shaders 22 * - Powerful math module for Vector, Matrix and Quaternion operations: [raymath] 23 * - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD) 24 * - VR stereo rendering with configurable HMD device parameters 25 * - Bindings to multiple programming languages available! 26 * 27 * NOTES: 28 * One custom font is loaded by default when InitWindow() [core] 29 * If using OpenGL 3.3 or ES2, one default shader is loaded automatically (internally defined) [rlgl] 30 * If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads 31 * 32 * DEPENDENCIES (included): 33 * [core] rglfw (github.com/glfw/glfw) for window/context management and input (only PLATFORM_DESKTOP) 34 * [rlgl] glad (github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading (only PLATFORM_DESKTOP) 35 * [raudio] miniaudio (github.com/dr-soft/miniaudio) for audio device/context management 36 * 37 * OPTIONAL DEPENDENCIES (included): 38 * [core] rgif (Charlie Tangora, Ramon Santamaria) for GIF recording 39 * [textures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...) 40 * [textures] stb_image_write (Sean Barret) for image writting (BMP, TGA, PNG, JPG) 41 * [textures] stb_image_resize (Sean Barret) for image resizing algorythms 42 * [textures] stb_perlin (Sean Barret) for Perlin noise image generation 43 * [text] stb_truetype (Sean Barret) for ttf fonts loading 44 * [text] stb_rect_pack (Sean Barret) for rectangles packing 45 * [models] par_shapes (Philip Rideout) for parametric 3d shapes generation 46 * [models] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL) 47 * [models] cgltf (Johannes Kuhlmann) for models loading (glTF) 48 * [raudio] stb_vorbis (Sean Barret) for OGG audio loading 49 * [raudio] dr_flac (David Reid) for FLAC audio file loading 50 * [raudio] dr_mp3 (David Reid) for MP3 audio file 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-2019 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 import core.stdc.config; 80 import core.stdc.stdarg; 81 import core.stdc.stdlib; 82 83 extern (C) @nogc nothrow: 84 85 // Required for: va_list - Only used by TraceLogCallback 86 87 // We are building raylib as a Win32 shared library (.dll) 88 // We are using raylib as a Win32 shared library (.dll) // We are building or using raylib as a static library (or Linux shared library) 89 90 //---------------------------------------------------------------------------------- 91 // Some basic Defines 92 //---------------------------------------------------------------------------------- 93 94 enum PI = 3.14159265358979323846f; 95 96 enum DEG2RAD = PI / 180.0f; 97 enum RAD2DEG = 180.0f / PI; 98 99 enum MAX_TOUCH_POINTS = 10; // Maximum number of touch points supported 100 101 // Shader and material limits 102 enum MAX_SHADER_LOCATIONS = 32; // Maximum number of predefined locations stored in shader struct 103 enum MAX_MATERIAL_MAPS = 12; // Maximum number of texture maps stored in shader struct 104 105 // Allow custom memory allocators 106 107 alias RL_MALLOC = malloc; 108 109 alias RL_CALLOC = calloc; 110 111 alias RL_FREE = free; 112 113 // NOTE: MSC C++ compiler does not support compound literals (C99 feature) 114 // Plain structures in C++ (without constructors) can be initialized from { } initializers. 115 116 alias CLITERAL = Color; 117 118 // Some Basic Colors 119 // NOTE: Custom raylib color palette for amazing visuals on WHITE background // Light Gray // Gray // Dark Gray // Yellow // Gold // Orange // Pink // Red // Maroon // Green // Lime // Dark Green // Sky Blue // Blue // Dark Blue // Purple // Violet // Dark Purple // Beige // Brown // Dark Brown // White // Black // Blank (Transparent) // Magenta // My own White (raylib logo) 120 const LIGHTGRAY = Color( 200, 200, 200, 255 ); // Light Gray 121 const GRAY = Color( 130, 130, 130, 255 ); // Gray 122 const DARKGRAY = Color( 80, 80, 80, 255 ); // Dark Gray 123 const YELLOW = Color( 253, 249, 0, 255 ); // Yellow 124 const GOLD = Color( 255, 203, 0, 255 ); // Gold 125 const ORANGE = Color( 255, 161, 0, 255 ); // Orange 126 const PINK = Color( 255, 109, 194, 255 ); // Pink 127 const RED = Color( 230, 41, 55, 255 ); // Red 128 const MAROON = Color( 190, 33, 55, 255 ); // Maroon 129 const GREEN = Color( 0, 228, 48, 255 ); // Green 130 const LIME = Color( 0, 158, 47, 255 ); // Lime 131 const DARKGREEN = Color( 0, 117, 44, 255 ); // Dark Green 132 const SKYBLUE = Color( 102, 191, 255, 255 ); // Sky Blue 133 const BLUE = Color( 0, 121, 241, 255 ); // Blue 134 const DARKBLUE = Color( 0, 82, 172, 255 ); // Dark Blue 135 const PURPLE = Color( 200, 122, 255, 255 ); // Purple 136 const VIOLET = Color( 135, 60, 190, 255 ); // Violet 137 const DARKPURPLE= Color( 112, 31, 126, 255 ); // Dark Purple 138 const BEIGE = Color( 211, 176, 131, 255 ); // Beige 139 const BROWN = Color( 127, 106, 79, 255 ); // Brown 140 const DARKBROWN = Color( 76, 63, 47, 255 ); // Dark Brown 141 142 const WHITE = Color( 255, 255, 255, 255 ); // White 143 const BLACK = Color( 0, 0, 0, 255 ); // Black 144 const BLANK = Color( 0, 0, 0, 0 ); // Transparent 145 const MAGENTA = Color( 255, 0, 255, 255 ); // Magenta 146 const RAYWHITE = Color( 245, 245, 245, 255 ); // Ray White 147 148 //---------------------------------------------------------------------------------- 149 // Structures Definition 150 //---------------------------------------------------------------------------------- 151 // Vector2 type 152 struct Vector2 153 { 154 float x; 155 float y; 156 } 157 158 // Vector3 type 159 struct Vector3 160 { 161 float x; 162 float y; 163 float z; 164 } 165 166 // Vector4 type 167 struct Vector4 168 { 169 float x; 170 float y; 171 float z; 172 float w; 173 } 174 175 // Quaternion type, same as Vector4 176 alias Quaternion = Vector4; 177 178 // Matrix type (OpenGL style 4x4 - right handed, column major) 179 struct Matrix 180 { 181 float m0; 182 float m4; 183 float m8; 184 float m12; 185 float m1; 186 float m5; 187 float m9; 188 float m13; 189 float m2; 190 float m6; 191 float m10; 192 float m14; 193 float m3; 194 float m7; 195 float m11; 196 float m15; 197 } 198 199 // Color type, RGBA (32bit) 200 struct Color 201 { 202 ubyte r; 203 ubyte g; 204 ubyte b; 205 ubyte a; 206 } 207 208 // Rectangle type 209 struct Rectangle 210 { 211 float x; 212 float y; 213 float width; 214 float height; 215 } 216 217 // Image type, bpp always RGBA (32bit) 218 // NOTE: Data stored in CPU memory (RAM) 219 struct Image 220 { 221 void* data; // Image raw data 222 int width; // Image base width 223 int height; // Image base height 224 int mipmaps; // Mipmap levels, 1 by default 225 int format; // Data format (PixelFormat type) 226 } 227 228 // Texture2D type 229 // NOTE: Data stored in GPU memory 230 struct Texture2D 231 { 232 uint id; // OpenGL texture id 233 int width; // Texture base width 234 int height; // Texture base height 235 int mipmaps; // Mipmap levels, 1 by default 236 int format; // Data format (PixelFormat type) 237 } 238 239 // Texture type, same as Texture2D 240 alias Texture = Texture2D; 241 242 // TextureCubemap type, actually, same as Texture2D 243 alias TextureCubemap = Texture2D; 244 245 // RenderTexture2D type, for texture rendering 246 struct RenderTexture2D 247 { 248 uint id; // OpenGL Framebuffer Object (FBO) id 249 Texture2D texture; // Color buffer attachment texture 250 Texture2D depth; // Depth buffer attachment texture 251 bool depthTexture; // Track if depth attachment is a texture or renderbuffer 252 } 253 254 // RenderTexture type, same as RenderTexture2D 255 alias RenderTexture = RenderTexture2D; 256 257 // N-Patch layout info 258 struct NPatchInfo 259 { 260 Rectangle sourceRec; // Region in the texture 261 int left; // left border offset 262 int top; // top border offset 263 int right; // right border offset 264 int bottom; // bottom border offset 265 int type; // layout of the n-patch: 3x3, 1x3 or 3x1 266 } 267 268 // Font character info 269 struct CharInfo 270 { 271 int value; // Character value (Unicode) 272 Rectangle rec; // Character rectangle in sprite font 273 int offsetX; // Character offset X when drawing 274 int offsetY; // Character offset Y when drawing 275 int advanceX; // Character advance position X 276 ubyte* data; // Character pixel data (grayscale) 277 } 278 279 // Font type, includes texture and charSet array data 280 struct Font 281 { 282 Texture2D texture; // Font texture 283 int baseSize; // Base size (default chars height) 284 int charsCount; // Number of characters 285 CharInfo* chars; // Characters info data 286 } 287 288 alias SpriteFont = Font; // SpriteFont type fallback, defaults to Font 289 290 // Camera type, defines a camera position/orientation in 3d space 291 struct Camera3D 292 { 293 Vector3 position; // Camera position 294 Vector3 target; // Camera target it looks-at 295 Vector3 up; // Camera up vector (rotation over its axis) 296 float fovy; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic 297 int type; // Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC 298 } 299 300 alias Camera = Camera3D; // Camera type fallback, defaults to Camera3D 301 302 // Camera2D type, defines a 2d camera 303 struct Camera2D 304 { 305 Vector2 offset; // Camera offset (displacement from target) 306 Vector2 target; // Camera target (rotation and zoom origin) 307 float rotation; // Camera rotation in degrees 308 float zoom; // Camera zoom (scaling), should be 1.0f by default 309 } 310 311 // Vertex data definning a mesh 312 // NOTE: Data stored in CPU memory (and GPU) 313 struct Mesh 314 { 315 int vertexCount; // Number of vertices stored in arrays 316 int triangleCount; // Number of triangles stored (indexed or not) 317 318 // Default vertex data 319 float* vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) 320 float* texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) 321 float* texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) 322 float* normals; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) 323 float* tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) 324 ubyte* colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) 325 ushort* indices; // Vertex indices (in case vertex data comes indexed) 326 327 // Animation vertex data 328 float* animVertices; // Animated vertex positions (after bones transformations) 329 float* animNormals; // Animated normals (after bones transformations) 330 int* boneIds; // Vertex bone ids, up to 4 bones influence by vertex (skinning) 331 float* boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning) 332 333 // OpenGL identifiers 334 uint vaoId; // OpenGL Vertex Array Object id 335 uint[7] vboId; // OpenGL Vertex Buffer Objects id (default vertex data) 336 } 337 338 // Shader type (generic) 339 struct Shader 340 { 341 uint id; // Shader program id 342 int[MAX_SHADER_LOCATIONS] locs; // Shader locations array 343 } 344 345 // Material texture map 346 struct MaterialMap 347 { 348 Texture2D texture; // Material map texture 349 Color color; // Material map color 350 float value; // Material map value 351 } 352 353 // Material type (generic) 354 struct Material 355 { 356 Shader shader; // Material shader 357 MaterialMap[MAX_MATERIAL_MAPS] maps; // Material maps 358 float* params; // Material generic parameters (if required) 359 } 360 361 // Transformation properties 362 struct Transform 363 { 364 Vector3 translation; // Translation 365 Quaternion rotation; // Rotation 366 Vector3 scale; // Scale 367 } 368 369 // Bone information 370 struct BoneInfo 371 { 372 char[32] name; // Bone name 373 int parent; // Bone parent 374 } 375 376 // Model type 377 struct Model 378 { 379 Matrix transform; // Local transform matrix 380 381 int meshCount; // Number of meshes 382 Mesh* meshes; // Meshes array 383 384 int materialCount; // Number of materials 385 Material* materials; // Materials array 386 int* meshMaterial; // Mesh material number 387 388 // Animation data 389 int boneCount; // Number of bones 390 BoneInfo* bones; // Bones information (skeleton) 391 Transform* bindPose; // Bones base transformation (pose) 392 } 393 394 // Model animation 395 struct ModelAnimation 396 { 397 int boneCount; // Number of bones 398 BoneInfo* bones; // Bones information (skeleton) 399 400 int frameCount; // Number of animation frames 401 Transform** framePoses; // Poses array by frame 402 } 403 404 // Ray type (useful for raycast) 405 struct Ray 406 { 407 Vector3 position; // Ray position (origin) 408 Vector3 direction; // Ray direction 409 } 410 411 // Raycast hit information 412 struct RayHitInfo 413 { 414 bool hit; // Did the ray hit something? 415 float distance; // Distance to nearest hit 416 Vector3 position; // Position of nearest hit 417 Vector3 normal; // Surface normal of hit 418 } 419 420 // Bounding box type 421 struct BoundingBox 422 { 423 Vector3 min; // Minimum vertex box-corner 424 Vector3 max; // Maximum vertex box-corner 425 } 426 427 // Wave type, defines audio wave data 428 struct Wave 429 { 430 uint sampleCount; // Number of samples 431 uint sampleRate; // Frequency (samples per second) 432 uint sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) 433 uint channels; // Number of channels (1-mono, 2-stereo) 434 void* data; // Buffer data pointer 435 } 436 437 // Sound source type 438 struct Sound 439 { 440 void* audioBuffer; // Pointer to internal data used by the audio system 441 442 uint source; // Audio source id 443 uint buffer; // Audio buffer id 444 int format; // Audio format specifier 445 } 446 447 // Music type (file streaming from memory) 448 // NOTE: Anything longer than ~10 seconds should be streamed 449 struct MusicData; 450 alias Music = MusicData*; 451 452 // Audio stream type 453 // NOTE: Useful to create custom audio streams not bound to a specific file 454 struct AudioStream 455 { 456 uint sampleRate; // Frequency (samples per second) 457 uint sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) 458 uint channels; // Number of channels (1-mono, 2-stereo) 459 460 void* audioBuffer; // Pointer to internal data used by the audio system. 461 462 int format; // Audio format specifier 463 uint source; // Audio source id 464 uint[2] buffers; // Audio buffers (double buffering) 465 } 466 467 // Head-Mounted-Display device parameters 468 struct VrDeviceInfo 469 { 470 int hResolution; // HMD horizontal resolution in pixels 471 int vResolution; // HMD vertical resolution in pixels 472 float hScreenSize; // HMD horizontal size in meters 473 float vScreenSize; // HMD vertical size in meters 474 float vScreenCenter; // HMD screen center in meters 475 float eyeToScreenDistance; // HMD distance between eye and display in meters 476 float lensSeparationDistance; // HMD lens separation distance in meters 477 float interpupillaryDistance; // HMD IPD (distance between pupils) in meters 478 float[4] lensDistortionValues; // HMD lens distortion constant parameters 479 float[4] chromaAbCorrection; // HMD chromatic aberration correction parameters 480 } 481 482 //---------------------------------------------------------------------------------- 483 // Enumerators Definition 484 //---------------------------------------------------------------------------------- 485 // System config flags 486 // NOTE: Used for bit masks 487 enum ConfigFlag 488 { 489 FLAG_SHOW_LOGO = 1, // Set to show raylib logo at startup 490 FLAG_FULLSCREEN_MODE = 2, // Set to run program in fullscreen 491 FLAG_WINDOW_RESIZABLE = 4, // Set to allow resizable window 492 FLAG_WINDOW_UNDECORATED = 8, // Set to disable window decoration (frame and buttons) 493 FLAG_WINDOW_TRANSPARENT = 16, // Set to allow transparent window 494 FLAG_WINDOW_HIDDEN = 128, // Set to create the window initially hidden 495 FLAG_MSAA_4X_HINT = 32, // Set to try enabling MSAA 4X 496 FLAG_VSYNC_HINT = 64 // Set to try enabling V-Sync on GPU 497 } 498 499 // Trace log type 500 enum TraceLogType 501 { 502 LOG_ALL = 0, // Display all logs 503 LOG_TRACE = 1, 504 LOG_DEBUG = 2, 505 LOG_INFO = 3, 506 LOG_WARNING = 4, 507 LOG_ERROR = 5, 508 LOG_FATAL = 6, 509 LOG_NONE = 7 // Disable logging 510 } 511 512 // Keyboard keys 513 enum KeyboardKey 514 { 515 // Alphanumeric keys 516 KEY_APOSTROPHE = 39, 517 KEY_COMMA = 44, 518 KEY_MINUS = 45, 519 KEY_PERIOD = 46, 520 KEY_SLASH = 47, 521 KEY_ZERO = 48, 522 KEY_ONE = 49, 523 KEY_TWO = 50, 524 KEY_THREE = 51, 525 KEY_FOUR = 52, 526 KEY_FIVE = 53, 527 KEY_SIX = 54, 528 KEY_SEVEN = 55, 529 KEY_EIGHT = 56, 530 KEY_NINE = 57, 531 KEY_SEMICOLON = 59, 532 KEY_EQUAL = 61, 533 KEY_A = 65, 534 KEY_B = 66, 535 KEY_C = 67, 536 KEY_D = 68, 537 KEY_E = 69, 538 KEY_F = 70, 539 KEY_G = 71, 540 KEY_H = 72, 541 KEY_I = 73, 542 KEY_J = 74, 543 KEY_K = 75, 544 KEY_L = 76, 545 KEY_M = 77, 546 KEY_N = 78, 547 KEY_O = 79, 548 KEY_P = 80, 549 KEY_Q = 81, 550 KEY_R = 82, 551 KEY_S = 83, 552 KEY_T = 84, 553 KEY_U = 85, 554 KEY_V = 86, 555 KEY_W = 87, 556 KEY_X = 88, 557 KEY_Y = 89, 558 KEY_Z = 90, 559 560 // Function keys 561 KEY_SPACE = 32, 562 KEY_ESCAPE = 256, 563 KEY_ENTER = 257, 564 KEY_TAB = 258, 565 KEY_BACKSPACE = 259, 566 KEY_INSERT = 260, 567 KEY_DELETE = 261, 568 KEY_RIGHT = 262, 569 KEY_LEFT = 263, 570 KEY_DOWN = 264, 571 KEY_UP = 265, 572 KEY_PAGE_UP = 266, 573 KEY_PAGE_DOWN = 267, 574 KEY_HOME = 268, 575 KEY_END = 269, 576 KEY_CAPS_LOCK = 280, 577 KEY_SCROLL_LOCK = 281, 578 KEY_NUM_LOCK = 282, 579 KEY_PRINT_SCREEN = 283, 580 KEY_PAUSE = 284, 581 KEY_F1 = 290, 582 KEY_F2 = 291, 583 KEY_F3 = 292, 584 KEY_F4 = 293, 585 KEY_F5 = 294, 586 KEY_F6 = 295, 587 KEY_F7 = 296, 588 KEY_F8 = 297, 589 KEY_F9 = 298, 590 KEY_F10 = 299, 591 KEY_F11 = 300, 592 KEY_F12 = 301, 593 KEY_LEFT_SHIFT = 340, 594 KEY_LEFT_CONTROL = 341, 595 KEY_LEFT_ALT = 342, 596 KEY_LEFT_SUPER = 343, 597 KEY_RIGHT_SHIFT = 344, 598 KEY_RIGHT_CONTROL = 345, 599 KEY_RIGHT_ALT = 346, 600 KEY_RIGHT_SUPER = 347, 601 KEY_KB_MENU = 348, 602 KEY_LEFT_BRACKET = 91, 603 KEY_BACKSLASH = 92, 604 KEY_RIGHT_BRACKET = 93, 605 KEY_GRAVE = 96, 606 607 // Keypad keys 608 KEY_KP_0 = 320, 609 KEY_KP_1 = 321, 610 KEY_KP_2 = 322, 611 KEY_KP_3 = 323, 612 KEY_KP_4 = 324, 613 KEY_KP_5 = 325, 614 KEY_KP_6 = 326, 615 KEY_KP_7 = 327, 616 KEY_KP_8 = 328, 617 KEY_KP_9 = 329, 618 KEY_KP_DECIMAL = 330, 619 KEY_KP_DIVIDE = 331, 620 KEY_KP_MULTIPLY = 332, 621 KEY_KP_SUBTRACT = 333, 622 KEY_KP_ADD = 334, 623 KEY_KP_ENTER = 335, 624 KEY_KP_EQUAL = 336 625 } 626 627 // Android buttons 628 enum AndroidButton 629 { 630 KEY_BACK = 4, 631 KEY_MENU = 82, 632 KEY_VOLUME_UP = 24, 633 KEY_VOLUME_DOWN = 25 634 } 635 636 // Mouse buttons 637 enum MouseButton 638 { 639 MOUSE_LEFT_BUTTON = 0, 640 MOUSE_RIGHT_BUTTON = 1, 641 MOUSE_MIDDLE_BUTTON = 2 642 } 643 644 // Gamepad number 645 enum GamepadNumber 646 { 647 GAMEPAD_PLAYER1 = 0, 648 GAMEPAD_PLAYER2 = 1, 649 GAMEPAD_PLAYER3 = 2, 650 GAMEPAD_PLAYER4 = 3 651 } 652 653 // Gamepad Buttons 654 enum GamepadButton 655 { 656 // This is here just for error checking 657 GAMEPAD_BUTTON_UNKNOWN = 0, 658 659 // This is normally [A,B,X,Y]/[Circle,Triangle,Square,Cross] 660 // No support for 6 button controllers though.. 661 GAMEPAD_BUTTON_LEFT_FACE_UP = 1, 662 GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2, 663 GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3, 664 GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4, 665 666 // This is normally a DPAD 667 GAMEPAD_BUTTON_RIGHT_FACE_UP = 5, 668 GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6, 669 GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7, 670 GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8, 671 672 // Triggers 673 GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9, 674 GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10, 675 GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11, 676 GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12, 677 678 // These are buttons in the center of the gamepad 679 GAMEPAD_BUTTON_MIDDLE_LEFT = 13, //PS3 Select 680 GAMEPAD_BUTTON_MIDDLE = 14, //PS Button/XBOX Button 681 GAMEPAD_BUTTON_MIDDLE_RIGHT = 15, //PS3 Start 682 683 // These are the joystick press in buttons 684 GAMEPAD_BUTTON_LEFT_THUMB = 16, 685 GAMEPAD_BUTTON_RIGHT_THUMB = 17 686 } 687 688 enum GamepadAxis 689 { 690 // This is here just for error checking 691 GAMEPAD_AXIS_UNKNOWN = 0, 692 693 // Left stick 694 GAMEPAD_AXIS_LEFT_X = 1, 695 GAMEPAD_AXIS_LEFT_Y = 2, 696 697 // Right stick 698 GAMEPAD_AXIS_RIGHT_X = 3, 699 GAMEPAD_AXIS_RIGHT_Y = 4, 700 701 // Pressure levels for the back triggers 702 GAMEPAD_AXIS_LEFT_TRIGGER = 5, // [1..-1] (pressure-level) 703 GAMEPAD_AXIS_RIGHT_TRIGGER = 6 // [1..-1] (pressure-level) 704 } 705 706 // Shader location point type 707 enum ShaderLocationIndex 708 { 709 LOC_VERTEX_POSITION = 0, 710 LOC_VERTEX_TEXCOORD01 = 1, 711 LOC_VERTEX_TEXCOORD02 = 2, 712 LOC_VERTEX_NORMAL = 3, 713 LOC_VERTEX_TANGENT = 4, 714 LOC_VERTEX_COLOR = 5, 715 LOC_MATRIX_MVP = 6, 716 LOC_MATRIX_MODEL = 7, 717 LOC_MATRIX_VIEW = 8, 718 LOC_MATRIX_PROJECTION = 9, 719 LOC_VECTOR_VIEW = 10, 720 LOC_COLOR_DIFFUSE = 11, 721 LOC_COLOR_SPECULAR = 12, 722 LOC_COLOR_AMBIENT = 13, 723 LOC_MAP_ALBEDO = 14, // LOC_MAP_DIFFUSE 724 LOC_MAP_METALNESS = 15, // LOC_MAP_SPECULAR 725 LOC_MAP_NORMAL = 16, 726 LOC_MAP_ROUGHNESS = 17, 727 LOC_MAP_OCCLUSION = 18, 728 LOC_MAP_EMISSION = 19, 729 LOC_MAP_HEIGHT = 20, 730 LOC_MAP_CUBEMAP = 21, 731 LOC_MAP_IRRADIANCE = 22, 732 LOC_MAP_PREFILTER = 23, 733 LOC_MAP_BRDF = 24 734 } 735 736 enum LOC_MAP_DIFFUSE = ShaderLocationIndex.LOC_MAP_ALBEDO; 737 enum LOC_MAP_SPECULAR = ShaderLocationIndex.LOC_MAP_METALNESS; 738 739 // Shader uniform data types 740 enum ShaderUniformDataType 741 { 742 UNIFORM_FLOAT = 0, 743 UNIFORM_VEC2 = 1, 744 UNIFORM_VEC3 = 2, 745 UNIFORM_VEC4 = 3, 746 UNIFORM_INT = 4, 747 UNIFORM_IVEC2 = 5, 748 UNIFORM_IVEC3 = 6, 749 UNIFORM_IVEC4 = 7, 750 UNIFORM_SAMPLER2D = 8 751 } 752 753 // Material map type 754 enum MaterialMapType 755 { 756 MAP_ALBEDO = 0, // MAP_DIFFUSE 757 MAP_METALNESS = 1, // MAP_SPECULAR 758 MAP_NORMAL = 2, 759 MAP_ROUGHNESS = 3, 760 MAP_OCCLUSION = 4, 761 MAP_EMISSION = 5, 762 MAP_HEIGHT = 6, 763 MAP_CUBEMAP = 7, // NOTE: Uses GL_TEXTURE_CUBE_MAP 764 MAP_IRRADIANCE = 8, // NOTE: Uses GL_TEXTURE_CUBE_MAP 765 MAP_PREFILTER = 9, // NOTE: Uses GL_TEXTURE_CUBE_MAP 766 MAP_BRDF = 10 767 } 768 769 enum MAP_DIFFUSE = MaterialMapType.MAP_ALBEDO; 770 enum MAP_SPECULAR = MaterialMapType.MAP_METALNESS; 771 772 // Pixel formats 773 // NOTE: Support depends on OpenGL version and platform 774 enum PixelFormat 775 { 776 UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) 777 UNCOMPRESSED_GRAY_ALPHA = 2, // 8*2 bpp (2 channels) 778 UNCOMPRESSED_R5G6B5 = 3, // 16 bpp 779 UNCOMPRESSED_R8G8B8 = 4, // 24 bpp 780 UNCOMPRESSED_R5G5B5A1 = 5, // 16 bpp (1 bit alpha) 781 UNCOMPRESSED_R4G4B4A4 = 6, // 16 bpp (4 bit alpha) 782 UNCOMPRESSED_R8G8B8A8 = 7, // 32 bpp 783 UNCOMPRESSED_R32 = 8, // 32 bpp (1 channel - float) 784 UNCOMPRESSED_R32G32B32 = 9, // 32*3 bpp (3 channels - float) 785 UNCOMPRESSED_R32G32B32A32 = 10, // 32*4 bpp (4 channels - float) 786 COMPRESSED_DXT1_RGB = 11, // 4 bpp (no alpha) 787 COMPRESSED_DXT1_RGBA = 12, // 4 bpp (1 bit alpha) 788 COMPRESSED_DXT3_RGBA = 13, // 8 bpp 789 COMPRESSED_DXT5_RGBA = 14, // 8 bpp 790 COMPRESSED_ETC1_RGB = 15, // 4 bpp 791 COMPRESSED_ETC2_RGB = 16, // 4 bpp 792 COMPRESSED_ETC2_EAC_RGBA = 17, // 8 bpp 793 COMPRESSED_PVRT_RGB = 18, // 4 bpp 794 COMPRESSED_PVRT_RGBA = 19, // 4 bpp 795 COMPRESSED_ASTC_4x4_RGBA = 20, // 8 bpp 796 COMPRESSED_ASTC_8x8_RGBA = 21 // 2 bpp 797 } 798 799 // Texture parameters: filter mode 800 // NOTE 1: Filtering considers mipmaps if available in the texture 801 // NOTE 2: Filter is accordingly set for minification and magnification 802 enum TextureFilterMode 803 { 804 FILTER_POINT = 0, // No filter, just pixel aproximation 805 FILTER_BILINEAR = 1, // Linear filtering 806 FILTER_TRILINEAR = 2, // Trilinear filtering (linear with mipmaps) 807 FILTER_ANISOTROPIC_4X = 3, // Anisotropic filtering 4x 808 FILTER_ANISOTROPIC_8X = 4, // Anisotropic filtering 8x 809 FILTER_ANISOTROPIC_16X = 5 // Anisotropic filtering 16x 810 } 811 812 // Cubemap layout type 813 enum CubemapLayoutType 814 { 815 CUBEMAP_AUTO_DETECT = 0, // Automatically detect layout type 816 CUBEMAP_LINE_VERTICAL = 1, // Layout is defined by a vertical line with faces 817 CUBEMAP_LINE_HORIZONTAL = 2, // Layout is defined by an horizontal line with faces 818 CUBEMAP_CROSS_THREE_BY_FOUR = 3, // Layout is defined by a 3x4 cross with cubemap faces 819 CUBEMAP_CROSS_FOUR_BY_THREE = 4, // Layout is defined by a 4x3 cross with cubemap faces 820 CUBEMAP_PANORAMA = 5 // Layout is defined by a panorama image (equirectangular map) 821 } 822 823 // Texture parameters: wrap mode 824 enum TextureWrapMode 825 { 826 WRAP_REPEAT = 0, // Repeats texture in tiled mode 827 WRAP_CLAMP = 1, // Clamps texture to edge pixel in tiled mode 828 WRAP_MIRROR_REPEAT = 2, // Mirrors and repeats the texture in tiled mode 829 WRAP_MIRROR_CLAMP = 3 // Mirrors and clamps to border the texture in tiled mode 830 } 831 832 // Font type, defines generation method 833 enum FontType 834 { 835 FONT_DEFAULT = 0, // Default font generation, anti-aliased 836 FONT_BITMAP = 1, // Bitmap font generation, no anti-aliasing 837 FONT_SDF = 2 // SDF font generation, requires external shader 838 } 839 840 // Color blending modes (pre-defined) 841 enum BlendMode 842 { 843 BLEND_ALPHA = 0, // Blend textures considering alpha (default) 844 BLEND_ADDITIVE = 1, // Blend textures adding colors 845 BLEND_MULTIPLIED = 2 // Blend textures multiplying colors 846 } 847 848 // Gestures type 849 // NOTE: It could be used as flags to enable only some gestures 850 enum GestureType 851 { 852 GESTURE_NONE = 0, 853 GESTURE_TAP = 1, 854 GESTURE_DOUBLETAP = 2, 855 GESTURE_HOLD = 4, 856 GESTURE_DRAG = 8, 857 GESTURE_SWIPE_RIGHT = 16, 858 GESTURE_SWIPE_LEFT = 32, 859 GESTURE_SWIPE_UP = 64, 860 GESTURE_SWIPE_DOWN = 128, 861 GESTURE_PINCH_IN = 256, 862 GESTURE_PINCH_OUT = 512 863 } 864 865 // Camera system modes 866 enum CameraMode 867 { 868 CAMERA_CUSTOM = 0, 869 CAMERA_FREE = 1, 870 CAMERA_ORBITAL = 2, 871 CAMERA_FIRST_PERSON = 3, 872 CAMERA_THIRD_PERSON = 4 873 } 874 875 // Camera projection modes 876 enum CameraType 877 { 878 CAMERA_PERSPECTIVE = 0, 879 CAMERA_ORTHOGRAPHIC = 1 880 } 881 882 // Type of n-patch 883 enum NPatchType 884 { 885 NPT_9PATCH = 0, // Npatch defined by 3x3 tiles 886 NPT_3PATCH_VERTICAL = 1, // Npatch defined by 1x3 tiles 887 NPT_3PATCH_HORIZONTAL = 2 // Npatch defined by 3x1 tiles 888 } 889 890 // Callbacks to be implemented by users 891 alias TraceLogCallback = void function (int logType, const(char)* text, va_list args); 892 893 // Prevents name mangling of functions 894 895 //------------------------------------------------------------------------------------ 896 // Global Variables Definition 897 //------------------------------------------------------------------------------------ 898 // It's lonely here... 899 900 //------------------------------------------------------------------------------------ 901 // Window and Graphics Device Functions (Module: core) 902 //------------------------------------------------------------------------------------ 903 904 // Window-related functions 905 void InitWindow (int width, int height, const(char)* title); // Initialize window and OpenGL context 906 bool WindowShouldClose (); // Check if KEY_ESCAPE pressed or Close icon pressed 907 void CloseWindow (); // Close window and unload OpenGL context 908 bool IsWindowReady (); // Check if window has been initialized successfully 909 bool IsWindowMinimized (); // Check if window has been minimized (or lost focus) 910 bool IsWindowResized (); // Check if window has been resized 911 bool IsWindowHidden (); // Check if window is currently hidden 912 void ToggleFullscreen (); // Toggle fullscreen mode (only PLATFORM_DESKTOP) 913 void UnhideWindow (); // Show the window 914 void HideWindow (); // Hide the window 915 void SetWindowIcon (Image image); // Set icon for window (only PLATFORM_DESKTOP) 916 void SetWindowTitle (const(char)* title); // Set title for window (only PLATFORM_DESKTOP) 917 void SetWindowPosition (int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) 918 void SetWindowMonitor (int monitor); // Set monitor for the current window (fullscreen mode) 919 void SetWindowMinSize (int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) 920 void SetWindowSize (int width, int height); // Set window dimensions 921 void* GetWindowHandle (); // Get native window handle 922 int GetScreenWidth (); // Get current screen width 923 int GetScreenHeight (); // Get current screen height 924 int GetMonitorCount (); // Get number of connected monitors 925 int GetMonitorWidth (int monitor); // Get primary monitor width 926 int GetMonitorHeight (int monitor); // Get primary monitor height 927 int GetMonitorPhysicalWidth (int monitor); // Get primary monitor physical width in millimetres 928 int GetMonitorPhysicalHeight (int monitor); // Get primary monitor physical height in millimetres 929 const(char)* GetMonitorName (int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor 930 const(char)* GetClipboardText (); // Get clipboard text content 931 void SetClipboardText (const(char)* text); // Set clipboard text content 932 933 // Cursor-related functions 934 void ShowCursor (); // Shows cursor 935 void HideCursor (); // Hides cursor 936 bool IsCursorHidden (); // Check if cursor is not visible 937 void EnableCursor (); // Enables cursor (unlock cursor) 938 void DisableCursor (); // Disables cursor (lock cursor) 939 940 // Drawing-related functions 941 void ClearBackground (Color color); // Set background color (framebuffer clear color) 942 void BeginDrawing (); // Setup canvas (framebuffer) to start drawing 943 void EndDrawing (); // End canvas drawing and swap buffers (double buffering) 944 void BeginMode2D (Camera2D camera); // Initialize 2D mode with custom camera (2D) 945 void EndMode2D (); // Ends 2D mode with custom camera 946 void BeginMode3D (Camera3D camera); // Initializes 3D mode with custom camera (3D) 947 void EndMode3D (); // Ends 3D mode and returns to default 2D orthographic mode 948 void BeginTextureMode (RenderTexture2D target); // Initializes render texture for drawing 949 void EndTextureMode (); // Ends drawing to render texture 950 951 // Screen-space-related functions 952 Ray GetMouseRay (Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position 953 Vector2 GetWorldToScreen (Vector3 position, Camera camera); // Returns the screen space position for a 3d world space position 954 Matrix GetCameraMatrix (Camera camera); // Returns camera transform matrix (view matrix) 955 956 // Timing-related functions 957 void SetTargetFPS (int fps); // Set target FPS (maximum) 958 int GetFPS (); // Returns current FPS 959 float GetFrameTime (); // Returns time in seconds for last frame drawn 960 double GetTime (); // Returns elapsed time in seconds since InitWindow() 961 962 // Color-related functions 963 int ColorToInt (Color color); // Returns hexadecimal value for a Color 964 Vector4 ColorNormalize (Color color); // Returns color normalized as float [0..1] 965 Vector3 ColorToHSV (Color color); // Returns HSV values for a Color 966 Color ColorFromHSV (Vector3 hsv); // Returns a Color from HSV values 967 Color GetColor (int hexValue); // Returns a Color struct from hexadecimal value 968 Color Fade (Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f 969 970 // Misc. functions 971 void SetConfigFlags (ubyte flags); // Setup window configuration flags (view FLAGS) 972 void SetTraceLogLevel (int logType); // Set the current threshold (minimum) log level 973 void SetTraceLogExit (int logType); // Set the exit threshold (minimum) log level 974 void SetTraceLogCallback (TraceLogCallback callback); // Set a trace log callback to enable custom logging 975 void TraceLog (int logType, const(char)* text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) 976 void TakeScreenshot (const(char)* fileName); // Takes a screenshot of current screen (saved a .png) 977 int GetRandomValue (int min, int max); // Returns a random value between min and max (both included) 978 979 // Files management functions 980 bool FileExists (const(char)* fileName); // Check if file exists 981 bool IsFileExtension (const(char)* fileName, const(char)* ext); // Check file extension 982 const(char)* GetExtension (const(char)* fileName); // Get pointer to extension for a filename string 983 const(char)* GetFileName (const(char)* filePath); // Get pointer to filename for a path string 984 const(char)* GetFileNameWithoutExt (const(char)* filePath); // Get filename string without extension (memory should be freed) 985 const(char)* GetDirectoryPath (const(char)* fileName); // Get full path for a given fileName (uses static string) 986 const(char)* GetWorkingDirectory (); // Get current working directory (uses static string) 987 char** GetDirectoryFiles (const(char)* dirPath, int* count); // Get filenames in a directory path (memory should be freed) 988 void ClearDirectoryFiles (); // Clear directory files paths buffers (free memory) 989 bool ChangeDirectory (const(char)* dir); // Change working directory, returns true if success 990 bool IsFileDropped (); // Check if a file has been dropped into window 991 char** GetDroppedFiles (int* count); // Get dropped files names (memory should be freed) 992 void ClearDroppedFiles (); // Clear dropped files paths buffer (free memory) 993 c_long GetFileModTime (const(char)* fileName); // Get file modification time (last write time) 994 995 // Persistent storage management 996 void StorageSaveValue (int position, int value); // Save integer value to storage file (to defined position) 997 int StorageLoadValue (int position); // Load integer value from storage file (from defined position) 998 999 void OpenURL (const(char)* url); // Open URL with default system browser (if available) 1000 1001 //------------------------------------------------------------------------------------ 1002 // Input Handling Functions (Module: core) 1003 //------------------------------------------------------------------------------------ 1004 1005 // Input-related functions: keyboard 1006 bool IsKeyPressed (int key); // Detect if a key has been pressed once 1007 bool IsKeyDown (int key); // Detect if a key is being pressed 1008 bool IsKeyReleased (int key); // Detect if a key has been released once 1009 bool IsKeyUp (int key); // Detect if a key is NOT being pressed 1010 int GetKeyPressed (); // Get latest key pressed 1011 void SetExitKey (int key); // Set a custom key to exit program (default is ESC) 1012 1013 // Input-related functions: gamepads 1014 bool IsGamepadAvailable (int gamepad); // Detect if a gamepad is available 1015 bool IsGamepadName (int gamepad, const(char)* name); // Check gamepad name (if available) 1016 const(char)* GetGamepadName (int gamepad); // Return gamepad internal name id 1017 bool IsGamepadButtonPressed (int gamepad, int button); // Detect if a gamepad button has been pressed once 1018 bool IsGamepadButtonDown (int gamepad, int button); // Detect if a gamepad button is being pressed 1019 bool IsGamepadButtonReleased (int gamepad, int button); // Detect if a gamepad button has been released once 1020 bool IsGamepadButtonUp (int gamepad, int button); // Detect if a gamepad button is NOT being pressed 1021 int GetGamepadButtonPressed (); // Get the last gamepad button pressed 1022 int GetGamepadAxisCount (int gamepad); // Return gamepad axis count for a gamepad 1023 float GetGamepadAxisMovement (int gamepad, int axis); // Return axis movement value for a gamepad axis 1024 1025 // Input-related functions: mouse 1026 bool IsMouseButtonPressed (int button); // Detect if a mouse button has been pressed once 1027 bool IsMouseButtonDown (int button); // Detect if a mouse button is being pressed 1028 bool IsMouseButtonReleased (int button); // Detect if a mouse button has been released once 1029 bool IsMouseButtonUp (int button); // Detect if a mouse button is NOT being pressed 1030 int GetMouseX (); // Returns mouse position X 1031 int GetMouseY (); // Returns mouse position Y 1032 Vector2 GetMousePosition (); // Returns mouse position XY 1033 void SetMousePosition (int x, int y); // Set mouse position XY 1034 void SetMouseOffset (int offsetX, int offsetY); // Set mouse offset 1035 void SetMouseScale (float scaleX, float scaleY); // Set mouse scaling 1036 int GetMouseWheelMove (); // Returns mouse wheel movement Y 1037 1038 // Input-related functions: touch 1039 int GetTouchX (); // Returns touch position X for touch point 0 (relative to screen size) 1040 int GetTouchY (); // Returns touch position Y for touch point 0 (relative to screen size) 1041 Vector2 GetTouchPosition (int index); // Returns touch position XY for a touch point index (relative to screen size) 1042 1043 //------------------------------------------------------------------------------------ 1044 // Gestures and Touch Handling Functions (Module: gestures) 1045 //------------------------------------------------------------------------------------ 1046 void SetGesturesEnabled (uint gestureFlags); // Enable a set of gestures using flags 1047 bool IsGestureDetected (int gesture); // Check if a gesture have been detected 1048 int GetGestureDetected (); // Get latest detected gesture 1049 int GetTouchPointsCount (); // Get touch points count 1050 float GetGestureHoldDuration (); // Get gesture hold time in milliseconds 1051 Vector2 GetGestureDragVector (); // Get gesture drag vector 1052 float GetGestureDragAngle (); // Get gesture drag angle 1053 Vector2 GetGesturePinchVector (); // Get gesture pinch delta 1054 float GetGesturePinchAngle (); // Get gesture pinch angle 1055 1056 //------------------------------------------------------------------------------------ 1057 // Camera System Functions (Module: camera) 1058 //------------------------------------------------------------------------------------ 1059 void SetCameraMode (Camera camera, int mode); // Set camera mode (multiple camera modes available) 1060 void UpdateCamera (Camera* camera); // Update camera position for selected mode 1061 1062 void SetCameraPanControl (int panKey); // Set camera pan key to combine with mouse movement (free camera) 1063 void SetCameraAltControl (int altKey); // Set camera alt key to combine with mouse movement (free camera) 1064 void SetCameraSmoothZoomControl (int szKey); // Set camera smooth zoom key to combine with mouse (free camera) 1065 void SetCameraMoveControls (int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras) 1066 1067 //------------------------------------------------------------------------------------ 1068 // Basic Shapes Drawing Functions (Module: shapes) 1069 //------------------------------------------------------------------------------------ 1070 1071 // Basic shapes drawing functions 1072 void DrawPixel (int posX, int posY, Color color); // Draw a pixel 1073 void DrawPixelV (Vector2 position, Color color); // Draw a pixel (Vector version) 1074 void DrawLine (int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line 1075 void DrawLineV (Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) 1076 void DrawLineEx (Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness 1077 void DrawLineBezier (Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out 1078 void DrawLineStrip (Vector2* points, int numPoints, Color color); // Draw lines sequence 1079 void DrawCircle (int centerX, int centerY, float radius, Color color); // Draw a color-filled circle 1080 void DrawCircleSector (Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw a piece of a circle 1081 void DrawCircleSectorLines (Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw circle sector outline 1082 void DrawCircleGradient (int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle 1083 void DrawCircleV (Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) 1084 void DrawCircleLines (int centerX, int centerY, float radius, Color color); // Draw circle outline 1085 void DrawRing (Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring 1086 void DrawRingLines (Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring outline 1087 void DrawRectangle (int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle 1088 void DrawRectangleV (Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) 1089 void DrawRectangleRec (Rectangle rec, Color color); // Draw a color-filled rectangle 1090 void DrawRectanglePro (Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters 1091 void DrawRectangleGradientV (int posX, int posY, int width, int height, Color color1, Color color2); // Draw a vertical-gradient-filled rectangle 1092 void DrawRectangleGradientH (int posX, int posY, int width, int height, Color color1, Color color2); // Draw a horizontal-gradient-filled rectangle 1093 void DrawRectangleGradientEx (Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors 1094 void DrawRectangleLines (int posX, int posY, int width, int height, Color color); // Draw rectangle outline 1095 void DrawRectangleLinesEx (Rectangle rec, int lineThick, Color color); // Draw rectangle outline with extended parameters 1096 void DrawRectangleRounded (Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges 1097 void DrawRectangleRoundedLines (Rectangle rec, float roundness, int segments, int lineThick, Color color); // Draw rectangle with rounded edges outline 1098 void DrawTriangle (Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle 1099 void DrawTriangleLines (Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline 1100 void DrawTriangleFan (Vector2* points, int numPoints, Color color); // Draw a triangle fan defined by points 1101 void DrawPoly (Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) 1102 1103 void SetShapesTexture (Texture2D texture, Rectangle source); // Define default texture used to draw shapes 1104 1105 // Basic shapes collision detection functions 1106 bool CheckCollisionRecs (Rectangle rec1, Rectangle rec2); // Check collision between two rectangles 1107 bool CheckCollisionCircles (Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles 1108 bool CheckCollisionCircleRec (Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle 1109 Rectangle GetCollisionRec (Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision 1110 bool CheckCollisionPointRec (Vector2 point, Rectangle rec); // Check if point is inside rectangle 1111 bool CheckCollisionPointCircle (Vector2 point, Vector2 center, float radius); // Check if point is inside circle 1112 bool CheckCollisionPointTriangle (Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle 1113 1114 //------------------------------------------------------------------------------------ 1115 // Texture Loading and Drawing Functions (Module: textures) 1116 //------------------------------------------------------------------------------------ 1117 1118 // Image/Texture2D data loading/unloading/saving functions 1119 Image LoadImage (const(char)* fileName); // Load image from file into CPU memory (RAM) 1120 Image LoadImageEx (Color* pixels, int width, int height); // Load image from Color array data (RGBA - 32bit) 1121 Image LoadImagePro (void* data, int width, int height, int format); // Load image from raw data with parameters 1122 Image LoadImageRaw (const(char)* fileName, int width, int height, int format, int headerSize); // Load image from RAW file data 1123 void ExportImage (Image image, const(char)* fileName); // Export image data to file 1124 void ExportImageAsCode (Image image, const(char)* fileName); // Export image as code file defining an array of bytes 1125 Texture2D LoadTexture (const(char)* fileName); // Load texture from file into GPU memory (VRAM) 1126 Texture2D LoadTextureFromImage (Image image); // Load texture from image data 1127 TextureCubemap LoadTextureCubemap (Image image, int layoutType); // Load cubemap from image, multiple image cubemap layouts supported 1128 RenderTexture2D LoadRenderTexture (int width, int height); // Load texture for rendering (framebuffer) 1129 void UnloadImage (Image image); // Unload image from CPU memory (RAM) 1130 void UnloadTexture (Texture2D texture); // Unload texture from GPU memory (VRAM) 1131 void UnloadRenderTexture (RenderTexture2D target); // Unload render texture from GPU memory (VRAM) 1132 Color* GetImageData (Image image); // Get pixel data from image as a Color struct array 1133 Vector4* GetImageDataNormalized (Image image); // Get pixel data from image as Vector4 array (float normalized) 1134 int GetPixelDataSize (int width, int height, int format); // Get pixel data size in bytes (image or texture) 1135 Image GetTextureData (Texture2D texture); // Get pixel data from GPU texture and return an Image 1136 Image GetScreenData (); // Get pixel data from screen buffer and return an Image (screenshot) 1137 void UpdateTexture (Texture2D texture, const(void)* pixels); // Update GPU texture with new data 1138 1139 // Image manipulation functions 1140 Image ImageCopy (Image image); // Create an image duplicate (useful for transformations) 1141 void ImageToPOT (Image* image, Color fillColor); // Convert image to POT (power-of-two) 1142 void ImageFormat (Image* image, int newFormat); // Convert image data to desired format 1143 void ImageAlphaMask (Image* image, Image alphaMask); // Apply alpha mask to image 1144 void ImageAlphaClear (Image* image, Color color, float threshold); // Clear alpha channel to desired color 1145 void ImageAlphaCrop (Image* image, float threshold); // Crop image depending on alpha value 1146 void ImageAlphaPremultiply (Image* image); // Premultiply alpha channel 1147 void ImageCrop (Image* image, Rectangle crop); // Crop an image to a defined rectangle 1148 void ImageResize (Image* image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) 1149 void ImageResizeNN (Image* image, int newWidth, int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) 1150 void ImageResizeCanvas (Image* image, int newWidth, int newHeight, int offsetX, int offsetY, Color color); // Resize canvas and fill with color 1151 void ImageMipmaps (Image* image); // Generate all mipmap levels for a provided image 1152 void ImageDither (Image* image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) 1153 Color* ImageExtractPalette (Image image, int maxPaletteSize, int* extractCount); // Extract color palette from image to maximum size (memory should be freed) 1154 Image ImageText (const(char)* text, int fontSize, Color color); // Create an image from text (default font) 1155 Image ImageTextEx (Font font, const(char)* text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) 1156 void ImageDraw (Image* dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image 1157 void ImageDrawRectangle (Image* dst, Rectangle rec, Color color); // Draw rectangle within an image 1158 void ImageDrawRectangleLines (Image* dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image 1159 void ImageDrawText (Image* dst, Vector2 position, const(char)* text, int fontSize, Color color); // Draw text (default font) within an image (destination) 1160 void ImageDrawTextEx (Image* dst, Vector2 position, Font font, const(char)* text, float fontSize, float spacing, Color color); // Draw text (custom sprite font) within an image (destination) 1161 void ImageFlipVertical (Image* image); // Flip image vertically 1162 void ImageFlipHorizontal (Image* image); // Flip image horizontally 1163 void ImageRotateCW (Image* image); // Rotate image clockwise 90deg 1164 void ImageRotateCCW (Image* image); // Rotate image counter-clockwise 90deg 1165 void ImageColorTint (Image* image, Color color); // Modify image color: tint 1166 void ImageColorInvert (Image* image); // Modify image color: invert 1167 void ImageColorGrayscale (Image* image); // Modify image color: grayscale 1168 void ImageColorContrast (Image* image, float contrast); // Modify image color: contrast (-100 to 100) 1169 void ImageColorBrightness (Image* image, int brightness); // Modify image color: brightness (-255 to 255) 1170 void ImageColorReplace (Image* image, Color color, Color replace); // Modify image color: replace color 1171 1172 // Image generation functions 1173 Image GenImageColor (int width, int height, Color color); // Generate image: plain color 1174 Image GenImageGradientV (int width, int height, Color top, Color bottom); // Generate image: vertical gradient 1175 Image GenImageGradientH (int width, int height, Color left, Color right); // Generate image: horizontal gradient 1176 Image GenImageGradientRadial (int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient 1177 Image GenImageChecked (int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked 1178 Image GenImageWhiteNoise (int width, int height, float factor); // Generate image: white noise 1179 Image GenImagePerlinNoise (int width, int height, int offsetX, int offsetY, float scale); // Generate image: perlin noise 1180 Image GenImageCellular (int width, int height, int tileSize); // Generate image: cellular algorithm. Bigger tileSize means bigger cells 1181 1182 // Texture2D configuration functions 1183 void GenTextureMipmaps (Texture2D* texture); // Generate GPU mipmaps for a texture 1184 void SetTextureFilter (Texture2D texture, int filterMode); // Set texture scaling filter mode 1185 void SetTextureWrap (Texture2D texture, int wrapMode); // Set texture wrapping mode 1186 1187 // Texture2D drawing functions 1188 void DrawTexture (Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D 1189 void DrawTextureV (Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 1190 void DrawTextureEx (Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters 1191 void DrawTextureRec (Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle 1192 void DrawTextureQuad (Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters 1193 void DrawTexturePro (Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters 1194 void DrawTextureNPatch (Texture2D texture, NPatchInfo nPatchInfo, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely 1195 1196 //------------------------------------------------------------------------------------ 1197 // Font Loading and Text Drawing Functions (Module: text) 1198 //------------------------------------------------------------------------------------ 1199 1200 // Font loading/unloading functions 1201 Font GetFontDefault (); // Get the default Font 1202 Font LoadFont (const(char)* fileName); // Load font from file into GPU memory (VRAM) 1203 Font LoadFontEx (const(char)* fileName, int fontSize, int* fontChars, int charsCount); // Load font from file with extended parameters 1204 Font LoadFontFromImage (Image image, Color key, int firstChar); // Load font from Image (XNA style) 1205 CharInfo* LoadFontData (const(char)* fileName, int fontSize, int* fontChars, int charsCount, int type); // Load font data for further use 1206 Image GenImageFontAtlas (CharInfo* chars, int charsCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info 1207 void UnloadFont (Font font); // Unload Font from GPU memory (VRAM) 1208 1209 // Text drawing functions 1210 void DrawFPS (int posX, int posY); // Shows current FPS 1211 void DrawText (const(char)* text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) 1212 void DrawTextEx (Font font, const(char)* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters 1213 void DrawTextRec (Font font, const(char)* text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // Draw text using font inside rectangle limits 1214 void DrawTextRecEx ( 1215 Font font, 1216 const(char)* text, 1217 Rectangle rec, 1218 float fontSize, 1219 float spacing, 1220 bool wordWrap, 1221 Color tint, 1222 int selectStart, 1223 int selectLength, 1224 Color selectText, 1225 Color selectBack); // Draw text using font inside rectangle limits with support for text selection 1226 1227 // Text misc. functions 1228 int MeasureText (const(char)* text, int fontSize); // Measure string width for default font 1229 Vector2 MeasureTextEx (Font font, const(char)* text, float fontSize, float spacing); // Measure string size for Font 1230 int GetGlyphIndex (Font font, int character); // Get index position for a unicode character on font 1231 int GetNextCodepoint (const(char)* text, int* count); // Returns next codepoint in a UTF8 encoded string 1232 // NOTE: 0x3f(`?`) is returned on failure, `count` will hold the total number of bytes processed 1233 1234 // Text strings management functions 1235 // NOTE: Some strings allocate memory internally for returned strings, just be careful! 1236 bool TextIsEqual (const(char)* text1, const(char)* text2); // Check if two text string are equal 1237 uint TextLength (const(char)* text); // Get text length, checks for '\0' ending 1238 uint TextCountCodepoints (const(char)* text); // Get total number of characters (codepoints) in a UTF8 encoded string 1239 const(char)* TextFormat (const(char)* text, ...); // Text formatting with variables (sprintf style) 1240 const(char)* TextSubtext (const(char)* text, int position, int length); // Get a piece of a text string 1241 const(char)* TextReplace (char* text, const(char)* replace, const(char)* by); // Replace text string (memory should be freed!) 1242 const(char)* TextInsert (const(char)* text, const(char)* insert, int position); // Insert text in a position (memory should be freed!) 1243 const(char)* TextJoin (const(char*)* textList, int count, const(char)* delimiter); // Join text strings with delimiter 1244 const(char*)* TextSplit (const(char)* text, char delimiter, int* count); // Split text into multiple strings 1245 void TextAppend (char* text, const(char)* append, int* position); // Append text at specific position and move cursor! 1246 int TextFindIndex (const(char)* text, const(char)* find); // Find first text occurrence within a string 1247 const(char)* TextToUpper (const(char)* text); // Get upper case version of provided string 1248 const(char)* TextToLower (const(char)* text); // Get lower case version of provided string 1249 const(char)* TextToPascal (const(char)* text); // Get Pascal case notation version of provided string 1250 int TextToInteger (const(char)* text); // Get integer value from text (negative values not supported) 1251 1252 //------------------------------------------------------------------------------------ 1253 // Basic 3d Shapes Drawing Functions (Module: models) 1254 //------------------------------------------------------------------------------------ 1255 1256 // Basic geometric 3D shapes drawing functions 1257 void DrawLine3D (Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space 1258 void DrawCircle3D (Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space 1259 void DrawCube (Vector3 position, float width, float height, float length, Color color); // Draw cube 1260 void DrawCubeV (Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) 1261 void DrawCubeWires (Vector3 position, float width, float height, float length, Color color); // Draw cube wires 1262 void DrawCubeWiresV (Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) 1263 void DrawCubeTexture (Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured 1264 void DrawSphere (Vector3 centerPos, float radius, Color color); // Draw sphere 1265 void DrawSphereEx (Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters 1266 void DrawSphereWires (Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires 1267 void DrawCylinder (Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone 1268 void DrawCylinderWires (Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires 1269 void DrawPlane (Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ 1270 void DrawRay (Ray ray, Color color); // Draw a ray line 1271 void DrawGrid (int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) 1272 void DrawGizmo (Vector3 position); // Draw simple gizmo 1273 //DrawTorus(), DrawTeapot() could be useful? 1274 1275 //------------------------------------------------------------------------------------ 1276 // Model 3d Loading and Drawing Functions (Module: models) 1277 //------------------------------------------------------------------------------------ 1278 1279 // Model loading/unloading functions 1280 Model LoadModel (const(char)* fileName); // Load model from files (meshes and materials) 1281 Model LoadModelFromMesh (Mesh mesh); // Load model from generated mesh (default material) 1282 void UnloadModel (Model model); // Unload model from memory (RAM and/or VRAM) 1283 1284 // Mesh loading/unloading functions 1285 Mesh* LoadMeshes (const(char)* fileName, int* meshCount); // Load meshes from model file 1286 void ExportMesh (Mesh mesh, const(char)* fileName); // Export mesh data to file 1287 void UnloadMesh (Mesh* mesh); // Unload mesh from memory (RAM and/or VRAM) 1288 1289 // Material loading/unloading functions 1290 Material* LoadMaterials (const(char)* fileName, int* materialCount); // Load materials from model file 1291 Material LoadMaterialDefault (); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) 1292 void UnloadMaterial (Material material); // Unload material from GPU memory (VRAM) 1293 void SetMaterialTexture (Material* material, int mapType, Texture2D texture); // Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) 1294 void SetModelMeshMaterial (Model* model, int meshId, int materialId); // Set material for a mesh 1295 1296 // Model animations loading/unloading functions 1297 ModelAnimation* LoadModelAnimations (const(char)* fileName, int* animsCount); // Load model animations from file 1298 void UpdateModelAnimation (Model model, ModelAnimation anim, int frame); // Update model animation pose 1299 void UnloadModelAnimation (ModelAnimation anim); // Unload animation data 1300 bool IsModelAnimationValid (Model model, ModelAnimation anim); // Check model animation skeleton match 1301 1302 // Mesh generation functions 1303 Mesh GenMeshPoly (int sides, float radius); // Generate polygonal mesh 1304 Mesh GenMeshPlane (float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) 1305 Mesh GenMeshCube (float width, float height, float length); // Generate cuboid mesh 1306 Mesh GenMeshSphere (float radius, int rings, int slices); // Generate sphere mesh (standard sphere) 1307 Mesh GenMeshHemiSphere (float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) 1308 Mesh GenMeshCylinder (float radius, float height, int slices); // Generate cylinder mesh 1309 Mesh GenMeshTorus (float radius, float size, int radSeg, int sides); // Generate torus mesh 1310 Mesh GenMeshKnot (float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh 1311 Mesh GenMeshHeightmap (Image heightmap, Vector3 size); // Generate heightmap mesh from image data 1312 Mesh GenMeshCubicmap (Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data 1313 1314 // Mesh manipulation functions 1315 BoundingBox MeshBoundingBox (Mesh mesh); // Compute mesh bounding box limits 1316 void MeshTangents (Mesh* mesh); // Compute mesh tangents 1317 void MeshBinormals (Mesh* mesh); // Compute mesh binormals 1318 1319 // Model drawing functions 1320 void DrawModel (Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) 1321 void DrawModelEx (Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters 1322 void DrawModelWires (Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) 1323 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 1324 void DrawBoundingBox (BoundingBox box, Color color); // Draw bounding box (wires) 1325 void DrawBillboard (Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture 1326 void DrawBillboardRec (Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec 1327 1328 // Collision detection functions 1329 bool CheckCollisionSpheres (Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres 1330 bool CheckCollisionBoxes (BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes 1331 bool CheckCollisionBoxSphere (BoundingBox box, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere 1332 bool CheckCollisionRaySphere (Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere 1333 bool CheckCollisionRaySphereEx (Ray ray, Vector3 spherePosition, float sphereRadius, Vector3* collisionPoint); // Detect collision between ray and sphere, returns collision point 1334 bool CheckCollisionRayBox (Ray ray, BoundingBox box); // Detect collision between ray and box 1335 RayHitInfo GetCollisionRayModel (Ray ray, Model* model); // Get collision info between ray and model 1336 RayHitInfo GetCollisionRayTriangle (Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle 1337 RayHitInfo GetCollisionRayGround (Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane) 1338 1339 //------------------------------------------------------------------------------------ 1340 // Shaders System Functions (Module: rlgl) 1341 // NOTE: This functions are useless when using OpenGL 1.1 1342 //------------------------------------------------------------------------------------ 1343 1344 // Shader loading/unloading functions 1345 char* LoadText (const(char)* fileName); // Load chars array from text file 1346 Shader LoadShader (const(char)* vsFileName, const(char)* fsFileName); // Load shader from files and bind default locations 1347 Shader LoadShaderCode (char* vsCode, char* fsCode); // Load shader from code strings and bind default locations 1348 void UnloadShader (Shader shader); // Unload shader from GPU memory (VRAM) 1349 1350 Shader GetShaderDefault (); // Get default shader 1351 Texture2D GetTextureDefault (); // Get default texture 1352 1353 // Shader configuration functions 1354 int GetShaderLocation (Shader shader, const(char)* uniformName); // Get shader uniform location 1355 void SetShaderValue (Shader shader, int uniformLoc, const(void)* value, int uniformType); // Set shader uniform value 1356 void SetShaderValueV (Shader shader, int uniformLoc, const(void)* value, int uniformType, int count); // Set shader uniform value vector 1357 void SetShaderValueMatrix (Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) 1358 void SetShaderValueTexture (Shader shader, int uniformLoc, Texture2D texture); // Set shader uniform value for texture 1359 void SetMatrixProjection (Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) 1360 void SetMatrixModelview (Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) 1361 Matrix GetMatrixModelview (); // Get internal modelview matrix 1362 1363 // Texture maps generation (PBR) 1364 // NOTE: Required shaders should be provided 1365 Texture2D GenTextureCubemap (Shader shader, Texture2D skyHDR, int size); // Generate cubemap texture from HDR texture 1366 Texture2D GenTextureIrradiance (Shader shader, Texture2D cubemap, int size); // Generate irradiance texture using cubemap data 1367 Texture2D GenTexturePrefilter (Shader shader, Texture2D cubemap, int size); // Generate prefilter texture using cubemap data 1368 Texture2D GenTextureBRDF (Shader shader, int size); // Generate BRDF texture 1369 1370 // Shading begin/end functions 1371 void BeginShaderMode (Shader shader); // Begin custom shader drawing 1372 void EndShaderMode (); // End custom shader drawing (use default shader) 1373 void BeginBlendMode (int mode); // Begin blending mode (alpha, additive, multiplied) 1374 void EndBlendMode (); // End blending mode (reset to default: alpha blending) 1375 void BeginScissorMode (int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) 1376 void EndScissorMode (); // End scissor mode 1377 1378 // VR control functions 1379 void InitVrSimulator (); // Init VR simulator for selected device parameters 1380 void CloseVrSimulator (); // Close VR simulator for current device 1381 void UpdateVrTracking (Camera* camera); // Update VR tracking (position and orientation) and camera 1382 void SetVrConfiguration (VrDeviceInfo info, Shader distortion); // Set stereo rendering configuration parameters 1383 bool IsVrSimulatorReady (); // Detect if VR simulator is ready 1384 void ToggleVrMode (); // Enable/Disable VR experience 1385 void BeginVrDrawing (); // Begin VR simulator stereo rendering 1386 void EndVrDrawing (); // End VR simulator stereo rendering 1387 1388 //------------------------------------------------------------------------------------ 1389 // Audio Loading and Playing Functions (Module: audio) 1390 //------------------------------------------------------------------------------------ 1391 1392 // Audio device management functions 1393 void InitAudioDevice (); // Initialize audio device and context 1394 void CloseAudioDevice (); // Close the audio device and context 1395 bool IsAudioDeviceReady (); // Check if audio device has been initialized successfully 1396 void SetMasterVolume (float volume); // Set master volume (listener) 1397 1398 // Wave/Sound loading/unloading functions 1399 Wave LoadWave (const(char)* fileName); // Load wave data from file 1400 Wave LoadWaveEx (void* data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data 1401 Sound LoadSound (const(char)* fileName); // Load sound from file 1402 Sound LoadSoundFromWave (Wave wave); // Load sound from wave data 1403 void UpdateSound (Sound sound, const(void)* data, int samplesCount); // Update sound buffer with new data 1404 void UnloadWave (Wave wave); // Unload wave data 1405 void UnloadSound (Sound sound); // Unload sound 1406 void ExportWave (Wave wave, const(char)* fileName); // Export wave data to file 1407 void ExportWaveAsCode (Wave wave, const(char)* fileName); // Export wave sample data to code (.h) 1408 1409 // Wave/Sound management functions 1410 void PlaySound (Sound sound); // Play a sound 1411 void PauseSound (Sound sound); // Pause a sound 1412 void ResumeSound (Sound sound); // Resume a paused sound 1413 void StopSound (Sound sound); // Stop playing a sound 1414 bool IsSoundPlaying (Sound sound); // Check if a sound is currently playing 1415 void SetSoundVolume (Sound sound, float volume); // Set volume for a sound (1.0 is max level) 1416 void SetSoundPitch (Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) 1417 void WaveFormat (Wave* wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format 1418 Wave WaveCopy (Wave wave); // Copy a wave to a new wave 1419 void WaveCrop (Wave* wave, int initSample, int finalSample); // Crop a wave to defined samples range 1420 float* GetWaveData (Wave wave); // Get samples data from wave as a floats array 1421 1422 // Music management functions 1423 Music LoadMusicStream (const(char)* fileName); // Load music stream from file 1424 void UnloadMusicStream (Music music); // Unload music stream 1425 void PlayMusicStream (Music music); // Start music playing 1426 void UpdateMusicStream (Music music); // Updates buffers for music streaming 1427 void StopMusicStream (Music music); // Stop music playing 1428 void PauseMusicStream (Music music); // Pause music playing 1429 void ResumeMusicStream (Music music); // Resume playing paused music 1430 bool IsMusicPlaying (Music music); // Check if music is playing 1431 void SetMusicVolume (Music music, float volume); // Set volume for music (1.0 is max level) 1432 void SetMusicPitch (Music music, float pitch); // Set pitch for a music (1.0 is base level) 1433 void SetMusicLoopCount (Music music, int count); // Set music loop count (loop repeats) 1434 float GetMusicTimeLength (Music music); // Get music time length (in seconds) 1435 float GetMusicTimePlayed (Music music); // Get current music time played (in seconds) 1436 1437 // AudioStream management functions 1438 AudioStream InitAudioStream (uint sampleRate, uint sampleSize, uint channels); // Init audio stream (to stream raw audio pcm data) 1439 void UpdateAudioStream (AudioStream stream, const(void)* data, int samplesCount); // Update audio stream buffers with data 1440 void CloseAudioStream (AudioStream stream); // Close audio stream and free memory 1441 bool IsAudioBufferProcessed (AudioStream stream); // Check if any audio stream buffers requires refill 1442 void PlayAudioStream (AudioStream stream); // Play audio stream 1443 void PauseAudioStream (AudioStream stream); // Pause audio stream 1444 void ResumeAudioStream (AudioStream stream); // Resume audio stream 1445 bool IsAudioStreamPlaying (AudioStream stream); // Check if audio stream is playing 1446 void StopAudioStream (AudioStream stream); // Stop audio stream 1447 void SetAudioStreamVolume (AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) 1448 void SetAudioStreamPitch (AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) 1449 1450 //------------------------------------------------------------------------------------ 1451 // Network (Module: network) 1452 //------------------------------------------------------------------------------------ 1453 1454 // IN PROGRESS: Check rnet.h for reference 1455 1456 // RAYLIB_H