raylib.d 81 KB

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