1 module raylib; 2 3 import dynalib; 4 5 version(SL_RAYLIB) {} else 6 static this() 7 { 8 import std.stdio : writeln; 9 10 DynaLib lib; 11 if (!lib.loadFromConfig("raylib", "raylib")) 12 { 13 version(DL_ERROR) 14 writeln("There was a problem loading raylib"); 15 return; 16 } 17 18 // Window-related functions 19 lib.bind(&InitWindow, "InitWindow"); 20 lib.bind(&WindowShouldClose, "WindowShouldClose"); 21 lib.bind(&CloseWindow, "CloseWindow"); 22 lib.bind(&IsWindowReady, "IsWindowReady"); 23 lib.bind(&IsWindowFullscreen, "IsWindowFullscreen"); 24 lib.bind(&IsWindowHidden, "IsWindowHidden"); 25 lib.bind(&IsWindowMinimized, "IsWindowMinimized"); 26 lib.bind(&IsWindowMaximized, "IsWindowMaximized"); 27 lib.bind(&IsWindowFocused, "IsWindowFocused"); 28 lib.bind(&IsWindowResized, "IsWindowResized"); 29 lib.bind(&IsWindowState, "IsWindowState"); 30 lib.bind(&SetWindowState, "SetWindowState"); 31 lib.bind(&ClearWindowState, "ClearWindowState"); 32 lib.bind(&ToggleFullscreen, "ToggleFullscreen"); 33 lib.bind(&MaximizeWindow, "MaximizeWindow"); 34 lib.bind(&MinimizeWindow, "MinimizeWindow"); 35 lib.bind(&RestoreWindow, "RestoreWindow"); 36 lib.bind(&SetWindowIcon, "SetWindowIcon"); 37 lib.bind(&SetWindowTitle, "SetWindowTitle"); 38 lib.bind(&SetWindowPosition, "SetWindowPosition"); 39 lib.bind(&SetWindowMonitor, "SetWindowMonitor"); 40 lib.bind(&SetWindowMinSize, "SetWindowMinSize"); 41 lib.bind(&SetWindowSize, "SetWindowSize"); 42 lib.bind(&GetWindowHandle, "GetWindowHandle"); 43 lib.bind(&GetScreenWidth, "GetScreenWidth"); 44 lib.bind(&GetScreenHeight, "GetScreenHeight"); 45 lib.bind(&GetMonitorCount, "GetMonitorCount"); 46 lib.bind(&GetCurrentMonitor, "GetCurrentMonitor"); 47 lib.bind(&GetMonitorPosition, "GetMonitorPosition"); 48 lib.bind(&GetMonitorWidth, "GetMonitorWidth"); 49 lib.bind(&GetMonitorHeight, "GetMonitorHeight"); 50 lib.bind(&GetMonitorPhysicalWidth, "GetMonitorPhysicalWidth"); 51 lib.bind(&GetMonitorPhysicalHeight, "GetMonitorPhysicalHeight"); 52 lib.bind(&GetMonitorRefreshRate, "GetMonitorRefreshRate"); 53 lib.bind(&GetWindowPosition, "GetWindowPosition"); 54 lib.bind(&GetWindowScaleDPI, "GetWindowScaleDPI"); 55 lib.bind(&GetMonitorName, "GetMonitorName"); 56 lib.bind(&SetClipboardText, "SetClipboardText"); 57 lib.bind(&GetClipboardText, "GetClipboardText"); 58 59 // Custom frame control functions 60 lib.bind(&SwapScreenBuffer, "SwapScreenBuffer"); 61 lib.bind(&PollInputEvents, "PollInputEvents"); 62 lib.bind(&WaitTime, "WaitTime"); 63 64 // Cursor-related functions 65 lib.bind(&ShowCursor, "ShowCursor"); 66 lib.bind(&HideCursor, "HideCursor"); 67 lib.bind(&IsCursorHidden, "IsCursorHidden"); 68 lib.bind(&EnableCursor, "EnableCursor"); 69 lib.bind(&DisableCursor, "DisableCursor"); 70 lib.bind(&IsCursorOnScreen, "IsCursorOnScreen"); 71 72 // Drawing-related functions 73 lib.bind(&ClearBackground, "ClearBackground"); 74 lib.bind(&BeginDrawing, "BeginDrawing"); 75 lib.bind(&EndDrawing, "EndDrawing"); 76 lib.bind(&BeginMode2D, "BeginMode2D"); 77 lib.bind(&EndMode2D, "EndMode2D"); 78 lib.bind(&BeginMode3D, "BeginMode3D"); 79 lib.bind(&EndMode3D, "EndMode3D"); 80 lib.bind(&BeginTextureMode, "BeginTextureMode"); 81 lib.bind(&EndTextureMode, "EndTextureMode"); 82 lib.bind(&BeginShaderMode, "BeginShaderMode"); 83 lib.bind(&EndShaderMode, "EndShaderMode"); 84 lib.bind(&BeginBlendMode, "BeginBlendMode"); 85 lib.bind(&EndBlendMode, "EndBlendMode"); 86 lib.bind(&BeginScissorMode, "BeginScissorMode"); 87 lib.bind(&EndScissorMode, "EndScissorMode"); 88 lib.bind(&BeginVrStereoMode, "BeginVrStereoMode"); 89 lib.bind(&EndVrStereoMode, "EndVrStereoMode"); 90 91 // VR stereo config functions for VR simulator 92 lib.bind(&LoadVrStereoConfig, "LoadVrStereoConfig"); 93 lib.bind(&UnloadVrStereoConfig, "UnloadVrStereoConfig"); 94 95 // Shader management functions 96 lib.bind(&LoadShader, "LoadShader"); 97 lib.bind(&LoadShaderFromMemory, "LoadShaderFromMemory"); 98 lib.bind(&GetShaderLocation, "GetShaderLocation"); 99 lib.bind(&GetShaderLocationAttrib, "GetShaderLocationAttrib"); 100 lib.bind(&SetShaderValue, "SetShaderValue"); 101 lib.bind(&SetShaderValueV, "SetShaderValueV"); 102 lib.bind(&SetShaderValueMatrix, "SetShaderValueMatrix"); 103 lib.bind(&SetShaderValueTexture, "SetShaderValueTexture"); 104 lib.bind(&UnloadShader, "UnloadShader"); 105 106 // Screen-space-related functions 107 lib.bind(&GetMouseRay, "GetMouseRay"); 108 lib.bind(&GetCameraMatrix, "GetCameraMatrix"); 109 lib.bind(&GetCameraMatrix2D, "GetCameraMatrix2D"); 110 lib.bind(&GetWorldToScreen, "GetWorldToScreen"); 111 lib.bind(&GetWorldToScreenEx, "GetWorldToScreenEx"); 112 lib.bind(&GetWorldToScreen2D, "GetWorldToScreen2D"); 113 lib.bind(&GetScreenToWorld2D, "GetScreenToWorld2D"); 114 115 // Timing-related functions 116 lib.bind(&SetTargetFPS, "SetTargetFPS"); 117 lib.bind(&GetFPS, "GetFPS"); 118 lib.bind(&GetFrameTime, "GetFrameTime"); 119 lib.bind(&GetTime, "GetTime"); 120 121 // Misc. functions 122 lib.bind(&GetRandomValue, "GetRandomValue"); 123 lib.bind(&SetRandomSeed, "SetRandomSeed"); 124 lib.bind(&TakeScreenshot, "TakeScreenshot"); 125 lib.bind(&SetConfigFlags, "SetConfigFlags"); 126 127 lib.bind(&TraceLog, "TraceLog"); 128 lib.bind(&SetTraceLogLevel, "SetTraceLogLevel"); 129 lib.bind(&MemAlloc, "MemAlloc"); 130 lib.bind(&MemRealloc, "MemRealloc"); 131 lib.bind(&MemFree, "MemFree"); 132 133 // Set custom callbacks 134 lib.bind(&SetTraceLogCallback, "SetTraceLogCallback"); 135 lib.bind(&SetLoadFileDataCallback, "SetLoadFileDataCallback"); 136 lib.bind(&SetSaveFileDataCallback, "SetSaveFileDataCallback"); 137 lib.bind(&SetLoadFileTextCallback, "SetLoadFileTextCallback"); 138 lib.bind(&SetSaveFileTextCallback, "SetSaveFileTextCallback"); 139 140 // Files management functions 141 lib.bind(&LoadFileData, "LoadFileData"); 142 lib.bind(&UnloadFileData, "UnloadFileData"); 143 lib.bind(&SaveFileData, "SaveFileData"); 144 lib.bind(&LoadFileText, "LoadFileText"); 145 lib.bind(&UnloadFileText, "UnloadFileText"); 146 lib.bind(&SaveFileText, "SaveFileText"); 147 lib.bind(&FileExists, "FileExists"); 148 lib.bind(&DirectoryExists, "DirectoryExists"); 149 lib.bind(&IsFileExtension, "IsFileExtension"); 150 lib.bind(&GetFileExtension, "GetFileExtension"); 151 lib.bind(&GetFileName, "GetFileName"); 152 lib.bind(&GetFileNameWithoutExt, "GetFileNameWithoutExt"); 153 lib.bind(&GetDirectoryPath, "GetDirectoryPath"); 154 lib.bind(&GetPrevDirectoryPath, "GetPrevDirectoryPath"); 155 lib.bind(&GetWorkingDirectory, "GetWorkingDirectory"); 156 lib.bind(&GetDirectoryFiles, "GetDirectoryFiles"); 157 lib.bind(&ClearDirectoryFiles, "ClearDirectoryFiles"); 158 lib.bind(&ChangeDirectory, "ChangeDirectory"); 159 lib.bind(&IsFileDropped, "IsFileDropped"); 160 lib.bind(&GetDroppedFiles, "GetDroppedFiles"); 161 lib.bind(&ClearDroppedFiles, "ClearDroppedFiles"); 162 lib.bind(&GetFileModTime, "GetFileModTime"); 163 164 // Compression/Encoding functionality 165 lib.bind(&CompressData, "CompressData"); 166 lib.bind(&DecompressData, "DecompressData"); 167 lib.bind(&EncodeDataBase64, "EncodeDataBase64"); 168 lib.bind(&DecodeDataBase64, "DecodeDataBase64"); 169 170 // Persistent storage management 171 lib.bind(&SaveStorageValue, "SaveStorageValue"); 172 lib.bind(&LoadStorageValue, "LoadStorageValue"); 173 174 lib.bind(&OpenURL, "OpenURL"); 175 176 //------------------------------------------------------------------------------------ 177 // Input Handling Functions (Module: core) 178 //------------------------------------------------------------------------------------ 179 180 // Input-related functions: keyboard 181 lib.bind(&IsKeyPressed, "IsKeyPressed"); 182 lib.bind(&IsKeyDown, "IsKeyDown"); 183 lib.bind(&IsKeyReleased, "IsKeyReleased"); 184 lib.bind(&IsKeyUp, "IsKeyUp"); 185 lib.bind(&SetExitKey, "SetExitKey"); 186 lib.bind(&GetKeyPressed, "GetKeyPressed"); 187 lib.bind(&GetCharPressed, "GetCharPressed"); 188 189 // Input-related functions: gamepads 190 lib.bind(&IsGamepadAvailable, "IsGamepadAvailable"); 191 lib.bind(&GetGamepadName, "GetGamepadName"); 192 lib.bind(&IsGamepadButtonPressed, "IsGamepadButtonPressed"); 193 lib.bind(&IsGamepadButtonDown, "IsGamepadButtonDown"); 194 lib.bind(&IsGamepadButtonReleased, "IsGamepadButtonReleased"); 195 lib.bind(&IsGamepadButtonUp, "IsGamepadButtonUp"); 196 lib.bind(&GetGamepadButtonPressed, "GetGamepadButtonPressed"); 197 lib.bind(&GetGamepadAxisCount, "GetGamepadAxisCount"); 198 lib.bind(&GetGamepadAxisMovement, "GetGamepadAxisMovement"); 199 lib.bind(&SetGamepadMappings, "SetGamepadMappings"); 200 201 // Input-related functions: mouse 202 lib.bind(&IsMouseButtonPressed, "IsMouseButtonPressed"); 203 lib.bind(&IsMouseButtonDown, "IsMouseButtonDown"); 204 lib.bind(&IsMouseButtonReleased, "IsMouseButtonReleased"); 205 lib.bind(&IsMouseButtonUp, "IsMouseButtonUp"); 206 lib.bind(&GetMouseX, "GetMouseX"); 207 lib.bind(&GetMouseY, "GetMouseY"); 208 lib.bind(&GetMousePosition, "GetMousePosition"); 209 lib.bind(&GetMouseDelta, "GetMouseDelta"); 210 lib.bind(&SetMousePosition, "SetMousePosition"); 211 lib.bind(&SetMouseOffset, "SetMouseOffset"); 212 lib.bind(&SetMouseScale, "SetMouseScale"); 213 lib.bind(&GetMouseWheelMove, "GetMouseWheelMove"); 214 lib.bind(&SetMouseCursor, "SetMouseCursor"); 215 216 // Input-related functions: touch 217 lib.bind(&GetTouchX, "GetTouchX"); 218 lib.bind(&GetTouchY, "GetTouchY"); 219 lib.bind(&GetTouchPosition, "GetTouchPosition"); 220 lib.bind(&GetTouchPointId, "GetTouchPointId"); 221 lib.bind(&GetTouchPointCount, "GetTouchPointCount"); 222 223 //------------------------------------------------------------------------------------ 224 // Gestures and Touch Handling Functions (Module: rgestures) 225 //------------------------------------------------------------------------------------ 226 lib.bind(&SetGesturesEnabled, "SetGesturesEnabled"); 227 lib.bind(&IsGestureDetected, "IsGestureDetected"); 228 lib.bind(&GetGestureDetected, "GetGestureDetected"); 229 lib.bind(&GetGestureHoldDuration, "GetGestureHoldDuration"); 230 lib.bind(&GetGestureDragVector, "GetGestureDragVector"); 231 lib.bind(&GetGestureDragAngle, "GetGestureDragAngle"); 232 lib.bind(&GetGesturePinchVector, "GetGesturePinchVector"); 233 lib.bind(&GetGesturePinchAngle, "GetGesturePinchAngle"); 234 235 //------------------------------------------------------------------------------------ 236 // Camera System Functions (Module: rcamera) 237 //------------------------------------------------------------------------------------ 238 lib.bind(&SetCameraMode, "SetCameraMode"); 239 lib.bind(&UpdateCamera, "UpdateCamera"); 240 241 lib.bind(&SetCameraPanControl, "SetCameraPanControl"); 242 lib.bind(&SetCameraAltControl, "SetCameraAltControl"); 243 lib.bind(&SetCameraSmoothZoomControl, "SetCameraSmoothZoomControl"); 244 lib.bind(&SetCameraMoveControls, "SetCameraMoveControls"); 245 246 //------------------------------------------------------------------------------------ 247 // Basic Shapes Drawing Functions (Module: shapes) 248 //------------------------------------------------------------------------------------ 249 lib.bind(&SetShapesTexture, "SetShapesTexture"); 250 251 // Basic shapes drawing functions 252 lib.bind(&DrawPixel, "DrawPixel"); 253 lib.bind(&DrawPixelV, "DrawPixelV"); 254 lib.bind(&DrawLine, "DrawLine"); 255 lib.bind(&DrawLineV, "DrawLineV"); 256 lib.bind(&DrawLineEx, "DrawLineEx"); 257 lib.bind(&DrawLineBezier, "DrawLineBezier"); 258 lib.bind(&DrawLineBezierQuad, "DrawLineBezierQuad"); 259 lib.bind(&DrawLineBezierCubic, "DrawLineBezierCubic"); 260 lib.bind(&DrawLineStrip, "DrawLineStrip"); 261 lib.bind(&DrawCircle, "DrawCircle"); 262 lib.bind(&DrawCircleSector, "DrawCircleSector"); 263 lib.bind(&DrawCircleSectorLines, "DrawCircleSectorLines"); 264 lib.bind(&DrawCircleGradient, "DrawCircleGradient"); 265 lib.bind(&DrawCircleV, "DrawCircleV"); 266 lib.bind(&DrawCircleLines, "DrawCircleLines"); 267 lib.bind(&DrawEllipse, "DrawEllipse"); 268 lib.bind(&DrawEllipseLines, "DrawEllipseLines"); 269 lib.bind(&DrawRing, "DrawRing"); 270 lib.bind(&DrawRingLines, "DrawRingLines"); 271 lib.bind(&DrawRectangle, "DrawRectangle"); 272 lib.bind(&DrawRectangleV, "DrawRectangleV"); 273 lib.bind(&DrawRectangleRec, "DrawRectangleRec"); 274 lib.bind(&DrawRectanglePro, "DrawRectanglePro"); 275 lib.bind(&DrawRectangleGradientV, "DrawRectangleGradientV"); 276 lib.bind(&DrawRectangleGradientH, "DrawRectangleGradientH"); 277 lib.bind(&DrawRectangleGradientEx, "DrawRectangleGradientEx"); 278 lib.bind(&DrawRectangleLines, "DrawRectangleLines"); 279 lib.bind(&DrawRectangleLinesEx, "DrawRectangleLinesEx"); 280 lib.bind(&DrawRectangleRounded, "DrawRectangleRounded"); 281 lib.bind(&DrawRectangleRoundedLines, "DrawRectangleRoundedLines"); 282 lib.bind(&DrawTriangle, "DrawTriangle"); 283 lib.bind(&DrawTriangleLines, "DrawTriangleLines"); 284 lib.bind(&DrawTriangleFan, "DrawTriangleFan"); 285 lib.bind(&DrawTriangleStrip, "DrawTriangleStrip"); 286 lib.bind(&DrawPoly, "DrawPoly"); 287 lib.bind(&DrawPolyLines, "DrawPolyLines"); 288 lib.bind(&DrawPolyLinesEx, "DrawPolyLinesEx"); 289 290 // Basic shapes collision detection functions 291 lib.bind(&CheckCollisionRecs, "CheckCollisionRecs"); 292 lib.bind(&CheckCollisionCircles, "CheckCollisionCircles"); 293 lib.bind(&CheckCollisionCircleRec, "CheckCollisionCircleRec"); 294 lib.bind(&CheckCollisionPointRec, "CheckCollisionPointRec"); 295 lib.bind(&CheckCollisionPointCircle, "CheckCollisionPointCircle"); 296 lib.bind(&CheckCollisionPointTriangle, "CheckCollisionPointTriangle"); 297 lib.bind(&CheckCollisionLines, "CheckCollisionLines"); 298 lib.bind(&CheckCollisionPointLine, "CheckCollisionPointLine"); 299 lib.bind(&GetCollisionRec, "GetCollisionRec"); 300 301 //------------------------------------------------------------------------------------ 302 // Texture Loading and Drawing Functions (Module: textures) 303 //------------------------------------------------------------------------------------ 304 305 // Image loading functions 306 lib.bind(&LoadImage, "LoadImage"); 307 lib.bind(&LoadImageRaw, "LoadImageRaw"); 308 lib.bind(&LoadImageAnim, "LoadImageAnim"); 309 lib.bind(&LoadImageFromMemory, "LoadImageFromMemory"); 310 lib.bind(&LoadImageFromTexture, "LoadImageFromTexture"); 311 lib.bind(&LoadImageFromScreen, "LoadImageFromScreen"); 312 lib.bind(&UnloadImage, "UnloadImage"); 313 lib.bind(&ExportImage, "ExportImage"); 314 lib.bind(&ExportImageAsCode, "ExportImageAsCode"); 315 316 // Image generation functions 317 lib.bind(&GenImageColor, "GenImageColor"); 318 lib.bind(&GenImageGradientV, "GenImageGradientV"); 319 lib.bind(&GenImageGradientH, "GenImageGradientH"); 320 lib.bind(&GenImageGradientRadial, "GenImageGradientRadial"); 321 lib.bind(&GenImageChecked, "GenImageChecked"); 322 lib.bind(&GenImageWhiteNoise, "GenImageWhiteNoise"); 323 lib.bind(&GenImageCellular, "GenImageCellular"); 324 325 // Image manipulation functions 326 lib.bind(&ImageCopy, "ImageCopy"); 327 lib.bind(&ImageFromImage, "ImageFromImage"); 328 lib.bind(&ImageText, "ImageText"); 329 lib.bind(&ImageTextEx, "ImageTextEx"); 330 lib.bind(&ImageFormat, "ImageFormat"); 331 lib.bind(&ImageToPOT, "ImageToPOT"); 332 lib.bind(&ImageCrop, "ImageCrop"); 333 lib.bind(&ImageAlphaCrop, "ImageAlphaCrop"); 334 lib.bind(&ImageAlphaClear, "ImageAlphaClear"); 335 lib.bind(&ImageAlphaMask, "ImageAlphaMask"); 336 lib.bind(&ImageAlphaPremultiply, "ImageAlphaPremultiply"); 337 lib.bind(&ImageResize, "ImageResize"); 338 lib.bind(&ImageResizeNN, "ImageResizeNN"); 339 lib.bind(&ImageResizeCanvas, "ImageResizeCanvas"); 340 lib.bind(&ImageMipmaps, "ImageMipmaps"); 341 lib.bind(&ImageDither, "ImageDither"); 342 lib.bind(&ImageFlipVertical, "ImageFlipVertical"); 343 lib.bind(&ImageFlipHorizontal, "ImageFlipHorizontal"); 344 lib.bind(&ImageRotateCW, "ImageRotateCW"); 345 lib.bind(&ImageRotateCCW, "ImageRotateCCW"); 346 lib.bind(&ImageColorTint, "ImageColorTint"); 347 lib.bind(&ImageColorInvert, "ImageColorInvert"); 348 lib.bind(&ImageColorGrayscale, "ImageColorGrayscale"); 349 lib.bind(&ImageColorContrast, "ImageColorContrast"); 350 lib.bind(&ImageColorBrightness, "ImageColorBrightness"); 351 lib.bind(&ImageColorReplace, "ImageColorReplace"); 352 lib.bind(&LoadImageColors, "LoadImageColors"); 353 lib.bind(&LoadImagePalette, "LoadImagePalette"); 354 lib.bind(&UnloadImageColors, "UnloadImageColors"); 355 lib.bind(&UnloadImagePalette, "UnloadImagePalette"); 356 lib.bind(&GetImageAlphaBorder, "GetImageAlphaBorder"); 357 lib.bind(&GetImageColor, "GetImageColor"); 358 359 // Image drawing functions 360 // NOTE: Image software-rendering functions (CPU) 361 lib.bind(&ImageClearBackground, "ImageClearBackground"); 362 lib.bind(&ImageDrawPixel, "ImageDrawPixel"); 363 lib.bind(&ImageDrawPixelV, "ImageDrawPixelV"); 364 lib.bind(&ImageDrawLine, "ImageDrawLine"); 365 lib.bind(&ImageDrawLineV, "ImageDrawLineV"); 366 lib.bind(&ImageDrawCircle, "ImageDrawCircle"); 367 lib.bind(&ImageDrawCircleV, "ImageDrawCircleV"); 368 lib.bind(&ImageDrawRectangle, "ImageDrawRectangle"); 369 lib.bind(&ImageDrawRectangleV, "ImageDrawRectangleV"); 370 lib.bind(&ImageDrawRectangleRec, "ImageDrawRectangleRec"); 371 lib.bind(&ImageDrawRectangleLines, "ImageDrawRectangleLines"); 372 lib.bind(&ImageDraw, "ImageDraw"); 373 lib.bind(&ImageDrawText, "ImageDrawText"); 374 lib.bind(&ImageDrawTextEx, "ImageDrawTextEx"); 375 376 // Texture loading functions 377 lib.bind(&LoadTexture, "LoadTexture"); 378 lib.bind(&LoadTextureFromImage, "LoadTextureFromImage"); 379 lib.bind(&LoadTextureCubemap, "LoadTextureCubemap"); 380 lib.bind(&LoadRenderTexture, "LoadRenderTexture"); 381 lib.bind(&UnloadTexture, "UnloadTexture"); 382 lib.bind(&UnloadRenderTexture, "UnloadRenderTexture"); 383 lib.bind(&UpdateTexture, "UpdateTexture"); 384 lib.bind(&UpdateTextureRec, "UpdateTextureRec"); 385 386 // Texture configuration functions 387 lib.bind(&GenTextureMipmaps, "GenTextureMipmaps"); 388 lib.bind(&SetTextureFilter, "SetTextureFilter"); 389 lib.bind(&SetTextureWrap, "SetTextureWrap"); 390 391 // Texture drawing functions 392 lib.bind(&DrawTexture, "DrawTexture"); 393 lib.bind(&DrawTextureV, "DrawTextureV"); 394 lib.bind(&DrawTextureEx, "DrawTextureEx"); 395 lib.bind(&DrawTextureRec, "DrawTextureRec"); 396 lib.bind(&DrawTextureQuad, "DrawTextureQuad"); 397 lib.bind(&DrawTextureTiled, "DrawTextureTiled"); 398 lib.bind(&DrawTexturePro, "DrawTexturePro"); 399 lib.bind(&DrawTextureNPatch, "DrawTextureNPatch"); 400 lib.bind(&DrawTexturePoly, "DrawTexturePoly"); 401 402 // Color/pixel related functions 403 lib.bind(&Fade, "Fade"); 404 lib.bind(&ColorToInt, "ColorToInt"); 405 lib.bind(&ColorNormalize, "ColorNormalize"); 406 lib.bind(&ColorFromNormalized, "ColorFromNormalized"); 407 lib.bind(&ColorToHSV, "ColorToHSV"); 408 lib.bind(&ColorFromHSV, "ColorFromHSV"); 409 lib.bind(&ColorAlpha, "ColorAlpha"); 410 lib.bind(&ColorAlphaBlend, "ColorAlphaBlend"); 411 lib.bind(&GetColor, "GetColor"); 412 lib.bind(&GetPixelColor, "GetPixelColor"); 413 lib.bind(&SetPixelColor, "SetPixelColor"); 414 lib.bind(&GetPixelDataSize, "GetPixelDataSize"); 415 416 //------------------------------------------------------------------------------------ 417 // Font Loading and Text Drawing Functions (Module: text) 418 //------------------------------------------------------------------------------------ 419 420 // Font loading/unloading functions 421 lib.bind(&GetFontDefault, "GetFontDefault"); 422 lib.bind(&LoadFont, "LoadFont"); 423 lib.bind(&LoadFontEx, "LoadFontEx"); 424 lib.bind(&LoadFontFromImage, "LoadFontFromImage"); 425 lib.bind(&LoadFontFromMemory, "LoadFontFromMemory"); 426 lib.bind(&LoadFontData, "LoadFontData"); 427 lib.bind(&GenImageFontAtlas, "GenImageFontAtlas"); 428 lib.bind(&UnloadFontData, "UnloadFontData"); 429 lib.bind(&UnloadFont, "UnloadFont"); 430 431 // Text drawing functions 432 lib.bind(&DrawFPS, "DrawFPS"); 433 lib.bind(&DrawText, "DrawText"); 434 lib.bind(&DrawTextEx, "DrawTextEx"); 435 lib.bind(&DrawTextPro, "DrawTextPro"); 436 lib.bind(&DrawTextCodepoint, "DrawTextCodepoint"); 437 438 // Text font info functions 439 lib.bind(&MeasureText, "MeasureText"); 440 lib.bind(&MeasureTextEx, "MeasureTextEx"); 441 lib.bind(&GetGlyphIndex, "GetGlyphIndex"); 442 lib.bind(&GetGlyphInfo, "GetGlyphInfo"); 443 lib.bind(&GetGlyphAtlasRec, "GetGlyphAtlasRec"); 444 445 // Text codepoints management functions (unicode characters) 446 lib.bind(&LoadCodepoints, "LoadCodepoints"); 447 lib.bind(&UnloadCodepoints, "UnloadCodepoints"); 448 lib.bind(&GetCodepointCount, "GetCodepointCount"); 449 lib.bind(&GetCodepoint, "GetCodepoint"); 450 lib.bind(&CodepointToUTF8, "CodepointToUTF8"); 451 lib.bind(&TextCodepointsToUTF8, "TextCodepointsToUTF8"); 452 453 // Text strings management functions (no UTF-8 strings, only byte chars) 454 lib.bind(&TextCopy, "TextCopy"); 455 lib.bind(&TextIsEqual, "TextIsEqual"); 456 lib.bind(&TextLength, "TextLength"); 457 lib.bind(&TextFormat, "TextFormat"); 458 lib.bind(&TextSubtext, "TextSubtext"); 459 lib.bind(&TextReplace, "TextReplace"); 460 lib.bind(&TextInsert, "TextInsert"); 461 lib.bind(&TextJoin, "TextJoin"); 462 lib.bind(&TextSplit, "TextSplit"); 463 lib.bind(&TextAppend, "TextAppend"); 464 lib.bind(&TextFindIndex, "TextFindIndex"); 465 lib.bind(&TextToUpper, "TextToUpper"); 466 lib.bind(&TextToLower, "TextToLower"); 467 lib.bind(&TextToPascal, "TextToPascal"); 468 lib.bind(&TextToInteger, "TextToInteger"); 469 470 //------------------------------------------------------------------------------------ 471 // Basic 3d Shapes Drawing Functions (Module: models) 472 //------------------------------------------------------------------------------------ 473 474 // Basic geometric 3D shapes drawing functions 475 lib.bind(&DrawLine3D, "DrawLine3D"); 476 lib.bind(&DrawPoint3D, "DrawPoint3D"); 477 lib.bind(&DrawCircle3D, "DrawCircle3D"); 478 lib.bind(&DrawTriangle3D, "DrawTriangle3D"); 479 lib.bind(&DrawTriangleStrip3D, "DrawTriangleStrip3D"); 480 lib.bind(&DrawCube, "DrawCube"); 481 lib.bind(&DrawCubeV, "DrawCubeV"); 482 lib.bind(&DrawCubeWires, "DrawCubeWires"); 483 lib.bind(&DrawCubeWiresV, "DrawCubeWiresV"); 484 lib.bind(&DrawCubeTexture, "DrawCubeTexture"); 485 lib.bind(&DrawCubeTextureRec, "DrawCubeTextureRec"); 486 lib.bind(&DrawSphere, "DrawSphere"); 487 lib.bind(&DrawSphereEx, "DrawSphereEx"); 488 lib.bind(&DrawSphereWires, "DrawSphereWires"); 489 lib.bind(&DrawCylinder, "DrawCylinder"); 490 lib.bind(&DrawCylinderEx, "DrawCylinderEx"); 491 lib.bind(&DrawCylinderWires, "DrawCylinderWires"); 492 lib.bind(&DrawCylinderWiresEx, "DrawCylinderWiresEx"); 493 lib.bind(&DrawPlane, "DrawPlane"); 494 lib.bind(&DrawRay, "DrawRay"); 495 lib.bind(&DrawGrid, "DrawGrid"); 496 497 //------------------------------------------------------------------------------------ 498 // Model 3d Loading and Drawing Functions (Module: models) 499 //------------------------------------------------------------------------------------ 500 501 // Model management functions 502 lib.bind(&LoadModel, "LoadModel"); 503 lib.bind(&LoadModelFromMesh, "LoadModelFromMesh"); 504 lib.bind(&UnloadModel, "UnloadModel"); 505 lib.bind(&UnloadModelKeepMeshes, "UnloadModelKeepMeshes"); 506 lib.bind(&GetModelBoundingBox, "GetModelBoundingBox"); 507 508 // Model drawing functions 509 lib.bind(&DrawModel, "DrawModel"); 510 lib.bind(&DrawModelEx, "DrawModelEx"); 511 lib.bind(&DrawModelWires, "DrawModelWires"); 512 lib.bind(&DrawModelWiresEx, "DrawModelWiresEx"); 513 lib.bind(&DrawBoundingBox, "DrawBoundingBox"); 514 lib.bind(&DrawBillboard, "DrawBillboard"); 515 lib.bind(&DrawBillboardRec, "DrawBillboardRec"); 516 lib.bind(&DrawBillboardPro, "DrawBillboardPro"); 517 518 // Mesh management functions 519 lib.bind(&UploadMesh, "UploadMesh"); 520 lib.bind(&UpdateMeshBuffer, "UpdateMeshBuffer"); 521 lib.bind(&UnloadMesh, "UnloadMesh"); 522 lib.bind(&DrawMesh, "DrawMesh"); 523 lib.bind(&DrawMeshInstanced, "DrawMeshInstanced"); 524 lib.bind(&ExportMesh, "ExportMesh"); 525 lib.bind(&GetMeshBoundingBox, "GetMeshBoundingBox"); 526 lib.bind(&GenMeshTangents, "GenMeshTangents"); 527 lib.bind(&GenMeshBinormals, "GenMeshBinormals"); 528 529 // Mesh generation functions 530 lib.bind(&GenMeshPoly, "GenMeshPoly"); 531 lib.bind(&GenMeshPlane, "GenMeshPlane"); 532 lib.bind(&GenMeshCube, "GenMeshCube"); 533 lib.bind(&GenMeshSphere, "GenMeshSphere"); 534 lib.bind(&GenMeshHemiSphere, "GenMeshHemiSphere"); 535 lib.bind(&GenMeshCylinder, "GenMeshCylinder"); 536 lib.bind(&GenMeshCone, "GenMeshCone"); 537 lib.bind(&GenMeshTorus, "GenMeshTorus"); 538 lib.bind(&GenMeshKnot, "GenMeshKnot"); 539 lib.bind(&GenMeshHeightmap, "GenMeshHeightmap"); 540 lib.bind(&GenMeshCubicmap, "GenMeshCubicmap"); 541 542 // Material loading/unloading functions 543 lib.bind(&LoadMaterials, "LoadMaterials"); 544 lib.bind(&LoadMaterialDefault, "LoadMaterialDefault"); 545 lib.bind(&UnloadMaterial, "UnloadMaterial"); 546 lib.bind(&SetMaterialTexture, "SetMaterialTexture"); 547 lib.bind(&SetModelMeshMaterial, "SetModelMeshMaterial"); 548 549 // Model animations loading/unloading functions 550 lib.bind(&LoadModelAnimations, "LoadModelAnimations"); 551 lib.bind(&UpdateModelAnimation, "UpdateModelAnimation"); 552 lib.bind(&UnloadModelAnimation, "UnloadModelAnimation"); 553 lib.bind(&UnloadModelAnimations, "UnloadModelAnimations"); 554 lib.bind(&IsModelAnimationValid, "IsModelAnimationValid"); 555 556 // Collision detection functions 557 lib.bind(&CheckCollisionSpheres, "CheckCollisionSpheres"); 558 lib.bind(&CheckCollisionBoxes, "CheckCollisionBoxes"); 559 lib.bind(&CheckCollisionBoxSphere, "CheckCollisionBoxSphere"); 560 lib.bind(&GetRayCollisionSphere, "GetRayCollisionSphere"); 561 lib.bind(&GetRayCollisionBox, "GetRayCollisionBox"); 562 lib.bind(&GetRayCollisionModel, "GetRayCollisionModel"); 563 lib.bind(&GetRayCollisionMesh, "GetRayCollisionMesh"); 564 lib.bind(&GetRayCollisionTriangle, "GetRayCollisionTriangle"); 565 lib.bind(&GetRayCollisionQuad, "GetRayCollisionQuad"); 566 567 //------------------------------------------------------------------------------------ 568 // Audio Loading and Playing Functions (Module: audio) 569 //------------------------------------------------------------------------------------ 570 571 // Audio device management functions 572 lib.bind(&InitAudioDevice, "InitAudioDevice"); 573 lib.bind(&CloseAudioDevice, "CloseAudioDevice"); 574 lib.bind(&IsAudioDeviceReady, "IsAudioDeviceReady"); 575 lib.bind(&SetMasterVolume, "SetMasterVolume"); 576 577 // Wave/Sound loading/unloading functions 578 lib.bind(&LoadWave, "LoadWave"); 579 lib.bind(&LoadWaveFromMemory, "LoadWaveFromMemory"); 580 lib.bind(&LoadSound, "LoadSound"); 581 lib.bind(&LoadSoundFromWave, "LoadSoundFromWave"); 582 lib.bind(&UpdateSound, "UpdateSound"); 583 lib.bind(&UnloadWave, "UnloadWave"); 584 lib.bind(&UnloadSound, "UnloadSound"); 585 lib.bind(&ExportWave, "ExportWave"); 586 lib.bind(&ExportWaveAsCode, "ExportWaveAsCode"); 587 588 // Wave/Sound management functions 589 lib.bind(&PlaySound, "PlaySound"); 590 lib.bind(&StopSound, "StopSound"); 591 lib.bind(&PauseSound, "PauseSound"); 592 lib.bind(&ResumeSound, "ResumeSound"); 593 lib.bind(&PlaySoundMulti, "PlaySoundMulti"); 594 lib.bind(&StopSoundMulti, "StopSoundMulti"); 595 lib.bind(&GetSoundsPlaying, "GetSoundsPlaying"); 596 lib.bind(&IsSoundPlaying, "IsSoundPlaying"); 597 lib.bind(&SetSoundVolume, "SetSoundVolume"); 598 lib.bind(&SetSoundPitch, "SetSoundPitch"); 599 lib.bind(&WaveFormat, "WaveFormat"); 600 lib.bind(&WaveCopy, "WaveCopy"); 601 lib.bind(&WaveCrop, "WaveCrop"); 602 lib.bind(&LoadWaveSamples, "LoadWaveSamples"); 603 lib.bind(&UnloadWaveSamples, "UnloadWaveSamples"); 604 605 // Music management functions 606 lib.bind(&LoadMusicStream, "LoadMusicStream"); 607 lib.bind(&LoadMusicStreamFromMemory, "LoadMusicStreamFromMemory"); 608 lib.bind(&UnloadMusicStream, "UnloadMusicStream"); 609 lib.bind(&PlayMusicStream, "PlayMusicStream"); 610 lib.bind(&IsMusicStreamPlaying, "IsMusicStreamPlaying"); 611 lib.bind(&UpdateMusicStream, "UpdateMusicStream"); 612 lib.bind(&StopMusicStream, "StopMusicStream"); 613 lib.bind(&PauseMusicStream, "PauseMusicStream"); 614 lib.bind(&ResumeMusicStream, "ResumeMusicStream"); 615 lib.bind(&SeekMusicStream, "SeekMusicStream"); 616 lib.bind(&SetMusicVolume, "SetMusicVolume"); 617 lib.bind(&SetMusicPitch, "SetMusicPitch"); 618 lib.bind(&GetMusicTimeLength, "GetMusicTimeLength"); 619 lib.bind(&GetMusicTimePlayed, "GetMusicTimePlayed"); 620 621 // AudioStream management functions 622 lib.bind(&LoadAudioStream, "LoadAudioStream"); 623 lib.bind(&UnloadAudioStream, "UnloadAudioStream"); 624 lib.bind(&UpdateAudioStream, "UpdateAudioStream"); 625 lib.bind(&IsAudioStreamProcessed, "IsAudioStreamProcessed"); 626 lib.bind(&PlayAudioStream, "PlayAudioStream"); 627 lib.bind(&PauseAudioStream, "PauseAudioStream"); 628 lib.bind(&ResumeAudioStream, "ResumeAudioStream"); 629 lib.bind(&IsAudioStreamPlaying, "IsAudioStreamPlaying"); 630 lib.bind(&StopAudioStream, "StopAudioStream"); 631 lib.bind(&SetAudioStreamVolume, "SetAudioStreamVolume"); 632 lib.bind(&SetAudioStreamPitch, "SetAudioStreamPitch"); 633 lib.bind(&SetAudioStreamBufferSizeDefault, "SetAudioStreamBufferSizeDefault"); 634 } 635 636 @nogc nothrow __gshared extern(C): 637 638 /********************************************************************************************** 639 * 640 * raylib v4.0 - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) 641 * 642 * FEATURES: 643 * - NO external dependencies, all required libraries included with raylib 644 * - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, 645 * MacOS, Haiku, Android, Raspberry Pi, DRM native, HTML5. 646 * - Written in plain C code (C99) in PascalCase/camelCase notation 647 * - Hardware accelerated with OpenGL (1.1, 2.1, 3.3, 4.3 or ES2 - choose at compile) 648 * - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] 649 * - Multiple Fonts formats supported (TTF, XNA fonts, AngelCode fonts) 650 * - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC) 651 * - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more! 652 * - Flexible Materials system, supporting classic maps and PBR maps 653 * - Animated 3D models supported (skeletal bones animation) (IQM) 654 * - Shaders support, including Model shaders and Postprocessing shaders 655 * - Powerful math module for Vector, Matrix and Quaternion operations: [raymath] 656 * - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD) 657 * - VR stereo rendering with configurable HMD device parameters 658 * - Bindings to multiple programming languages available! 659 * 660 * NOTES: 661 * - One default Font is loaded on InitWindow()->LoadFontDefault() [core, text] 662 * - One default Texture2D is loaded on rlglInit(), 1x1 white pixel R8G8B8A8 [rlgl] (OpenGL 3.3 or ES2) 663 * - One default Shader is loaded on rlglInit()->rlLoadShaderDefault() [rlgl] (OpenGL 3.3 or ES2) 664 * - One default RenderBatch is loaded on rlglInit()->rlLoadRenderBatch() [rlgl] (OpenGL 3.3 or ES2) 665 * 666 * DEPENDENCIES (included): 667 * [rcore] rglfw (Camilla Löwy - github.com/glfw/glfw) for window/context management and input (PLATFORM_DESKTOP) 668 * [rlgl] glad (David Herberth - github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading (PLATFORM_DESKTOP) 669 * [raudio] miniaudio (David Reid - github.com/mackron/miniaudio) for audio device/context management 670 * 671 * OPTIONAL DEPENDENCIES (included): 672 * [rcore] msf_gif (Miles Fogle) for GIF recording 673 * [rcore] sinfl (Micha Mettke) for DEFLATE decompression algorythm 674 * [rcore] sdefl (Micha Mettke) for DEFLATE compression algorythm 675 * [rtextures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...) 676 * [rtextures] stb_image_write (Sean Barret) for image writing (BMP, TGA, PNG, JPG) 677 * [rtextures] stb_image_resize (Sean Barret) for image resizing algorithms 678 * [rtext] stb_truetype (Sean Barret) for ttf fonts loading 679 * [rtext] stb_rect_pack (Sean Barret) for rectangles packing 680 * [rmodels] par_shapes (Philip Rideout) for parametric 3d shapes generation 681 * [rmodels] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL) 682 * [rmodels] cgltf (Johannes Kuhlmann) for models loading (glTF) 683 * [raudio] dr_wav (David Reid) for WAV audio file loading 684 * [raudio] dr_flac (David Reid) for FLAC audio file loading 685 * [raudio] dr_mp3 (David Reid) for MP3 audio file loading 686 * [raudio] stb_vorbis (Sean Barret) for OGG audio loading 687 * [raudio] jar_xm (Joshua Reisenauer) for XM audio module loading 688 * [raudio] jar_mod (Joshua Reisenauer) for MOD audio module loading 689 * 690 * 691 * LICENSE: zlib/libpng 692 * 693 * raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, 694 * BSD-like license that allows static linking with closed source software: 695 * 696 * Copyright (c) 2013-2021 Ramon Santamaria (@raysan5) 697 * 698 * This software is provided "as-is", without any express or implied warranty. In no event 699 * will the authors be held liable for any damages arising from the use of this software. 700 * 701 * Permission is granted to anyone to use this software for any purpose, including commercial 702 * applications, and to alter it and redistribute it freely, subject to the following restrictions: 703 * 704 * 1. The origin of this software must not be misrepresented; you must not claim that you 705 * wrote the original software. If you use this software in a product, an acknowledgment 706 * in the product documentation would be appreciated but is not required. 707 * 708 * 2. Altered source versions must be plainly marked as such, and must not be misrepresented 709 * as being the original software. 710 * 711 * 3. This notice may not be removed or altered from any source distribution. 712 * 713 **********************************************************************************************/ 714 715 import core.stdc.stdarg; // Required for: va_list - Only used by TraceLogCallback 716 717 enum RAYLIB_VERSION = "4.0"; 718 719 //---------------------------------------------------------------------------------- 720 // Some basic Defines 721 //---------------------------------------------------------------------------------- 722 enum PI = 3.14159265358979323846f; 723 enum DEG2RAD = (PI/180.0f); 724 enum RAD2DEG = (180.0f/PI); 725 726 // Some Basic Colors 727 // NOTE: Custom raylib color palette for amazing visuals on WHITE background 728 const Color LIGHTGRAY = Color(200, 200, 200, 255); // Light Gray 729 const Color GRAY = Color(130, 130, 130, 255); // Gray 730 const Color DARKGRAY = Color( 80, 80, 80, 255); // Dark Gray 731 const Color YELLOW = Color(253, 249, 0, 255); // Yellow 732 const Color GOLD = Color(255, 203, 0, 255); // Gold 733 const Color ORANGE = Color(255, 161, 0, 255); // Orange 734 const Color PINK = Color(255, 109, 194, 255); // Pink 735 const Color RED = Color(230, 41, 55, 255); // Red 736 const Color MAROON = Color(190, 33, 55, 255); // Maroon 737 const Color GREEN = Color( 0, 228, 48, 255); // Green 738 const Color LIME = Color( 0, 158, 47, 255); // Lime 739 const Color DARKGREEN = Color( 0, 117, 44, 255); // Dark Green 740 const Color SKYBLUE = Color(102, 191, 255, 255); // Sky Blue 741 const Color BLUE = Color( 0, 121, 241, 255); // Blue 742 const Color DARKBLUE = Color( 0, 82, 172, 255); // Dark Blue 743 const Color PURPLE = Color(200, 122, 255, 255); // Purple 744 const Color VIOLET = Color(135, 60, 190, 255); // Violet 745 const Color DARKPURPLE = Color(112, 31, 126, 255); // Dark Purple 746 const Color BEIGE = Color(211, 176, 131, 255); // Beige 747 const Color BROWN = Color(127, 106, 79, 255); // Brown 748 const Color DARKBROWN = Color( 76, 63, 47, 255); // Dark Brown 749 750 const Color WHITE = Color(255, 255, 255, 255); // White 751 const Color BLACK = Color( 0, 0, 0, 255); // Black 752 const Color BLANK = Color( 0, 0, 0, 0); // Blank (Transparent) 753 const Color MAGENTA = Color(255, 0, 255, 255); // Magenta 754 const Color RAYWHITE = Color(245, 245, 245, 255); // My own White (raylib logo) 755 756 //---------------------------------------------------------------------------------- 757 // Structures Definition 758 //---------------------------------------------------------------------------------- 759 760 // Vector2, 2 components 761 struct Vector2 { 762 float x; // Vector x component 763 float y; // Vector y component 764 } 765 766 // Vector3, 3 components 767 struct Vector3 { 768 float x; // Vector x component 769 float y; // Vector y component 770 float z; // Vector z component 771 } 772 773 // Vector4, 4 components 774 struct Vector4 { 775 float x; // Vector x component 776 float y; // Vector y component 777 float z; // Vector z component 778 float w; // Vector w component 779 } 780 781 // Quaternion, 4 components (Vector4 alias) 782 alias Quaternion = Vector4; 783 784 // Matrix, 4x4 components, column major, OpenGL style, right handed 785 struct Matrix { 786 float m0, m4, m8, m12; // Matrix first row (4 components) 787 float m1, m5, m9, m13; // Matrix second row (4 components) 788 float m2, m6, m10, m14; // Matrix third row (4 components) 789 float m3, m7, m11, m15; // Matrix fourth row (4 components) 790 } 791 792 // Color, 4 components, R8G8B8A8 (32bit) 793 struct Color { 794 ubyte r; // Color red value 795 ubyte g; // Color green value 796 ubyte b; // Color blue value 797 ubyte a; // Color alpha value 798 } 799 800 // Rectangle, 4 components 801 struct Rectangle { 802 float x; // Rectangle top-left corner position x 803 float y; // Rectangle top-left corner position y 804 float width; // Rectangle width 805 float height; // Rectangle height 806 } 807 808 // Image, pixel data stored in CPU memory (RAM) 809 struct Image { 810 void* data; // Image raw data 811 int width; // Image base width 812 int height; // Image base height 813 int mipmaps; // Mipmap levels, 1 by default 814 int format; // Data format (PixelFormat type) 815 } 816 817 // Texture, tex data stored in GPU memory (VRAM) 818 struct Texture { 819 uint id; // OpenGL texture id 820 int width; // Texture base width 821 int height; // Texture base height 822 int mipmaps; // Mipmap levels, 1 by default 823 int format; // Data format (PixelFormat type) 824 } 825 826 // Texture2D, same as Texture 827 alias Texture2D = Texture; 828 829 // TextureCubemap, same as Texture 830 alias TextureCubemap = Texture; 831 832 // RenderTexture, fbo for texture rendering 833 struct RenderTexture { 834 uint id; // OpenGL framebuffer object id 835 Texture texture; // Color buffer attachment texture 836 Texture depth; // Depth buffer attachment texture 837 } 838 839 // RenderTexture2D, same as RenderTexture 840 alias RenderTexture2D = RenderTexture; 841 842 // NPatchInfo, n-patch layout info 843 struct NPatchInfo { 844 Rectangle source; // Texture source rectangle 845 int left; // Left border offset 846 int top; // Top border offset 847 int right; // Right border offset 848 int bottom; // Bottom border offset 849 int layout; // Layout of the n-patch: 3x3, 1x3 or 3x1 850 } 851 852 // GlyphInfo, font characters glyphs info 853 struct GlyphInfo { 854 int value; // Character value (Unicode) 855 int offsetX; // Character offset X when drawing 856 int offsetY; // Character offset Y when drawing 857 int advanceX; // Character advance position X 858 Image image; // Character image data 859 } 860 861 // Font, font texture and GlyphInfo array data 862 struct Font { 863 int baseSize; // Base size (default chars height) 864 int glyphCount; // Number of glyph characters 865 int glyphPadding; // Padding around the glyph characters 866 Texture2D texture; // Texture atlas containing the glyphs 867 Rectangle* recs; // Rectangles in texture for the glyphs 868 GlyphInfo* glyphs; // Glyphs info data 869 } 870 871 // Camera, defines position/orientation in 3d space 872 struct Camera3D { 873 Vector3 position; // Camera position 874 Vector3 target; // Camera target it looks-at 875 Vector3 up; // Camera up vector (rotation over its axis) 876 float fovy; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic 877 int projection; // Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC 878 } 879 880 alias Camera = Camera3D; // Camera type fallback, defaults to Camera3D 881 882 // Camera2D, defines position/orientation in 2d space 883 struct Camera2D { 884 Vector2 offset; // Camera offset (displacement from target) 885 Vector2 target; // Camera target (rotation and zoom origin) 886 float rotation; // Camera rotation in degrees 887 float zoom; // Camera zoom (scaling), should be 1.0f by default 888 } 889 890 // Mesh, vertex data and vao/vbo 891 struct Mesh { 892 int vertexCount; // Number of vertices stored in arrays 893 int triangleCount; // Number of triangles stored (indexed or not) 894 895 // Vertex attributes data 896 float* vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) 897 float* texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) 898 float* texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) 899 float* normals; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) 900 float* tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) 901 ubyte* colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) 902 ushort* indices; // Vertex indices (in case vertex data comes indexed) 903 904 // Animation vertex data 905 float* animVertices; // Animated vertex positions (after bones transformations) 906 float* animNormals; // Animated normals (after bones transformations) 907 ubyte* boneIds; // Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) 908 float* boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning) 909 910 // OpenGL identifiers 911 uint vaoId; // OpenGL Vertex Array Object id 912 uint* vboId; // OpenGL Vertex Buffer Objects id (default vertex data) 913 } 914 915 // Shader 916 struct Shader { 917 uint id; // Shader program id 918 int* locs; // Shader locations array (RL_MAX_SHADER_LOCATIONS) 919 } 920 921 // MaterialMap 922 struct MaterialMap { 923 Texture2D texture; // Material map texture 924 Color color; // Material map color 925 float value; // Material map value 926 } 927 928 // Material, includes shader and maps 929 struct Material { 930 Shader shader; // Material shader 931 MaterialMap* maps; // Material maps array (MAX_MATERIAL_MAPS) 932 float[4] params; // Material generic parameters (if required) 933 } 934 935 // Transform, vectex transformation data 936 struct Transform { 937 Vector3 translation; // Translation 938 Quaternion rotation; // Rotation 939 Vector3 scale; // Scale 940 } 941 942 // Bone, skeletal animation bone 943 struct BoneInfo { 944 char[32] name; // Bone name 945 int parent; // Bone parent 946 } 947 948 // Model, meshes, materials and animation data 949 struct Model { 950 Matrix transform; // Local transform matrix 951 952 int meshCount; // Number of meshes 953 int materialCount; // Number of materials 954 Mesh* meshes; // Meshes array 955 Material* materials; // Materials array 956 int* meshMaterial; // Mesh material number 957 958 // Animation data 959 int boneCount; // Number of bones 960 BoneInfo* bones; // Bones information (skeleton) 961 Transform* bindPose; // Bones base transformation (pose) 962 } 963 964 // ModelAnimation 965 struct ModelAnimation { 966 int boneCount; // Number of bones 967 int frameCount; // Number of animation frames 968 BoneInfo* bones; // Bones information (skeleton) 969 Transform** framePoses; // Poses array by frame 970 } 971 972 // Ray, ray for raycasting 973 struct Ray { 974 Vector3 position; // Ray position (origin) 975 Vector3 direction; // Ray direction 976 } 977 978 // RayCollision, ray hit information 979 struct RayCollision { 980 bool hit; // Did the ray hit something? 981 float distance; // Distance to nearest hit 982 Vector3 point; // Point of nearest hit 983 Vector3 normal; // Surface normal of hit 984 } 985 986 // BoundingBox 987 struct BoundingBox { 988 Vector3 min; // Minimum vertex box-corner 989 Vector3 max; // Maximum vertex box-corner 990 } 991 992 // Wave, audio wave data 993 struct Wave { 994 uint frameCount; // Total number of frames (considering channels) 995 uint sampleRate; // Frequency (samples per second) 996 uint sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) 997 uint channels; // Number of channels (1-mono, 2-stereo, ...) 998 void* data; // Buffer data pointer 999 } 1000 1001 struct rAudioBuffer; 1002 1003 // AudioStream, custom audio stream 1004 struct AudioStream { 1005 rAudioBuffer* buffer; // Pointer to internal data used by the audio system 1006 1007 uint sampleRate; // Frequency (samples per second) 1008 uint sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) 1009 uint channels; // Number of channels (1-mono, 2-stereo, ...) 1010 } 1011 1012 // Sound 1013 struct Sound { 1014 AudioStream stream; // Audio stream 1015 uint frameCount; // Total number of frames (considering channels) 1016 } 1017 1018 // Music, audio stream, anything longer than ~10 seconds should be streamed 1019 struct Music { 1020 AudioStream stream; // Audio stream 1021 uint frameCount; // Total number of frames (considering channels) 1022 bool looping; // Music looping enable 1023 1024 int ctxType; // Type of music context (audio filetype) 1025 void* ctxData; // Audio context data, depends on type 1026 } 1027 1028 // VrDeviceInfo, Head-Mounted-Display device parameters 1029 struct VrDeviceInfo { 1030 int hResolution; // Horizontal resolution in pixels 1031 int vResolution; // Vertical resolution in pixels 1032 float hScreenSize; // Horizontal size in meters 1033 float vScreenSize; // Vertical size in meters 1034 float vScreenCenter; // Screen center in meters 1035 float eyeToScreenDistance; // Distance between eye and display in meters 1036 float lensSeparationDistance; // Lens separation distance in meters 1037 float interpupillaryDistance; // IPD (distance between pupils) in meters 1038 float[4] lensDistortionValues; // Lens distortion constant parameters 1039 float[4] chromaAbCorrection; // Chromatic aberration correction parameters 1040 } 1041 1042 // VrStereoConfig, VR stereo rendering configuration for simulator 1043 struct VrStereoConfig { 1044 Matrix[2] projection; // VR projection matrices (per eye) 1045 Matrix[2] viewOffset; // VR view offset matrices (per eye) 1046 float[2] leftLensCenter; // VR left lens center 1047 float[2] rightLensCenter; // VR right lens center 1048 float[2] leftScreenCenter; // VR left screen center 1049 float[2] rightScreenCenter; // VR right screen center 1050 float[2] scale; // VR distortion scale 1051 float[2] scaleIn; // VR distortion scale in 1052 } 1053 1054 //---------------------------------------------------------------------------------- 1055 // Enumerators Definition 1056 //---------------------------------------------------------------------------------- 1057 1058 // System/Window config flags 1059 // NOTE: Every bit registers one state (use it with bit masks) 1060 // By default all flags are set to 0 1061 enum ConfigFlags { 1062 FLAG_VSYNC_HINT = 0x00000040, // Set to try enabling V-Sync on GPU 1063 FLAG_FULLSCREEN_MODE = 0x00000002, // Set to run program in fullscreen 1064 FLAG_WINDOW_RESIZABLE = 0x00000004, // Set to allow resizable window 1065 FLAG_WINDOW_UNDECORATED = 0x00000008, // Set to disable window decoration (frame and buttons) 1066 FLAG_WINDOW_HIDDEN = 0x00000080, // Set to hide window 1067 FLAG_WINDOW_MINIMIZED = 0x00000200, // Set to minimize window (iconify) 1068 FLAG_WINDOW_MAXIMIZED = 0x00000400, // Set to maximize window (expanded to monitor) 1069 FLAG_WINDOW_UNFOCUSED = 0x00000800, // Set to window non focused 1070 FLAG_WINDOW_TOPMOST = 0x00001000, // Set to window always on top 1071 FLAG_WINDOW_ALWAYS_RUN = 0x00000100, // Set to allow windows running while minimized 1072 FLAG_WINDOW_TRANSPARENT = 0x00000010, // Set to allow transparent framebuffer 1073 FLAG_WINDOW_HIGHDPI = 0x00002000, // Set to support HighDPI 1074 FLAG_MSAA_4X_HINT = 0x00000020, // Set to try enabling MSAA 4X 1075 FLAG_INTERLACED_HINT = 0x00010000 // Set to try enabling interlaced video format (for V3D) 1076 } mixin(expandEnum!ConfigFlags); 1077 1078 // Trace log level 1079 // NOTE: Organized by priority level 1080 enum TraceLogLevel { 1081 LOG_ALL = 0, // Display all logs 1082 LOG_TRACE, // Trace logging, intended for internal use only 1083 LOG_DEBUG, // Debug logging, used for internal debugging, it should be disabled on release builds 1084 LOG_INFO, // Info logging, used for program execution info 1085 LOG_WARNING, // Warning logging, used on recoverable failures 1086 LOG_ERROR, // Error logging, used on unrecoverable failures 1087 LOG_FATAL, // Fatal logging, used to abort program: exit(EXIT_FAILURE) 1088 LOG_NONE // Disable logging 1089 } mixin(expandEnum!TraceLogLevel); 1090 1091 // Keyboard keys (US keyboard layout) 1092 // NOTE: Use GetKeyPressed() to allow redefining 1093 // required keys for alternative layouts 1094 enum KeyboardKey { 1095 KEY_NULL = 0, // Key: NULL, used for no key pressed 1096 1097 // Alphanumeric keys 1098 KEY_APOSTROPHE = 39, // Key: ' 1099 KEY_COMMA = 44, // Key: , 1100 KEY_MINUS = 45, // Key: - 1101 KEY_PERIOD = 46, // Key: . 1102 KEY_SLASH = 47, // Key: / 1103 KEY_ZERO = 48, // Key: 0 1104 KEY_ONE = 49, // Key: 1 1105 KEY_TWO = 50, // Key: 2 1106 KEY_THREE = 51, // Key: 3 1107 KEY_FOUR = 52, // Key: 4 1108 KEY_FIVE = 53, // Key: 5 1109 KEY_SIX = 54, // Key: 6 1110 KEY_SEVEN = 55, // Key: 7 1111 KEY_EIGHT = 56, // Key: 8 1112 KEY_NINE = 57, // Key: 9 1113 KEY_SEMICOLON = 59, // Key: ; 1114 KEY_EQUAL = 61, // Key: = 1115 KEY_A = 65, // Key: A | a 1116 KEY_B = 66, // Key: B | b 1117 KEY_C = 67, // Key: C | c 1118 KEY_D = 68, // Key: D | d 1119 KEY_E = 69, // Key: E | e 1120 KEY_F = 70, // Key: F | f 1121 KEY_G = 71, // Key: G | g 1122 KEY_H = 72, // Key: H | h 1123 KEY_I = 73, // Key: I | i 1124 KEY_J = 74, // Key: J | j 1125 KEY_K = 75, // Key: K | k 1126 KEY_L = 76, // Key: L | l 1127 KEY_M = 77, // Key: M | m 1128 KEY_N = 78, // Key: N | n 1129 KEY_O = 79, // Key: O | o 1130 KEY_P = 80, // Key: P | p 1131 KEY_Q = 81, // Key: Q | q 1132 KEY_R = 82, // Key: R | r 1133 KEY_S = 83, // Key: S | s 1134 KEY_T = 84, // Key: T | t 1135 KEY_U = 85, // Key: U | u 1136 KEY_V = 86, // Key: V | v 1137 KEY_W = 87, // Key: W | w 1138 KEY_X = 88, // Key: X | x 1139 KEY_Y = 89, // Key: Y | y 1140 KEY_Z = 90, // Key: Z | z 1141 KEY_LEFT_BRACKET = 91, // Key: [ 1142 KEY_BACKSLASH = 92, // Key: '\' 1143 KEY_RIGHT_BRACKET = 93, // Key: ] 1144 KEY_GRAVE = 96, // Key: ` 1145 1146 // Function keys 1147 KEY_SPACE = 32, // Key: Space 1148 KEY_ESCAPE = 256, // Key: Esc 1149 KEY_ENTER = 257, // Key: Enter 1150 KEY_TAB = 258, // Key: Tab 1151 KEY_BACKSPACE = 259, // Key: Backspace 1152 KEY_INSERT = 260, // Key: Ins 1153 KEY_DELETE = 261, // Key: Del 1154 KEY_RIGHT = 262, // Key: Cursor right 1155 KEY_LEFT = 263, // Key: Cursor left 1156 KEY_DOWN = 264, // Key: Cursor down 1157 KEY_UP = 265, // Key: Cursor up 1158 KEY_PAGE_UP = 266, // Key: Page up 1159 KEY_PAGE_DOWN = 267, // Key: Page down 1160 KEY_HOME = 268, // Key: Home 1161 KEY_END = 269, // Key: End 1162 KEY_CAPS_LOCK = 280, // Key: Caps lock 1163 KEY_SCROLL_LOCK = 281, // Key: Scroll down 1164 KEY_NUM_LOCK = 282, // Key: Num lock 1165 KEY_PRINT_SCREEN = 283, // Key: Print screen 1166 KEY_PAUSE = 284, // Key: Pause 1167 KEY_F1 = 290, // Key: F1 1168 KEY_F2 = 291, // Key: F2 1169 KEY_F3 = 292, // Key: F3 1170 KEY_F4 = 293, // Key: F4 1171 KEY_F5 = 294, // Key: F5 1172 KEY_F6 = 295, // Key: F6 1173 KEY_F7 = 296, // Key: F7 1174 KEY_F8 = 297, // Key: F8 1175 KEY_F9 = 298, // Key: F9 1176 KEY_F10 = 299, // Key: F10 1177 KEY_F11 = 300, // Key: F11 1178 KEY_F12 = 301, // Key: F12 1179 KEY_LEFT_SHIFT = 340, // Key: Shift left 1180 KEY_LEFT_CONTROL = 341, // Key: Control left 1181 KEY_LEFT_ALT = 342, // Key: Alt left 1182 KEY_LEFT_SUPER = 343, // Key: Super left 1183 KEY_RIGHT_SHIFT = 344, // Key: Shift right 1184 KEY_RIGHT_CONTROL = 345, // Key: Control right 1185 KEY_RIGHT_ALT = 346, // Key: Alt right 1186 KEY_RIGHT_SUPER = 347, // Key: Super right 1187 KEY_KB_MENU = 348, // Key: KB menu 1188 1189 // Keypad keys 1190 KEY_KP_0 = 320, // Key: Keypad 0 1191 KEY_KP_1 = 321, // Key: Keypad 1 1192 KEY_KP_2 = 322, // Key: Keypad 2 1193 KEY_KP_3 = 323, // Key: Keypad 3 1194 KEY_KP_4 = 324, // Key: Keypad 4 1195 KEY_KP_5 = 325, // Key: Keypad 5 1196 KEY_KP_6 = 326, // Key: Keypad 6 1197 KEY_KP_7 = 327, // Key: Keypad 7 1198 KEY_KP_8 = 328, // Key: Keypad 8 1199 KEY_KP_9 = 329, // Key: Keypad 9 1200 KEY_KP_DECIMAL = 330, // Key: Keypad . 1201 KEY_KP_DIVIDE = 331, // Key: Keypad / 1202 KEY_KP_MULTIPLY = 332, // Key: Keypad* 1203 KEY_KP_SUBTRACT = 333, // Key: Keypad - 1204 KEY_KP_ADD = 334, // Key: Keypad + 1205 KEY_KP_ENTER = 335, // Key: Keypad Enter 1206 KEY_KP_EQUAL = 336, // Key: Keypad = 1207 1208 // Android key buttons 1209 KEY_BACK = 4, // Key: Android back button 1210 KEY_MENU = 82, // Key: Android menu button 1211 KEY_VOLUME_UP = 24, // Key: Android volume up button 1212 KEY_VOLUME_DOWN = 25 // Key: Android volume down button 1213 } mixin(expandEnum!KeyboardKey); 1214 1215 // Mouse buttons 1216 enum MouseButton { 1217 MOUSE_BUTTON_LEFT = 0, // Mouse button left 1218 MOUSE_BUTTON_RIGHT = 1, // Mouse button right 1219 MOUSE_BUTTON_MIDDLE = 2, // Mouse button middle (pressed wheel) 1220 MOUSE_BUTTON_SIDE = 3, // Mouse button side (advanced mouse device) 1221 MOUSE_BUTTON_EXTRA = 4, // Mouse button extra (advanced mouse device) 1222 MOUSE_BUTTON_FORWARD = 5, // Mouse button fordward (advanced mouse device) 1223 MOUSE_BUTTON_BACK = 6, // Mouse button back (advanced mouse device) 1224 } mixin(expandEnum!MouseButton); 1225 1226 // Add backwards compatibility support for deprecated names 1227 alias MOUSE_LEFT_BUTTON = MOUSE_BUTTON_LEFT; 1228 alias MOUSE_RIGHT_BUTTON = MOUSE_BUTTON_RIGHT; 1229 alias MOUSE_MIDDLE_BUTTON = MOUSE_BUTTON_MIDDLE; 1230 1231 // Mouse cursor 1232 enum MouseCursor { 1233 MOUSE_CURSOR_DEFAULT = 0, // Default pointer shape 1234 MOUSE_CURSOR_ARROW = 1, // Arrow shape 1235 MOUSE_CURSOR_IBEAM = 2, // Text writing cursor shape 1236 MOUSE_CURSOR_CROSSHAIR = 3, // Cross shape 1237 MOUSE_CURSOR_POINTING_HAND = 4, // Pointing hand cursor 1238 MOUSE_CURSOR_RESIZE_EW = 5, // Horizontal resize/move arrow shape 1239 MOUSE_CURSOR_RESIZE_NS = 6, // Vertical resize/move arrow shape 1240 MOUSE_CURSOR_RESIZE_NWSE = 7, // Top-left to bottom-right diagonal resize/move arrow shape 1241 MOUSE_CURSOR_RESIZE_NESW = 8, // The top-right to bottom-left diagonal resize/move arrow shape 1242 MOUSE_CURSOR_RESIZE_ALL = 9, // The omni-directional resize/move cursor shape 1243 MOUSE_CURSOR_NOT_ALLOWED = 10 // The operation-not-allowed shape 1244 } mixin(expandEnum!MouseCursor); 1245 1246 // Gamepad buttons 1247 enum GamepadButton { 1248 GAMEPAD_BUTTON_UNKNOWN = 0, // Unknown button, just for error checking 1249 GAMEPAD_BUTTON_LEFT_FACE_UP, // Gamepad left DPAD up button 1250 GAMEPAD_BUTTON_LEFT_FACE_RIGHT, // Gamepad left DPAD right button 1251 GAMEPAD_BUTTON_LEFT_FACE_DOWN, // Gamepad left DPAD down button 1252 GAMEPAD_BUTTON_LEFT_FACE_LEFT, // Gamepad left DPAD left button 1253 GAMEPAD_BUTTON_RIGHT_FACE_UP, // Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) 1254 GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, // Gamepad right button right (i.e. PS3: Square, Xbox: X) 1255 GAMEPAD_BUTTON_RIGHT_FACE_DOWN, // Gamepad right button down (i.e. PS3: Cross, Xbox: A) 1256 GAMEPAD_BUTTON_RIGHT_FACE_LEFT, // Gamepad right button left (i.e. PS3: Circle, Xbox: B) 1257 GAMEPAD_BUTTON_LEFT_TRIGGER_1, // Gamepad top/back trigger left (first), it could be a trailing button 1258 GAMEPAD_BUTTON_LEFT_TRIGGER_2, // Gamepad top/back trigger left (second), it could be a trailing button 1259 GAMEPAD_BUTTON_RIGHT_TRIGGER_1, // Gamepad top/back trigger right (one), it could be a trailing button 1260 GAMEPAD_BUTTON_RIGHT_TRIGGER_2, // Gamepad top/back trigger right (second), it could be a trailing button 1261 GAMEPAD_BUTTON_MIDDLE_LEFT, // Gamepad center buttons, left one (i.e. PS3: Select) 1262 GAMEPAD_BUTTON_MIDDLE, // Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX) 1263 GAMEPAD_BUTTON_MIDDLE_RIGHT, // Gamepad center buttons, right one (i.e. PS3: Start) 1264 GAMEPAD_BUTTON_LEFT_THUMB, // Gamepad joystick pressed button left 1265 GAMEPAD_BUTTON_RIGHT_THUMB // Gamepad joystick pressed button right 1266 } mixin(expandEnum!GamepadButton); 1267 1268 // Gamepad axis 1269 enum GamepadAxis { 1270 GAMEPAD_AXIS_LEFT_X = 0, // Gamepad left stick X axis 1271 GAMEPAD_AXIS_LEFT_Y = 1, // Gamepad left stick Y axis 1272 GAMEPAD_AXIS_RIGHT_X = 2, // Gamepad right stick X axis 1273 GAMEPAD_AXIS_RIGHT_Y = 3, // Gamepad right stick Y axis 1274 GAMEPAD_AXIS_LEFT_TRIGGER = 4, // Gamepad back trigger left, pressure level: [1..-1] 1275 GAMEPAD_AXIS_RIGHT_TRIGGER = 5 // Gamepad back trigger right, pressure level: [1..-1] 1276 } mixin(expandEnum!GamepadAxis); 1277 1278 // Material map index 1279 enum MaterialMapIndex { 1280 MATERIAL_MAP_ALBEDO = 0, // Albedo material (same as: MATERIAL_MAP_DIFFUSE) 1281 MATERIAL_MAP_METALNESS, // Metalness material (same as: MATERIAL_MAP_SPECULAR) 1282 MATERIAL_MAP_NORMAL, // Normal material 1283 MATERIAL_MAP_ROUGHNESS, // Roughness material 1284 MATERIAL_MAP_OCCLUSION, // Ambient occlusion material 1285 MATERIAL_MAP_EMISSION, // Emission material 1286 MATERIAL_MAP_HEIGHT, // Heightmap material 1287 MATERIAL_MAP_CUBEMAP, // Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) 1288 MATERIAL_MAP_IRRADIANCE, // Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) 1289 MATERIAL_MAP_PREFILTER, // Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) 1290 MATERIAL_MAP_BRDF // Brdf material 1291 } mixin(expandEnum!MaterialMapIndex); 1292 1293 alias MATERIAL_MAP_DIFFUSE = MATERIAL_MAP_ALBEDO; 1294 alias MATERIAL_MAP_SPECULAR = MATERIAL_MAP_METALNESS; 1295 1296 // Shader location index 1297 enum ShaderLocationIndex { 1298 SHADER_LOC_VERTEX_POSITION = 0, // Shader location: vertex attribute: position 1299 SHADER_LOC_VERTEX_TEXCOORD01, // Shader location: vertex attribute: texcoord01 1300 SHADER_LOC_VERTEX_TEXCOORD02, // Shader location: vertex attribute: texcoord02 1301 SHADER_LOC_VERTEX_NORMAL, // Shader location: vertex attribute: normal 1302 SHADER_LOC_VERTEX_TANGENT, // Shader location: vertex attribute: tangent 1303 SHADER_LOC_VERTEX_COLOR, // Shader location: vertex attribute: color 1304 SHADER_LOC_MATRIX_MVP, // Shader location: matrix uniform: model-view-projection 1305 SHADER_LOC_MATRIX_VIEW, // Shader location: matrix uniform: view (camera transform) 1306 SHADER_LOC_MATRIX_PROJECTION, // Shader location: matrix uniform: projection 1307 SHADER_LOC_MATRIX_MODEL, // Shader location: matrix uniform: model (transform) 1308 SHADER_LOC_MATRIX_NORMAL, // Shader location: matrix uniform: normal 1309 SHADER_LOC_VECTOR_VIEW, // Shader location: vector uniform: view 1310 SHADER_LOC_COLOR_DIFFUSE, // Shader location: vector uniform: diffuse color 1311 SHADER_LOC_COLOR_SPECULAR, // Shader location: vector uniform: specular color 1312 SHADER_LOC_COLOR_AMBIENT, // Shader location: vector uniform: ambient color 1313 SHADER_LOC_MAP_ALBEDO, // Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE) 1314 SHADER_LOC_MAP_METALNESS, // Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR) 1315 SHADER_LOC_MAP_NORMAL, // Shader location: sampler2d texture: normal 1316 SHADER_LOC_MAP_ROUGHNESS, // Shader location: sampler2d texture: roughness 1317 SHADER_LOC_MAP_OCCLUSION, // Shader location: sampler2d texture: occlusion 1318 SHADER_LOC_MAP_EMISSION, // Shader location: sampler2d texture: emission 1319 SHADER_LOC_MAP_HEIGHT, // Shader location: sampler2d texture: height 1320 SHADER_LOC_MAP_CUBEMAP, // Shader location: samplerCube texture: cubemap 1321 SHADER_LOC_MAP_IRRADIANCE, // Shader location: samplerCube texture: irradiance 1322 SHADER_LOC_MAP_PREFILTER, // Shader location: samplerCube texture: prefilter 1323 SHADER_LOC_MAP_BRDF // Shader location: sampler2d texture: brdf 1324 } mixin(expandEnum!ShaderLocationIndex); 1325 1326 alias SHADER_LOC_MAP_DIFFUSE = SHADER_LOC_MAP_ALBEDO; 1327 alias SHADER_LOC_MAP_SPECULAR = SHADER_LOC_MAP_METALNESS; 1328 1329 // Shader uniform data type 1330 enum ShaderUniformDataType { 1331 SHADER_UNIFORM_FLOAT = 0, // Shader uniform type: float 1332 SHADER_UNIFORM_VEC2, // Shader uniform type: vec2 (2 float) 1333 SHADER_UNIFORM_VEC3, // Shader uniform type: vec3 (3 float) 1334 SHADER_UNIFORM_VEC4, // Shader uniform type: vec4 (4 float) 1335 SHADER_UNIFORM_INT, // Shader uniform type: int 1336 SHADER_UNIFORM_IVEC2, // Shader uniform type: ivec2 (2 int) 1337 SHADER_UNIFORM_IVEC3, // Shader uniform type: ivec3 (3 int) 1338 SHADER_UNIFORM_IVEC4, // Shader uniform type: ivec4 (4 int) 1339 SHADER_UNIFORM_SAMPLER2D // Shader uniform type: sampler2d 1340 } mixin(expandEnum!ShaderUniformDataType); 1341 1342 // Shader attribute data types 1343 enum ShaderAttributeDataType { 1344 SHADER_ATTRIB_FLOAT = 0, // Shader attribute type: float 1345 SHADER_ATTRIB_VEC2, // Shader attribute type: vec2 (2 float) 1346 SHADER_ATTRIB_VEC3, // Shader attribute type: vec3 (3 float) 1347 SHADER_ATTRIB_VEC4 // Shader attribute type: vec4 (4 float) 1348 } mixin(expandEnum!ShaderAttributeDataType); 1349 1350 // Pixel formats 1351 // NOTE: Support depends on OpenGL version and platform 1352 enum PixelFormat { 1353 PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) 1354 PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels) 1355 PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp 1356 PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp 1357 PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) 1358 PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha) 1359 PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, // 32 bpp 1360 PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float) 1361 PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float) 1362 PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float) 1363 PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha) 1364 PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha) 1365 PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp 1366 PIXELFORMAT_COMPRESSED_DXT5_RGBA, // 8 bpp 1367 PIXELFORMAT_COMPRESSED_ETC1_RGB, // 4 bpp 1368 PIXELFORMAT_COMPRESSED_ETC2_RGB, // 4 bpp 1369 PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, // 8 bpp 1370 PIXELFORMAT_COMPRESSED_PVRT_RGB, // 4 bpp 1371 PIXELFORMAT_COMPRESSED_PVRT_RGBA, // 4 bpp 1372 PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, // 8 bpp 1373 PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA // 2 bpp 1374 } mixin(expandEnum!PixelFormat); 1375 1376 // Texture parameters: filter mode 1377 // NOTE 1: Filtering considers mipmaps if available in the texture 1378 // NOTE 2: Filter is accordingly set for minification and magnification 1379 enum TextureFilter { 1380 TEXTURE_FILTER_POINT = 0, // No filter, just pixel aproximation 1381 TEXTURE_FILTER_BILINEAR, // Linear filtering 1382 TEXTURE_FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) 1383 TEXTURE_FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x 1384 TEXTURE_FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x 1385 TEXTURE_FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x 1386 } mixin(expandEnum!TextureFilter); 1387 1388 // Texture parameters: wrap mode 1389 enum TextureWrap { 1390 TEXTURE_WRAP_REPEAT = 0, // Repeats texture in tiled mode 1391 TEXTURE_WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode 1392 TEXTURE_WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode 1393 TEXTURE_WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode 1394 } mixin(expandEnum!TextureWrap); 1395 1396 // Cubemap layouts 1397 enum CubemapLayout { 1398 CUBEMAP_LAYOUT_AUTO_DETECT = 0, // Automatically detect layout type 1399 CUBEMAP_LAYOUT_LINE_VERTICAL, // Layout is defined by a vertical line with faces 1400 CUBEMAP_LAYOUT_LINE_HORIZONTAL, // Layout is defined by an horizontal line with faces 1401 CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces 1402 CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces 1403 CUBEMAP_LAYOUT_PANORAMA // Layout is defined by a panorama image (equirectangular map) 1404 } mixin(expandEnum!CubemapLayout); 1405 1406 // Font type, defines generation method 1407 enum FontType { 1408 FONT_DEFAULT = 0, // Default font generation, anti-aliased 1409 FONT_BITMAP, // Bitmap font generation, no anti-aliasing 1410 FONT_SDF // SDF font generation, requires external shader 1411 } mixin(expandEnum!FontType); 1412 1413 // Color blending modes (pre-defined) 1414 enum BlendMode { 1415 BLEND_ALPHA = 0, // Blend textures considering alpha (default) 1416 BLEND_ADDITIVE, // Blend textures adding colors 1417 BLEND_MULTIPLIED, // Blend textures multiplying colors 1418 BLEND_ADD_COLORS, // Blend textures adding colors (alternative) 1419 BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative) 1420 BLEND_CUSTOM // Belnd textures using custom src/dst factors (use rlSetBlendMode()) 1421 } mixin(expandEnum!BlendMode); 1422 1423 // Gesture 1424 // NOTE: It could be used as flags to enable only some gestures 1425 enum Gesture { 1426 GESTURE_NONE = 0, // No gesture 1427 GESTURE_TAP = 1, // Tap gesture 1428 GESTURE_DOUBLETAP = 2, // Double tap gesture 1429 GESTURE_HOLD = 4, // Hold gesture 1430 GESTURE_DRAG = 8, // Drag gesture 1431 GESTURE_SWIPE_RIGHT = 16, // Swipe right gesture 1432 GESTURE_SWIPE_LEFT = 32, // Swipe left gesture 1433 GESTURE_SWIPE_UP = 64, // Swipe up gesture 1434 GESTURE_SWIPE_DOWN = 128, // Swipe down gesture 1435 GESTURE_PINCH_IN = 256, // Pinch in gesture 1436 GESTURE_PINCH_OUT = 512 // Pinch out gesture 1437 } mixin(expandEnum!Gesture); 1438 1439 // Camera system modes 1440 enum CameraMode { 1441 CAMERA_CUSTOM = 0, // Custom camera 1442 CAMERA_FREE, // Free camera 1443 CAMERA_ORBITAL, // Orbital camera 1444 CAMERA_FIRST_PERSON, // First person camera 1445 CAMERA_THIRD_PERSON // Third person camera 1446 } mixin(expandEnum!CameraMode); 1447 1448 // Camera projection 1449 enum CameraProjection { 1450 CAMERA_PERSPECTIVE = 0, // Perspective projection 1451 CAMERA_ORTHOGRAPHIC // Orthographic projection 1452 } mixin(expandEnum!CameraProjection); 1453 1454 // N-patch layout 1455 enum NPatchLayout { 1456 NPATCH_NINE_PATCH = 0, // Npatch layout: 3x3 tiles 1457 NPATCH_THREE_PATCH_VERTICAL, // Npatch layout: 1x3 tiles 1458 NPATCH_THREE_PATCH_HORIZONTAL // Npatch layout: 3x1 tiles 1459 } mixin(expandEnum!NPatchLayout); 1460 1461 // Callbacks to hook some internal functions 1462 // WARNING: This callbacks are intended for advance users 1463 alias TraceLogCallback = void function(int logLevel, const(char)* text, va_list args); // Logging: Redirect trace log messages 1464 alias LoadFileDataCallback = ubyte* function(const(char)* fileName, uint* bytesRead); // FileIO: Load binary data 1465 alias SaveFileDataCallback = bool function(const(char)* fileName, void* data, uint bytesToWrite); // FileIO: Save binary data 1466 alias LoadFileTextCallback = char* function(const(char)* fileName); // FileIO: Load text data 1467 alias SaveFileTextCallback = bool function(const(char)* fileName, char* text); // FileIO: Save text data 1468 1469 //------------------------------------------------------------------------------------ 1470 // Global Variables Definition 1471 //------------------------------------------------------------------------------------ 1472 1473 // It's lonely here... 1474 1475 version(SL_RAYLIB) 1476 { 1477 //------------------------------------------------------------------------------------ 1478 // Window and Graphics Device Functions (Module: core) 1479 //------------------------------------------------------------------------------------ 1480 1481 // Window-related functions 1482 void InitWindow(int width, int height, const(char)* title); // Initialize window and OpenGL context 1483 bool WindowShouldClose(); // Check if KEY_ESCAPE pressed or Close icon pressed 1484 void CloseWindow(); // Close window and unload OpenGL context 1485 bool IsWindowReady(); // Check if window has been initialized successfully 1486 bool IsWindowFullscreen(); // Check if window is currently fullscreen 1487 bool IsWindowHidden(); // Check if window is currently hidden (only PLATFORM_DESKTOP) 1488 bool IsWindowMinimized(); // Check if window is currently minimized (only PLATFORM_DESKTOP) 1489 bool IsWindowMaximized(); // Check if window is currently maximized (only PLATFORM_DESKTOP) 1490 bool IsWindowFocused(); // Check if window is currently focused (only PLATFORM_DESKTOP) 1491 bool IsWindowResized(); // Check if window has been resized last frame 1492 bool IsWindowState(uint flag); // Check if one specific window flag is enabled 1493 void SetWindowState(uint flags); // Set window configuration state using flags 1494 void ClearWindowState(uint flags); // Clear window configuration state flags 1495 void ToggleFullscreen(); // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) 1496 void MaximizeWindow(); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP) 1497 void MinimizeWindow(); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP) 1498 void RestoreWindow(); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP) 1499 void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) 1500 void SetWindowTitle(const(char)* title); // Set title for window (only PLATFORM_DESKTOP) 1501 void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) 1502 void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) 1503 void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) 1504 void SetWindowSize(int width, int height); // Set window dimensions 1505 void* GetWindowHandle(); // Get native window handle 1506 int GetScreenWidth(); // Get current screen width 1507 int GetScreenHeight(); // Get current screen height 1508 int GetMonitorCount(); // Get number of connected monitors 1509 int GetCurrentMonitor(); // Get current connected monitor 1510 Vector2 GetMonitorPosition(int monitor); // Get specified monitor position 1511 int GetMonitorWidth(int monitor); // Get specified monitor width (max available by monitor) 1512 int GetMonitorHeight(int monitor); // Get specified monitor height (max available by monitor) 1513 int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres 1514 int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres 1515 int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate 1516 Vector2 GetWindowPosition(); // Get window position XY on monitor 1517 Vector2 GetWindowScaleDPI(); // Get window scale DPI factor 1518 const(char)* GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor 1519 void SetClipboardText(const(char)* text); // Set clipboard text content 1520 const(char)* GetClipboardText(); // Get clipboard text content 1521 1522 // Custom frame control functions 1523 // NOTE: Those functions are intended for advance users that want full control over the frame processing 1524 // By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents() 1525 // To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL 1526 void SwapScreenBuffer(); // Swap back buffer with front buffer (screen drawing) 1527 void PollInputEvents(); // Register all input events 1528 void WaitTime(float ms); // Wait for some milliseconds (halt program execution) 1529 1530 // Cursor-related functions 1531 void ShowCursor(); // Shows cursor 1532 void HideCursor(); // Hides cursor 1533 bool IsCursorHidden(); // Check if cursor is not visible 1534 void EnableCursor(); // Enables cursor (unlock cursor) 1535 void DisableCursor(); // Disables cursor (lock cursor) 1536 bool IsCursorOnScreen(); // Check if cursor is on the screen 1537 1538 // Drawing-related functions 1539 void ClearBackground(Color color); // Set background color (framebuffer clear color) 1540 void BeginDrawing(); // Setup canvas (framebuffer) to start drawing 1541 void EndDrawing(); // End canvas drawing and swap buffers (double buffering) 1542 void BeginMode2D(Camera2D camera); // Begin 2D mode with custom camera (2D) 1543 void EndMode2D(); // Ends 2D mode with custom camera 1544 void BeginMode3D(Camera3D camera); // Begin 3D mode with custom camera (3D) 1545 void EndMode3D(); // Ends 3D mode and returns to default 2D orthographic mode 1546 void BeginTextureMode(RenderTexture2D target); // Begin drawing to render texture 1547 void EndTextureMode(); // Ends drawing to render texture 1548 void BeginShaderMode(Shader shader); // Begin custom shader drawing 1549 void EndShaderMode(); // End custom shader drawing (use default shader) 1550 void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied, subtract, custom) 1551 void EndBlendMode(); // End blending mode (reset to default: alpha blending) 1552 void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) 1553 void EndScissorMode(); // End scissor mode 1554 void BeginVrStereoMode(VrStereoConfig config); // Begin stereo rendering (requires VR simulator) 1555 void EndVrStereoMode(); // End stereo rendering (requires VR simulator) 1556 1557 // VR stereo config functions for VR simulator 1558 VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); // Load VR stereo config for VR simulator device parameters 1559 void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR stereo config 1560 1561 // Shader management functions 1562 // NOTE: Shader functionality is not available on OpenGL 1.1 1563 Shader LoadShader(const(char)* vsFileName, const(char)* fsFileName); // Load shader from files and bind default locations 1564 Shader LoadShaderFromMemory(const(char)* vsCode, const(char)* fsCode); // Load shader from code strings and bind default locations 1565 int GetShaderLocation(Shader shader, const(char)* uniformName); // Get shader uniform location 1566 int GetShaderLocationAttrib(Shader shader, const(char)* attribName); // Get shader attribute location 1567 void SetShaderValue(Shader shader, int locIndex, const void* value, int uniformType); // Set shader uniform value 1568 void SetShaderValueV(Shader shader, int locIndex, const void* value, int uniformType, int count); // Set shader uniform value vector 1569 void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4) 1570 void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d) 1571 void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) 1572 1573 // Screen-space-related functions 1574 Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Get a ray trace from mouse position 1575 Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix) 1576 Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix 1577 Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position 1578 Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get size position for a 3d world space position 1579 Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position 1580 Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position 1581 1582 // Timing-related functions 1583 void SetTargetFPS(int fps); // Set target FPS (maximum) 1584 int GetFPS(); // Get current FPS 1585 float GetFrameTime(); // Get time in seconds for last frame drawn (delta time) 1586 double GetTime(); // Get elapsed time in seconds since InitWindow() 1587 1588 // Misc. functions 1589 int GetRandomValue(int min, int max); // Get a random value between min and max (both included) 1590 void SetRandomSeed(uint seed); // Set the seed for the random number generator 1591 void TakeScreenshot(const(char)* fileName); // Takes a screenshot of current screen (filename extension defines format) 1592 void SetConfigFlags(uint flags); // Setup init configuration flags (view FLAGS) 1593 1594 void TraceLog(int logLevel, const(char)* text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) 1595 void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level 1596 void* MemAlloc(int size); // Internal memory allocator 1597 void* MemRealloc(void* ptr, int size); // Internal memory reallocator 1598 void MemFree(void* ptr); // Internal memory free 1599 1600 // Set custom callbacks 1601 // WARNING: Callbacks setup is intended for advance users 1602 void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log 1603 void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader 1604 void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver 1605 void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader 1606 void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver 1607 1608 // Files management functions 1609 ubyte* LoadFileData(const(char)* fileName, uint* bytesRead); // Load file data as byte array (read) 1610 void UnloadFileData(ubyte* data); // Unload file data allocated by LoadFileData() 1611 bool SaveFileData(const(char)* fileName, void* data, uint bytesToWrite); // Save data to file from byte array (write), returns true on success 1612 char* LoadFileText(const(char)* fileName); // Load text data from file (read), returns a '\0' terminated string 1613 void UnloadFileText(char* text); // Unload file text data allocated by LoadFileText() 1614 bool SaveFileText(const(char)* fileName, char* text); // Save text data to file (write), string must be '\0' terminated, returns true on success 1615 bool FileExists(const(char)* fileName); // Check if file exists 1616 bool DirectoryExists(const(char)* dirPath); // Check if a directory path exists 1617 bool IsFileExtension(const(char)* fileName, const(char)* ext); // Check file extension (including point: .png, .wav) 1618 const(char)* GetFileExtension(const(char)* fileName); // Get pointer to extension for a filename string (includes dot: '.png') 1619 const(char)* GetFileName(const(char)* filePath); // Get pointer to filename for a path string 1620 const(char)* GetFileNameWithoutExt(const(char)* filePath); // Get filename string without extension (uses static string) 1621 const(char)* GetDirectoryPath(const(char)* filePath); // Get full path for a given fileName with path (uses static string) 1622 const(char)* GetPrevDirectoryPath(const(char)* dirPath); // Get previous directory path for a given path (uses static string) 1623 const(char)* GetWorkingDirectory(); // Get current working directory (uses static string) 1624 char** GetDirectoryFiles(const(char)* dirPath, int* count); // Get filenames in a directory path (memory should be freed) 1625 void ClearDirectoryFiles(); // Clear directory files paths buffers (free memory) 1626 bool ChangeDirectory(const(char)* dir); // Change working directory, return true on success 1627 bool IsFileDropped(); // Check if a file has been dropped into window 1628 char** GetDroppedFiles(int* count); // Get dropped files names (memory should be freed) 1629 void ClearDroppedFiles(); // Clear dropped files paths buffer (free memory) 1630 long GetFileModTime(const(char)* fileName); // Get file modification time (last write time) 1631 1632 // Compression/Encoding functionality 1633 ubyte* CompressData(ubyte* data, int dataLength, int* compDataLength); // Compress data (DEFLATE algorithm) 1634 ubyte* DecompressData(ubyte* compData, int compDataLength, int* dataLength); // Decompress data (DEFLATE algorithm) 1635 char* EncodeDataBase64(const ubyte* data, int dataLength, int* outputLength); // Encode data to Base64 string 1636 ubyte* DecodeDataBase64(ubyte* data, int* outputLength); // Decode Base64 string data 1637 1638 // Persistent storage management 1639 bool SaveStorageValue(uint position, int value); // Save integer value to storage file (to defined position), returns true on success 1640 int LoadStorageValue(uint position); // Load integer value from storage file (from defined position) 1641 1642 void OpenURL(const(char)* url); // Open URL with default system browser (if available) 1643 1644 //------------------------------------------------------------------------------------ 1645 // Input Handling Functions (Module: core) 1646 //------------------------------------------------------------------------------------ 1647 1648 // Input-related functions: keyboard 1649 bool IsKeyPressed(int key); // Check if a key has been pressed once 1650 bool IsKeyDown(int key); // Check if a key is being pressed 1651 bool IsKeyReleased(int key); // Check if a key has been released once 1652 bool IsKeyUp(int key); // Check if a key is NOT being pressed 1653 void SetExitKey(int key); // Set a custom key to exit program (default is ESC) 1654 int GetKeyPressed(); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty 1655 int GetCharPressed(); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty 1656 1657 // Input-related functions: gamepads 1658 bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available 1659 const(char)* GetGamepadName(int gamepad); // Get gamepad internal name id 1660 bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once 1661 bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed 1662 bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once 1663 bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed 1664 int GetGamepadButtonPressed(); // Get the last gamepad button pressed 1665 int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad 1666 float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis 1667 int SetGamepadMappings(const(char)* mappings); // Set internal gamepad mappings (SDL_GameControllerDB) 1668 1669 // Input-related functions: mouse 1670 bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once 1671 bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed 1672 bool IsMouseButtonReleased(int button); // Check if a mouse button has been released once 1673 bool IsMouseButtonUp(int button); // Check if a mouse button is NOT being pressed 1674 int GetMouseX(); // Get mouse position X 1675 int GetMouseY(); // Get mouse position Y 1676 Vector2 GetMousePosition(); // Get mouse position XY 1677 Vector2 GetMouseDelta(); // Get mouse delta between frames 1678 void SetMousePosition(int x, int y); // Set mouse position XY 1679 void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset 1680 void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling 1681 float GetMouseWheelMove(); // Get mouse wheel movement Y 1682 void SetMouseCursor(int cursor); // Set mouse cursor 1683 1684 // Input-related functions: touch 1685 int GetTouchX(); // Get touch position X for touch point 0 (relative to screen size) 1686 int GetTouchY(); // Get touch position Y for touch point 0 (relative to screen size) 1687 Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size) 1688 int GetTouchPointId(int index); // Get touch point identifier for given index 1689 int GetTouchPointCount(); // Get number of touch points 1690 1691 //------------------------------------------------------------------------------------ 1692 // Gestures and Touch Handling Functions (Module: rgestures) 1693 //------------------------------------------------------------------------------------ 1694 1695 void SetGesturesEnabled(uint flags); // Enable a set of gestures using flags 1696 bool IsGestureDetected(int gesture); // Check if a gesture have been detected 1697 int GetGestureDetected(); // Get latest detected gesture 1698 float GetGestureHoldDuration(); // Get gesture hold time in milliseconds 1699 Vector2 GetGestureDragVector(); // Get gesture drag vector 1700 float GetGestureDragAngle(); // Get gesture drag angle 1701 Vector2 GetGesturePinchVector(); // Get gesture pinch delta 1702 float GetGesturePinchAngle(); // Get gesture pinch angle 1703 1704 //------------------------------------------------------------------------------------ 1705 // Camera System Functions (Module: rcamera) 1706 //------------------------------------------------------------------------------------ 1707 1708 void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) 1709 void UpdateCamera(Camera* camera); // Update camera position for selected mode 1710 1711 void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera) 1712 void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera) 1713 void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera) 1714 void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras) 1715 1716 //------------------------------------------------------------------------------------ 1717 // Basic Shapes Drawing Functions (Module: shapes) 1718 //------------------------------------------------------------------------------------ 1719 1720 // Set texture and rectangle to be used on shapes drawing 1721 // NOTE: It can be useful when using basic shapes and one single font, 1722 // defining a font char white rectangle would allow drawing everything in a single draw call 1723 void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing 1724 1725 // Basic shapes drawing functions 1726 void DrawPixel(int posX, int posY, Color color); // Draw a pixel 1727 void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) 1728 void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line 1729 void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) 1730 void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness 1731 void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out 1732 void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color); // Draw line using quadratic bezier curves with a control point 1733 void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color); // Draw line using cubic bezier curves with 2 control points 1734 void DrawLineStrip(Vector2* points, int pointCount, Color color); // Draw lines sequence 1735 void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle 1736 void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle 1737 void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline 1738 void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle 1739 void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) 1740 void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline 1741 void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse 1742 void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline 1743 void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring 1744 void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline 1745 void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle 1746 void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) 1747 void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle 1748 void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters 1749 void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a vertical-gradient-filled rectangle 1750 void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a horizontal-gradient-filled rectangle 1751 void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors 1752 void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline 1753 void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters 1754 void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges 1755 void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline 1756 void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) 1757 void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) 1758 void DrawTriangleFan(Vector2* points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) 1759 void DrawTriangleStrip(Vector2* points, int pointCount, Color color); // Draw a triangle strip defined by points 1760 void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) 1761 void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides 1762 void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters 1763 1764 // Basic shapes collision detection functions 1765 bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles 1766 bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles 1767 bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle 1768 bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle 1769 bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle 1770 bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle 1771 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 1772 bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] 1773 Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision 1774 1775 //------------------------------------------------------------------------------------ 1776 // Texture Loading and Drawing Functions (Module: textures) 1777 //------------------------------------------------------------------------------------ 1778 1779 // Image loading functions 1780 // NOTE: This functions do not require GPU access 1781 Image LoadImage(const(char)* fileName); // Load image from file into CPU memory (RAM) 1782 Image LoadImageRaw(const(char)* fileName, int width, int height, int format, int headerSize); // Load image from RAW file data 1783 Image LoadImageAnim(const(char)* fileName, int* frames); // Load image sequence from file (frames appended to image.data) 1784 Image LoadImageFromMemory(const(char)* fileType, const ubyte* fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' 1785 Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data 1786 Image LoadImageFromScreen(); // Load image from screen buffer and (screenshot) 1787 void UnloadImage(Image image); // Unload image from CPU memory (RAM) 1788 bool ExportImage(Image image, const(char)* fileName); // Export image data to file, returns true on success 1789 bool ExportImageAsCode(Image image, const(char)* fileName); // Export image as code file defining an array of bytes, returns true on success 1790 1791 // Image generation functions 1792 Image GenImageColor(int width, int height, Color color); // Generate image: plain color 1793 Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient 1794 Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient 1795 Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient 1796 Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked 1797 Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise 1798 Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm, bigger tileSize means bigger cells 1799 1800 // Image manipulation functions 1801 Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) 1802 Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece 1803 Image ImageText(const(char)* text, int fontSize, Color color); // Create an image from text (default font) 1804 Image ImageTextEx(Font font, const(char)* text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) 1805 void ImageFormat(Image* image, int newFormat); // Convert image data to desired format 1806 void ImageToPOT(Image* image, Color fill); // Convert image to POT (power-of-two) 1807 void ImageCrop(Image* image, Rectangle crop); // Crop an image to a defined rectangle 1808 void ImageAlphaCrop(Image* image, float threshold); // Crop image depending on alpha value 1809 void ImageAlphaClear(Image* image, Color color, float threshold); // Clear alpha channel to desired color 1810 void ImageAlphaMask(Image* image, Image alphaMask); // Apply alpha mask to image 1811 void ImageAlphaPremultiply(Image* image); // Premultiply alpha channel 1812 void ImageResize(Image* image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) 1813 void ImageResizeNN(Image* image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) 1814 void ImageResizeCanvas(Image* image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color 1815 void ImageMipmaps(Image* image); // Compute all mipmap levels for a provided image 1816 void ImageDither(Image* image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) 1817 void ImageFlipVertical(Image* image); // Flip image vertically 1818 void ImageFlipHorizontal(Image* image); // Flip image horizontally 1819 void ImageRotateCW(Image* image); // Rotate image clockwise 90deg 1820 void ImageRotateCCW(Image* image); // Rotate image counter-clockwise 90deg 1821 void ImageColorTint(Image* image, Color color); // Modify image color: tint 1822 void ImageColorInvert(Image* image); // Modify image color: invert 1823 void ImageColorGrayscale(Image* image); // Modify image color: grayscale 1824 void ImageColorContrast(Image* image, float contrast); // Modify image color: contrast (-100 to 100) 1825 void ImageColorBrightness(Image* image, int brightness); // Modify image color: brightness (-255 to 255) 1826 void ImageColorReplace(Image* image, Color color, Color replace); // Modify image color: replace color 1827 Color* LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit) 1828 Color* LoadImagePalette(Image image, int maxPaletteSize, int* colorCount); // Load colors palette from image as a Color array (RGBA - 32bit) 1829 void UnloadImageColors(Color* colors); // Unload color data loaded with LoadImageColors() 1830 void UnloadImagePalette(Color* colors); // Unload colors palette loaded with LoadImagePalette() 1831 Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle 1832 Color GetImageColor(Image image, int x, int y); // Get image pixel color at (x, y) position 1833 1834 // Image drawing functions 1835 // NOTE: Image software-rendering functions (CPU) 1836 void ImageClearBackground(Image* dst, Color color); // Clear image background with given color 1837 void ImageDrawPixel(Image* dst, int posX, int posY, Color color); // Draw pixel within an image 1838 void ImageDrawPixelV(Image* dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) 1839 void ImageDrawLine(Image* dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image 1840 void ImageDrawLineV(Image* dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) 1841 void ImageDrawCircle(Image* dst, int centerX, int centerY, int radius, Color color); // Draw circle within an image 1842 void ImageDrawCircleV(Image* dst, Vector2 center, int radius, Color color); // Draw circle within an image (Vector version) 1843 void ImageDrawRectangle(Image* dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image 1844 void ImageDrawRectangleV(Image* dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) 1845 void ImageDrawRectangleRec(Image* dst, Rectangle rec, Color color); // Draw rectangle within an image 1846 void ImageDrawRectangleLines(Image* dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image 1847 void ImageDraw(Image* dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) 1848 void ImageDrawText(Image* dst, const(char)* text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) 1849 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) 1850 1851 // Texture loading functions 1852 // NOTE: These functions require GPU access 1853 Texture2D LoadTexture(const(char)* fileName); // Load texture from file into GPU memory (VRAM) 1854 Texture2D LoadTextureFromImage(Image image); // Load texture from image data 1855 TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported 1856 RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) 1857 void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) 1858 void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) 1859 void UpdateTexture(Texture2D texture, const void* pixels); // Update GPU texture with new data 1860 void UpdateTextureRec(Texture2D texture, Rectangle rec, const void* pixels); // Update GPU texture rectangle with new data 1861 1862 // Texture configuration functions 1863 void GenTextureMipmaps(Texture2D* texture); // Generate GPU mipmaps for a texture 1864 void SetTextureFilter(Texture2D texture, int filter); // Set texture scaling filter mode 1865 void SetTextureWrap(Texture2D texture, int wrap); // Set texture wrapping mode 1866 1867 // Texture drawing functions 1868 void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D 1869 void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 1870 void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters 1871 void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle 1872 void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters 1873 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. 1874 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 1875 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 1876 void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2* points, Vector2* texcoords, int pointCount, Color tint); // Draw a textured polygon 1877 1878 // Color/pixel related functions 1879 Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f 1880 int ColorToInt(Color color); // Get hexadecimal value for a Color 1881 Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1] 1882 Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1] 1883 Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1] 1884 Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1] 1885 Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f 1886 Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint 1887 Color GetColor(uint hexValue); // Get Color structure from hexadecimal value 1888 Color GetPixelColor(void* srcPtr, int format); // Get Color from a source pixel pointer of certain format 1889 void SetPixelColor(void* dstPtr, Color color, int format); // Set color formatted into destination pixel pointer 1890 int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format 1891 1892 //------------------------------------------------------------------------------------ 1893 // Font Loading and Text Drawing Functions (Module: text) 1894 //------------------------------------------------------------------------------------ 1895 1896 // Font loading/unloading functions 1897 Font GetFontDefault(); // Get the default Font 1898 Font LoadFont(const(char)* fileName); // Load font from file into GPU memory (VRAM) 1899 Font LoadFontEx(const(char)* fileName, int fontSize, int* fontChars, int glyphCount); // Load font from file with extended parameters 1900 Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) 1901 Font LoadFontFromMemory(const(char)* fileType, const ubyte* fileData, int dataSize, int fontSize, int* fontChars, int glyphCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' 1902 GlyphInfo* LoadFontData(const ubyte* fileData, int dataSize, int fontSize, int* fontChars, int glyphCount, int type); // Load font data for further use 1903 Image GenImageFontAtlas(const GlyphInfo* chars, Rectangle* *recs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info 1904 void UnloadFontData(GlyphInfo* chars, int glyphCount); // Unload font chars info data (RAM) 1905 void UnloadFont(Font font); // Unload Font from GPU memory (VRAM) 1906 1907 // Text drawing functions 1908 void DrawFPS(int posX, int posY); // Draw current FPS 1909 void DrawText(const(char)* text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) 1910 void DrawTextEx(Font font, const(char)* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters 1911 void DrawTextPro(Font font, const(char)* text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation) 1912 void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) 1913 1914 // Text font info functions 1915 int MeasureText(const(char)* text, int fontSize); // Measure string width for default font 1916 Vector2 MeasureTextEx(Font font, const(char)* text, float fontSize, float spacing); // Measure string size for Font 1917 int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found 1918 GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found 1919 Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found 1920 1921 // Text codepoints management functions (unicode characters) 1922 int* LoadCodepoints(const(char)* text, int* count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter 1923 void UnloadCodepoints(int* codepoints); // Unload codepoints data from memory 1924 int GetCodepointCount(const(char)* text); // Get total number of codepoints in a UTF-8 encoded string 1925 int GetCodepoint(const(char)* text, int* bytesProcessed); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure 1926 const(char)* CodepointToUTF8(int codepoint, int* byteSize); // Encode one codepoint into UTF-8 byte array (array length returned as parameter) 1927 char* TextCodepointsToUTF8(int* codepoints, int length); // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!) 1928 1929 // Text strings management functions (no UTF-8 strings, only byte chars) 1930 // NOTE: Some strings allocate memory internally for returned strings, just be careful! 1931 int TextCopy(char* dst, const(char)* src); // Copy one string to another, returns bytes copied 1932 bool TextIsEqual(const(char)* text1, const(char)* text2); // Check if two text string are equal 1933 uint TextLength(const(char)* text); // Get text length, checks for '\0' ending 1934 const(char)* TextFormat(const(char)* text, ...); // Text formatting with variables (sprintf() style) 1935 const(char)* TextSubtext(const(char)* text, int position, int length); // Get a piece of a text string 1936 char* TextReplace(char* text, const(char)* replace, const(char)* by); // Replace text string (WARNING: memory must be freed!) 1937 char* TextInsert(const(char)* text, const(char)* insert, int position); // Insert text in a position (WARNING: memory must be freed!) 1938 const(char)* TextJoin(const(char)** textList, int count, const(char)* delimiter); // Join text strings with delimiter 1939 const(char)** TextSplit(const(char)* text, char delimiter, int* count); // Split text into multiple strings 1940 void TextAppend(char* text, const(char)* append, int* position); // Append text at specific position and move cursor! 1941 int TextFindIndex(const(char)* text, const(char)* find); // Find first text occurrence within a string 1942 const(char)* TextToUpper(const(char)* text); // Get upper case version of provided string 1943 const(char)* TextToLower(const(char)* text); // Get lower case version of provided string 1944 const(char)* TextToPascal(const(char)* text); // Get Pascal case notation version of provided string 1945 int TextToInteger(const(char)* text); // Get integer value from text (negative values not supported) 1946 1947 //------------------------------------------------------------------------------------ 1948 // Basic 3d Shapes Drawing Functions (Module: models) 1949 //------------------------------------------------------------------------------------ 1950 1951 // Basic geometric 3D shapes drawing functions 1952 void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space 1953 void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line 1954 void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space 1955 void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) 1956 void DrawTriangleStrip3D(Vector3* points, int pointCount, Color color); // Draw a triangle strip defined by points 1957 void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube 1958 void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) 1959 void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires 1960 void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) 1961 void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured 1962 void DrawCubeTextureRec(Texture2D texture, Rectangle source, Vector3 position, float width, float height, float length, Color color); // Draw cube with a region of a texture 1963 void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere 1964 void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters 1965 void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires 1966 void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone 1967 void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos 1968 void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires 1969 void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder wires with base at startPos and top at endPos 1970 void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ 1971 void DrawRay(Ray ray, Color color); // Draw a ray line 1972 void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) 1973 1974 //------------------------------------------------------------------------------------ 1975 // Model 3d Loading and Drawing Functions (Module: models) 1976 //------------------------------------------------------------------------------------ 1977 1978 // Model management functions 1979 Model LoadModel(const(char)* fileName); // Load model from files (meshes and materials) 1980 Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) 1981 void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) 1982 void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) 1983 BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes) 1984 1985 // Model drawing functions 1986 void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) 1987 void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters 1988 void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) 1989 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 1990 void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) 1991 void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture 1992 void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source 1993 void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation 1994 1995 // Mesh management functions 1996 void UploadMesh(Mesh* mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids 1997 void UpdateMeshBuffer(Mesh mesh, int index, void* data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index 1998 void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU 1999 void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform 2000 void DrawMeshInstanced(Mesh mesh, Material material, Matrix* transforms, int instances); // Draw multiple mesh instances with material and different transforms 2001 bool ExportMesh(Mesh mesh, const(char)* fileName); // Export mesh data to file, returns true on success 2002 BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits 2003 void GenMeshTangents(Mesh* mesh); // Compute mesh tangents 2004 void GenMeshBinormals(Mesh* mesh); // Compute mesh binormals 2005 2006 // Mesh generation functions 2007 Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh 2008 Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) 2009 Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh 2010 Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) 2011 Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) 2012 Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh 2013 Mesh GenMeshCone(float radius, float height, int slices); // Generate cone/pyramid mesh 2014 Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh 2015 Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh 2016 Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data 2017 Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data 2018 2019 // Material loading/unloading functions 2020 Material* LoadMaterials(const(char)* fileName, int* materialCount); // Load materials from model file 2021 Material LoadMaterialDefault(); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) 2022 void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) 2023 void SetMaterialTexture(Material* material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) 2024 void SetModelMeshMaterial(Model* model, int meshId, int materialId); // Set material for a mesh 2025 2026 // Model animations loading/unloading functions 2027 ModelAnimation* LoadModelAnimations(const(char)* fileName, uint* animCount); // Load model animations from file 2028 void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose 2029 void UnloadModelAnimation(ModelAnimation anim); // Unload animation data 2030 void UnloadModelAnimations(ModelAnimation* animations, uint count); // Unload animation array data 2031 bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match 2032 2033 // Collision detection functions 2034 bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres 2035 bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes 2036 bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere 2037 RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere 2038 RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box 2039 RayCollision GetRayCollisionModel(Ray ray, Model model); // Get collision info between ray and model 2040 RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh 2041 RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle 2042 RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad 2043 2044 //------------------------------------------------------------------------------------ 2045 // Audio Loading and Playing Functions (Module: audio) 2046 //------------------------------------------------------------------------------------ 2047 2048 // Audio device management functions 2049 void InitAudioDevice(); // Initialize audio device and context 2050 void CloseAudioDevice(); // Close the audio device and context 2051 bool IsAudioDeviceReady(); // Check if audio device has been initialized successfully 2052 void SetMasterVolume(float volume); // Set master volume (listener) 2053 2054 // Wave/Sound loading/unloading functions 2055 Wave LoadWave(const(char)* fileName); // Load wave data from file 2056 Wave LoadWaveFromMemory(const(char)* fileType, const ubyte* fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' 2057 Sound LoadSound(const(char)* fileName); // Load sound from file 2058 Sound LoadSoundFromWave(Wave wave); // Load sound from wave data 2059 void UpdateSound(Sound sound, const void* data, int sampleCount); // Update sound buffer with new data 2060 void UnloadWave(Wave wave); // Unload wave data 2061 void UnloadSound(Sound sound); // Unload sound 2062 bool ExportWave(Wave wave, const(char)* fileName); // Export wave data to file, returns true on success 2063 bool ExportWaveAsCode(Wave wave, const(char)* fileName); // Export wave sample data to code (.h), returns true on success 2064 2065 // Wave/Sound management functions 2066 void PlaySound(Sound sound); // Play a sound 2067 void StopSound(Sound sound); // Stop playing a sound 2068 void PauseSound(Sound sound); // Pause a sound 2069 void ResumeSound(Sound sound); // Resume a paused sound 2070 void PlaySoundMulti(Sound sound); // Play a sound (using multichannel buffer pool) 2071 void StopSoundMulti(); // Stop any sound playing (using multichannel buffer pool) 2072 int GetSoundsPlaying(); // Get number of sounds playing in the multichannel 2073 bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing 2074 void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) 2075 void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) 2076 void WaveFormat(Wave* wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format 2077 Wave WaveCopy(Wave wave); // Copy a wave to a new wave 2078 void WaveCrop(Wave* wave, int initSample, int finalSample); // Crop a wave to defined samples range 2079 float* LoadWaveSamples(Wave wave); // Load samples data from wave as a floats array 2080 void UnloadWaveSamples(float* samples); // Unload samples data loaded with LoadWaveSamples() 2081 2082 // Music management functions 2083 Music LoadMusicStream(const(char)* fileName); // Load music stream from file 2084 Music LoadMusicStreamFromMemory(const(char)* fileType, ubyte* data, int dataSize); // Load music stream from data 2085 void UnloadMusicStream(Music music); // Unload music stream 2086 void PlayMusicStream(Music music); // Start music playing 2087 bool IsMusicStreamPlaying(Music music); // Check if music is playing 2088 void UpdateMusicStream(Music music); // Updates buffers for music streaming 2089 void StopMusicStream(Music music); // Stop music playing 2090 void PauseMusicStream(Music music); // Pause music playing 2091 void ResumeMusicStream(Music music); // Resume playing paused music 2092 void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds) 2093 void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) 2094 void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) 2095 float GetMusicTimeLength(Music music); // Get music time length (in seconds) 2096 float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) 2097 2098 // AudioStream management functions 2099 AudioStream LoadAudioStream(uint sampleRate, uint sampleSize, uint channels); // Load audio stream (to stream raw audio pcm data) 2100 void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory 2101 void UpdateAudioStream(AudioStream stream, const void* data, int frameCount); // Update audio stream buffers with data 2102 bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill 2103 void PlayAudioStream(AudioStream stream); // Play audio stream 2104 void PauseAudioStream(AudioStream stream); // Pause audio stream 2105 void ResumeAudioStream(AudioStream stream); // Resume audio stream 2106 bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing 2107 void StopAudioStream(AudioStream stream); // Stop audio stream 2108 void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) 2109 void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) 2110 void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio strea 2111 } 2112 else 2113 { 2114 //------------------------------------------------------------------------------------ 2115 // Window and Graphics Device Functions (Module: core) 2116 //------------------------------------------------------------------------------------ 2117 2118 // Window-related functions 2119 void function(int width, int height, const(char)* title) InitWindow; // Initialize window and OpenGL context 2120 bool function() WindowShouldClose; // Check if KEY_ESCAPE pressed or Close icon pressed 2121 void function() CloseWindow; // Close window and unload OpenGL context 2122 bool function() IsWindowReady; // Check if window has been initialized successfully 2123 bool function() IsWindowFullscreen; // Check if window is currently fullscreen 2124 bool function() IsWindowHidden; // Check if window is currently hidden (only PLATFORM_DESKTOP) 2125 bool function() IsWindowMinimized; // Check if window is currently minimized (only PLATFORM_DESKTOP) 2126 bool function() IsWindowMaximized; // Check if window is currently maximized (only PLATFORM_DESKTOP) 2127 bool function() IsWindowFocused; // Check if window is currently focused (only PLATFORM_DESKTOP) 2128 bool function() IsWindowResized; // Check if window has been resized last frame 2129 bool function(uint flag) IsWindowState; // Check if one specific window flag is enabled 2130 void function(uint flags) SetWindowState; // Set window configuration state using flags 2131 void function(uint flags) ClearWindowState; // Clear window configuration state flags 2132 void function() ToggleFullscreen; // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) 2133 void function() MaximizeWindow; // Set window state: maximized, if resizable (only PLATFORM_DESKTOP) 2134 void function() MinimizeWindow; // Set window state: minimized, if resizable (only PLATFORM_DESKTOP) 2135 void function() RestoreWindow; // Set window state: not minimized/maximized (only PLATFORM_DESKTOP) 2136 void function(Image image) SetWindowIcon; // Set icon for window (only PLATFORM_DESKTOP) 2137 void function(const(char)* title) SetWindowTitle; // Set title for window (only PLATFORM_DESKTOP) 2138 void function(int x, int y) SetWindowPosition; // Set window position on screen (only PLATFORM_DESKTOP) 2139 void function(int monitor) SetWindowMonitor; // Set monitor for the current window (fullscreen mode) 2140 void function(int width, int height) SetWindowMinSize; // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) 2141 void function(int width, int height) SetWindowSize; // Set window dimensions 2142 void* function() GetWindowHandle; // Get native window handle 2143 int function() GetScreenWidth; // Get current screen width 2144 int function() GetScreenHeight; // Get current screen height 2145 int function() GetMonitorCount; // Get number of connected monitors 2146 int function() GetCurrentMonitor; // Get current connected monitor 2147 Vector2 function(int monitor) GetMonitorPosition; // Get specified monitor position 2148 int function(int monitor) GetMonitorWidth; // Get specified monitor width (max available by monitor) 2149 int function(int monitor) GetMonitorHeight; // Get specified monitor height (max available by monitor) 2150 int function(int monitor) GetMonitorPhysicalWidth; // Get specified monitor physical width in millimetres 2151 int function(int monitor) GetMonitorPhysicalHeight; // Get specified monitor physical height in millimetres 2152 int function(int monitor) GetMonitorRefreshRate; // Get specified monitor refresh rate 2153 Vector2 function() GetWindowPosition; // Get window position XY on monitor 2154 Vector2 function() GetWindowScaleDPI; // Get window scale DPI factor 2155 const(char)* function(int monitor) GetMonitorName; // Get the human-readable, UTF-8 encoded name of the primary monitor 2156 void function(const(char)* text) SetClipboardText; // Set clipboard text content 2157 const(char)* function() GetClipboardText; // Get clipboard text content 2158 2159 // Custom frame control functions 2160 // NOTE: Those functions are intended for advance users that want full control over the frame processing 2161 // By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents() 2162 // To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL 2163 void function() SwapScreenBuffer; // Swap back buffer with front buffer (screen drawing) 2164 void function() PollInputEvents; // Register all input events 2165 void function(float ms) WaitTime; // Wait for some milliseconds (halt program execution) 2166 2167 // Cursor-related functions 2168 void function() ShowCursor; // Shows cursor 2169 void function() HideCursor; // Hides cursor 2170 bool function() IsCursorHidden; // Check if cursor is not visible 2171 void function() EnableCursor; // Enables cursor (unlock cursor) 2172 void function() DisableCursor; // Disables cursor (lock cursor) 2173 bool function() IsCursorOnScreen; // Check if cursor is on the screen 2174 2175 // Drawing-related functions 2176 void function(Color color) ClearBackground; // Set background color (framebuffer clear color) 2177 void function() BeginDrawing; // Setup canvas (framebuffer) to start drawing 2178 void function() EndDrawing; // End canvas drawing and swap buffers (double buffering) 2179 void function(Camera2D camera) BeginMode2D; // Begin 2D mode with custom camera (2D) 2180 void function() EndMode2D; // Ends 2D mode with custom camera 2181 void function(Camera3D camera) BeginMode3D; // Begin 3D mode with custom camera (3D) 2182 void function() EndMode3D; // Ends 3D mode and returns to default 2D orthographic mode 2183 void function(RenderTexture2D target) BeginTextureMode; // Begin drawing to render texture 2184 void function() EndTextureMode; // Ends drawing to render texture 2185 void function(Shader shader) BeginShaderMode; // Begin custom shader drawing 2186 void function() EndShaderMode; // End custom shader drawing (use default shader) 2187 void function(int mode) BeginBlendMode; // Begin blending mode (alpha, additive, multiplied, subtract, custom) 2188 void function() EndBlendMode; // End blending mode (reset to default: alpha blending) 2189 void function(int x, int y, int width, int height) BeginScissorMode; // Begin scissor mode (define screen area for following drawing) 2190 void function() EndScissorMode; // End scissor mode 2191 void function(VrStereoConfig config) BeginVrStereoMode; // Begin stereo rendering (requires VR simulator) 2192 void function() EndVrStereoMode; // End stereo rendering (requires VR simulator) 2193 2194 // VR stereo config functions for VR simulator 2195 VrStereoConfig function(VrDeviceInfo device) LoadVrStereoConfig; // Load VR stereo config for VR simulator device parameters 2196 void function(VrStereoConfig config) UnloadVrStereoConfig; // Unload VR stereo config 2197 2198 // Shader management functions 2199 // NOTE: Shader functionality is not available on OpenGL 1.1 2200 Shader function(const(char)* vsFileName, const(char)* fsFileName) LoadShader; // Load shader from files and bind default locations 2201 Shader function(const(char)* vsCode, const(char)* fsCode) LoadShaderFromMemory; // Load shader from code strings and bind default locations 2202 int function(Shader shader, const(char)* uniformName) GetShaderLocation; // Get shader uniform location 2203 int function(Shader shader, const(char)* attribName) GetShaderLocationAttrib; // Get shader attribute location 2204 void function(Shader shader, int locIndex, const void* value, int uniformType) SetShaderValue; // Set shader uniform value 2205 void function(Shader shader, int locIndex, const void* value, int uniformType, int count) SetShaderValueV; // Set shader uniform value vector 2206 void function(Shader shader, int locIndex, Matrix mat) SetShaderValueMatrix; // Set shader uniform value (matrix 4x4) 2207 void function(Shader shader, int locIndex, Texture2D texture) SetShaderValueTexture; // Set shader uniform value for texture (sampler2d) 2208 void function(Shader shader) UnloadShader; // Unload shader from GPU memory (VRAM) 2209 2210 // Screen-space-related functions 2211 Ray function(Vector2 mousePosition, Camera camera) GetMouseRay; // Get a ray trace from mouse position 2212 Matrix function(Camera camera) GetCameraMatrix; // Get camera transform matrix (view matrix) 2213 Matrix function(Camera2D camera) GetCameraMatrix2D; // Get camera 2d transform matrix 2214 Vector2 function(Vector3 position, Camera camera) GetWorldToScreen; // Get the screen space position for a 3d world space position 2215 Vector2 function(Vector3 position, Camera camera, int width, int height) GetWorldToScreenEx; // Get size position for a 3d world space position 2216 Vector2 function(Vector2 position, Camera2D camera) GetWorldToScreen2D; // Get the screen space position for a 2d camera world space position 2217 Vector2 function(Vector2 position, Camera2D camera) GetScreenToWorld2D; // Get the world space position for a 2d camera screen space position 2218 2219 // Timing-related functions 2220 void function(int fps) SetTargetFPS; // Set target FPS (maximum) 2221 int function() GetFPS; // Get current FPS 2222 float function() GetFrameTime; // Get time in seconds for last frame drawn (delta time) 2223 double function() GetTime; // Get elapsed time in seconds since InitWindow() 2224 2225 // Misc. functions 2226 int function(int min, int max) GetRandomValue; // Get a random value between min and max (both included) 2227 void function(uint seed) SetRandomSeed; // Set the seed for the random number generator 2228 void function(const(char)* fileName) TakeScreenshot; // Takes a screenshot of current screen (filename extension defines format) 2229 void function(uint flags) SetConfigFlags; // Setup init configuration flags (view FLAGS) 2230 2231 void function(int logLevel, const(char)* text, ...) TraceLog; // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) 2232 void function(int logLevel) SetTraceLogLevel; // Set the current threshold (minimum) log level 2233 void* function(int size) MemAlloc; // Internal memory allocator 2234 void* function(void* ptr, int size) MemRealloc; // Internal memory reallocator 2235 void function(void* ptr) MemFree; // Internal memory free 2236 2237 // Set custom callbacks 2238 // WARNING: Callbacks setup is intended for advance users 2239 void function(TraceLogCallback callback) SetTraceLogCallback; // Set custom trace log 2240 void function(LoadFileDataCallback callback) SetLoadFileDataCallback; // Set custom file binary data loader 2241 void function(SaveFileDataCallback callback) SetSaveFileDataCallback; // Set custom file binary data saver 2242 void function(LoadFileTextCallback callback) SetLoadFileTextCallback; // Set custom file text data loader 2243 void function(SaveFileTextCallback callback) SetSaveFileTextCallback; // Set custom file text data saver 2244 2245 // Files management functions 2246 ubyte* function(const(char)* fileName, uint* bytesRead) LoadFileData; // Load file data as byte array (read) 2247 void function(ubyte* data) UnloadFileData; // Unload file data allocated by LoadFileData() 2248 bool function(const(char)* fileName, void* data, uint bytesToWrite) SaveFileData; // Save data to file from byte array (write), returns true on success 2249 char* function(const(char)* fileName) LoadFileText; // Load text data from file (read), returns a '\0' terminated string 2250 void function(char* text) UnloadFileText; // Unload file text data allocated by LoadFileText() 2251 bool function(const(char)* fileName, char* text) SaveFileText; // Save text data to file (write), string must be '\0' terminated, returns true on success 2252 bool function(const(char)* fileName) FileExists; // Check if file exists 2253 bool function(const(char)* dirPath) DirectoryExists; // Check if a directory path exists 2254 bool function(const(char)* fileName, const(char)* ext) IsFileExtension; // Check file extension (including point: .png, .wav) 2255 const(char)* function(const(char)* fileName) GetFileExtension; // Get pointer to extension for a filename string (includes dot: '.png') 2256 const(char)* function(const(char)* filePath) GetFileName; // Get pointer to filename for a path string 2257 const(char)* function(const(char)* filePath) GetFileNameWithoutExt; // Get filename string without extension (uses static string) 2258 const(char)* function(const(char)* filePath) GetDirectoryPath; // Get full path for a given fileName with path (uses static string) 2259 const(char)* function(const(char)* dirPath) GetPrevDirectoryPath; // Get previous directory path for a given path (uses static string) 2260 const(char)* function() GetWorkingDirectory; // Get current working directory (uses static string) 2261 char** function(const(char)* dirPath, int* count) GetDirectoryFiles; // Get filenames in a directory path (memory should be freed) 2262 void function() ClearDirectoryFiles; // Clear directory files paths buffers (free memory) 2263 bool function(const(char)* dir) ChangeDirectory; // Change working directory, return true on success 2264 bool function() IsFileDropped; // Check if a file has been dropped into window 2265 char** function(int* count) GetDroppedFiles; // Get dropped files names (memory should be freed) 2266 void function() ClearDroppedFiles; // Clear dropped files paths buffer (free memory) 2267 long function(const(char)* fileName) GetFileModTime; // Get file modification time (last write time) 2268 2269 // Compression/Encoding functionality 2270 ubyte* function(ubyte* data, int dataLength, int* compDataLength) CompressData; // Compress data (DEFLATE algorithm) 2271 ubyte* function(ubyte* compData, int compDataLength, int* dataLength) DecompressData; // Decompress data (DEFLATE algorithm) 2272 char* function(const ubyte* data, int dataLength, int* outputLength) EncodeDataBase64; // Encode data to Base64 string 2273 ubyte* function(ubyte* data, int* outputLength) DecodeDataBase64; // Decode Base64 string data 2274 2275 // Persistent storage management 2276 bool function(uint position, int value) SaveStorageValue; // Save integer value to storage file (to defined position), returns true on success 2277 int function(uint position) LoadStorageValue; // Load integer value from storage file (from defined position) 2278 2279 void function(const(char)* url) OpenURL; // Open URL with default system browser (if available) 2280 2281 //------------------------------------------------------------------------------------ 2282 // Input Handling Functions (Module: core) 2283 //------------------------------------------------------------------------------------ 2284 2285 // Input-related functions: keyboard 2286 bool function(int key) IsKeyPressed; // Check if a key has been pressed once 2287 bool function(int key) IsKeyDown; // Check if a key is being pressed 2288 bool function(int key) IsKeyReleased; // Check if a key has been released once 2289 bool function(int key) IsKeyUp; // Check if a key is NOT being pressed 2290 void function(int key) SetExitKey; // Set a custom key to exit program (default is ESC) 2291 int function() GetKeyPressed; // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty 2292 int function() GetCharPressed; // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty 2293 2294 // Input-related functions: gamepads 2295 bool function(int gamepad) IsGamepadAvailable; // Check if a gamepad is available 2296 const(char)* function(int gamepad) GetGamepadName; // Get gamepad internal name id 2297 bool function(int gamepad, int button) IsGamepadButtonPressed; // Check if a gamepad button has been pressed once 2298 bool function(int gamepad, int button) IsGamepadButtonDown; // Check if a gamepad button is being pressed 2299 bool function(int gamepad, int button) IsGamepadButtonReleased; // Check if a gamepad button has been released once 2300 bool function(int gamepad, int button) IsGamepadButtonUp; // Check if a gamepad button is NOT being pressed 2301 int function() GetGamepadButtonPressed; // Get the last gamepad button pressed 2302 int function(int gamepad) GetGamepadAxisCount; // Get gamepad axis count for a gamepad 2303 float function(int gamepad, int axis) GetGamepadAxisMovement; // Get axis movement value for a gamepad axis 2304 int function(const(char)* mappings) SetGamepadMappings; // Set internal gamepad mappings (SDL_GameControllerDB) 2305 2306 // Input-related functions: mouse 2307 bool function(int button) IsMouseButtonPressed; // Check if a mouse button has been pressed once 2308 bool function(int button) IsMouseButtonDown; // Check if a mouse button is being pressed 2309 bool function(int button) IsMouseButtonReleased; // Check if a mouse button has been released once 2310 bool function(int button) IsMouseButtonUp; // Check if a mouse button is NOT being pressed 2311 int function() GetMouseX; // Get mouse position X 2312 int function() GetMouseY; // Get mouse position Y 2313 Vector2 function() GetMousePosition; // Get mouse position XY 2314 Vector2 function() GetMouseDelta; // Get mouse delta between frames 2315 void function(int x, int y) SetMousePosition; // Set mouse position XY 2316 void function(int offsetX, int offsetY) SetMouseOffset; // Set mouse offset 2317 void function(float scaleX, float scaleY) SetMouseScale; // Set mouse scaling 2318 float function() GetMouseWheelMove; // Get mouse wheel movement Y 2319 void function(int cursor) SetMouseCursor; // Set mouse cursor 2320 2321 // Input-related functions: touch 2322 int function() GetTouchX; // Get touch position X for touch point 0 (relative to screen size) 2323 int function() GetTouchY; // Get touch position Y for touch point 0 (relative to screen size) 2324 Vector2 function(int index) GetTouchPosition; // Get touch position XY for a touch point index (relative to screen size) 2325 int function(int index) GetTouchPointId; // Get touch point identifier for given index 2326 int function() GetTouchPointCount; // Get number of touch points 2327 2328 //------------------------------------------------------------------------------------ 2329 // Gestures and Touch Handling Functions (Module: rgestures) 2330 //------------------------------------------------------------------------------------ 2331 2332 void function(uint flags) SetGesturesEnabled; // Enable a set of gestures using flags 2333 bool function(int gesture) IsGestureDetected; // Check if a gesture have been detected 2334 int function() GetGestureDetected; // Get latest detected gesture 2335 float function() GetGestureHoldDuration; // Get gesture hold time in milliseconds 2336 Vector2 function() GetGestureDragVector; // Get gesture drag vector 2337 float function() GetGestureDragAngle; // Get gesture drag angle 2338 Vector2 function() GetGesturePinchVector; // Get gesture pinch delta 2339 float function() GetGesturePinchAngle; // Get gesture pinch angle 2340 2341 //------------------------------------------------------------------------------------ 2342 // Camera System Functions (Module: rcamera) 2343 //------------------------------------------------------------------------------------ 2344 2345 void function(Camera camera, int mode) SetCameraMode; // Set camera mode (multiple camera modes available) 2346 void function(Camera* camera) UpdateCamera; // Update camera position for selected mode 2347 2348 void function(int keyPan) SetCameraPanControl; // Set camera pan key to combine with mouse movement (free camera) 2349 void function(int keyAlt) SetCameraAltControl; // Set camera alt key to combine with mouse movement (free camera) 2350 void function(int keySmoothZoom) SetCameraSmoothZoomControl; // Set camera smooth zoom key to combine with mouse (free camera) 2351 void function(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown) SetCameraMoveControls; // Set camera move controls (1st person and 3rd person cameras) 2352 2353 //------------------------------------------------------------------------------------ 2354 // Basic Shapes Drawing Functions (Module: shapes) 2355 //------------------------------------------------------------------------------------ 2356 2357 // Set texture and rectangle to be used on shapes drawing 2358 // NOTE: It can be useful when using basic shapes and one single font, 2359 // defining a font char white rectangle would allow drawing everything in a single draw call 2360 void function(Texture2D texture, Rectangle source) SetShapesTexture; // Set texture and rectangle to be used on shapes drawing 2361 2362 // Basic shapes drawing functions 2363 void function(int posX, int posY, Color color) DrawPixel; // Draw a pixel 2364 void function(Vector2 position, Color color) DrawPixelV; // Draw a pixel (Vector version) 2365 void function(int startPosX, int startPosY, int endPosX, int endPosY, Color color) DrawLine; // Draw a line 2366 void function(Vector2 startPos, Vector2 endPos, Color color) DrawLineV; // Draw a line (Vector version) 2367 void function(Vector2 startPos, Vector2 endPos, float thick, Color color) DrawLineEx; // Draw a line defining thickness 2368 void function(Vector2 startPos, Vector2 endPos, float thick, Color color) DrawLineBezier; // Draw a line using cubic-bezier curves in-out 2369 void function(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color) DrawLineBezierQuad; // Draw line using quadratic bezier curves with a control point 2370 void function(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color) DrawLineBezierCubic; // Draw line using cubic bezier curves with 2 control points 2371 void function(Vector2* points, int pointCount, Color color) DrawLineStrip; // Draw lines sequence 2372 void function(int centerX, int centerY, float radius, Color color) DrawCircle; // Draw a color-filled circle 2373 void function(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color) DrawCircleSector; // Draw a piece of a circle 2374 void function(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color) DrawCircleSectorLines; // Draw circle sector outline 2375 void function(int centerX, int centerY, float radius, Color color1, Color color2) DrawCircleGradient; // Draw a gradient-filled circle 2376 void function(Vector2 center, float radius, Color color) DrawCircleV; // Draw a color-filled circle (Vector version) 2377 void function(int centerX, int centerY, float radius, Color color) DrawCircleLines; // Draw circle outline 2378 void function(int centerX, int centerY, float radiusH, float radiusV, Color color) DrawEllipse; // Draw ellipse 2379 void function(int centerX, int centerY, float radiusH, float radiusV, Color color) DrawEllipseLines; // Draw ellipse outline 2380 void function(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color) DrawRing; // Draw ring 2381 void function(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color) DrawRingLines; // Draw ring outline 2382 void function(int posX, int posY, int width, int height, Color color) DrawRectangle; // Draw a color-filled rectangle 2383 void function(Vector2 position, Vector2 size, Color color) DrawRectangleV; // Draw a color-filled rectangle (Vector version) 2384 void function(Rectangle rec, Color color) DrawRectangleRec; // Draw a color-filled rectangle 2385 void function(Rectangle rec, Vector2 origin, float rotation, Color color) DrawRectanglePro; // Draw a color-filled rectangle with pro parameters 2386 void function(int posX, int posY, int width, int height, Color color1, Color color2) DrawRectangleGradientV; // Draw a vertical-gradient-filled rectangle 2387 void function(int posX, int posY, int width, int height, Color color1, Color color2) DrawRectangleGradientH; // Draw a horizontal-gradient-filled rectangle 2388 void function(Rectangle rec, Color col1, Color col2, Color col3, Color col4) DrawRectangleGradientEx; // Draw a gradient-filled rectangle with custom vertex colors 2389 void function(int posX, int posY, int width, int height, Color color) DrawRectangleLines; // Draw rectangle outline 2390 void function(Rectangle rec, float lineThick, Color color) DrawRectangleLinesEx; // Draw rectangle outline with extended parameters 2391 void function(Rectangle rec, float roundness, int segments, Color color) DrawRectangleRounded; // Draw rectangle with rounded edges 2392 void function(Rectangle rec, float roundness, int segments, float lineThick, Color color) DrawRectangleRoundedLines; // Draw rectangle with rounded edges outline 2393 void function(Vector2 v1, Vector2 v2, Vector2 v3, Color color) DrawTriangle; // Draw a color-filled triangle (vertex in counter-clockwise order!) 2394 void function(Vector2 v1, Vector2 v2, Vector2 v3, Color color) DrawTriangleLines; // Draw triangle outline (vertex in counter-clockwise order!) 2395 void function(Vector2* points, int pointCount, Color color) DrawTriangleFan; // Draw a triangle fan defined by points (first vertex is the center) 2396 void function(Vector2* points, int pointCount, Color color) DrawTriangleStrip; // Draw a triangle strip defined by points 2397 void function(Vector2 center, int sides, float radius, float rotation, Color color) DrawPoly; // Draw a regular polygon (Vector version) 2398 void function(Vector2 center, int sides, float radius, float rotation, Color color) DrawPolyLines; // Draw a polygon outline of n sides 2399 void function(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color) DrawPolyLinesEx; // Draw a polygon outline of n sides with extended parameters 2400 2401 // Basic shapes collision detection functions 2402 bool function(Rectangle rec1, Rectangle rec2) CheckCollisionRecs; // Check collision between two rectangles 2403 bool function(Vector2 center1, float radius1, Vector2 center2, float radius2) CheckCollisionCircles; // Check collision between two circles 2404 bool function(Vector2 center, float radius, Rectangle rec) CheckCollisionCircleRec; // Check collision between circle and rectangle 2405 bool function(Vector2 point, Rectangle rec) CheckCollisionPointRec; // Check if point is inside rectangle 2406 bool function(Vector2 point, Vector2 center, float radius) CheckCollisionPointCircle; // Check if point is inside circle 2407 bool function(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3) CheckCollisionPointTriangle; // Check if point is inside a triangle 2408 bool function(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2* collisionPoint) CheckCollisionLines; // Check the collision between two lines defined by two points each, returns collision point by reference 2409 bool function(Vector2 point, Vector2 p1, Vector2 p2, int threshold) CheckCollisionPointLine; // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] 2410 Rectangle function(Rectangle rec1, Rectangle rec2) GetCollisionRec; // Get collision rectangle for two rectangles collision 2411 2412 //------------------------------------------------------------------------------------ 2413 // Texture Loading and Drawing Functions (Module: textures) 2414 //------------------------------------------------------------------------------------ 2415 2416 // Image loading functions 2417 // NOTE: This functions do not require GPU access 2418 Image function(const(char)* fileName) LoadImage; // Load image from file into CPU memory (RAM) 2419 Image function(const(char)* fileName, int width, int height, int format, int headerSize) LoadImageRaw; // Load image from RAW file data 2420 Image function(const(char)* fileName, int* frames) LoadImageAnim; // Load image sequence from file (frames appended to image.data) 2421 Image function(const(char)* fileType, const ubyte* fileData, int dataSize) LoadImageFromMemory; // Load image from memory buffer, fileType refers to extension: i.e. '.png' 2422 Image function(Texture2D texture) LoadImageFromTexture; // Load image from GPU texture data 2423 Image function() LoadImageFromScreen; // Load image from screen buffer and (screenshot) 2424 void function(Image image) UnloadImage; // Unload image from CPU memory (RAM) 2425 bool function(Image image, const(char)* fileName) ExportImage; // Export image data to file, returns true on success 2426 bool function(Image image, const(char)* fileName) ExportImageAsCode; // Export image as code file defining an array of bytes, returns true on success 2427 2428 // Image generation functions 2429 Image function(int width, int height, Color color) GenImageColor; // Generate image: plain color 2430 Image function(int width, int height, Color top, Color bottom) GenImageGradientV; // Generate image: vertical gradient 2431 Image function(int width, int height, Color left, Color right) GenImageGradientH; // Generate image: horizontal gradient 2432 Image function(int width, int height, float density, Color inner, Color outer) GenImageGradientRadial; // Generate image: radial gradient 2433 Image function(int width, int height, int checksX, int checksY, Color col1, Color col2) GenImageChecked; // Generate image: checked 2434 Image function(int width, int height, float factor) GenImageWhiteNoise; // Generate image: white noise 2435 Image function(int width, int height, int tileSize) GenImageCellular; // Generate image: cellular algorithm, bigger tileSize means bigger cells 2436 2437 // Image manipulation functions 2438 Image function(Image image) ImageCopy; // Create an image duplicate (useful for transformations) 2439 Image function(Image image, Rectangle rec) ImageFromImage; // Create an image from another image piece 2440 Image function(const(char)* text, int fontSize, Color color) ImageText; // Create an image from text (default font) 2441 Image function(Font font, const(char)* text, float fontSize, float spacing, Color tint) ImageTextEx; // Create an image from text (custom sprite font) 2442 void function(Image* image, int newFormat) ImageFormat; // Convert image data to desired format 2443 void function(Image* image, Color fill) ImageToPOT; // Convert image to POT (power-of-two) 2444 void function(Image* image, Rectangle crop) ImageCrop; // Crop an image to a defined rectangle 2445 void function(Image* image, float threshold) ImageAlphaCrop; // Crop image depending on alpha value 2446 void function(Image* image, Color color, float threshold) ImageAlphaClear; // Clear alpha channel to desired color 2447 void function(Image* image, Image alphaMask) ImageAlphaMask; // Apply alpha mask to image 2448 void function(Image* image) ImageAlphaPremultiply; // Premultiply alpha channel 2449 void function(Image* image, int newWidth, int newHeight) ImageResize; // Resize image (Bicubic scaling algorithm) 2450 void function(Image* image, int newWidth,int newHeight) ImageResizeNN; // Resize image (Nearest-Neighbor scaling algorithm) 2451 void function(Image* image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill) ImageResizeCanvas; // Resize canvas and fill with color 2452 void function(Image* image) ImageMipmaps; // Compute all mipmap levels for a provided image 2453 void function(Image* image, int rBpp, int gBpp, int bBpp, int aBpp) ImageDither; // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) 2454 void function(Image* image) ImageFlipVertical; // Flip image vertically 2455 void function(Image* image) ImageFlipHorizontal; // Flip image horizontally 2456 void function(Image* image) ImageRotateCW; // Rotate image clockwise 90deg 2457 void function(Image* image) ImageRotateCCW; // Rotate image counter-clockwise 90deg 2458 void function(Image* image, Color color) ImageColorTint; // Modify image color: tint 2459 void function(Image* image) ImageColorInvert; // Modify image color: invert 2460 void function(Image* image) ImageColorGrayscale; // Modify image color: grayscale 2461 void function(Image* image, float contrast) ImageColorContrast; // Modify image color: contrast (-100 to 100) 2462 void function(Image* image, int brightness) ImageColorBrightness; // Modify image color: brightness (-255 to 255) 2463 void function(Image* image, Color color, Color replace) ImageColorReplace; // Modify image color: replace color 2464 Color* function(Image image) LoadImageColors; // Load color data from image as a Color array (RGBA - 32bit) 2465 Color* function(Image image, int maxPaletteSize, int* colorCount) LoadImagePalette; // Load colors palette from image as a Color array (RGBA - 32bit) 2466 void function(Color* colors) UnloadImageColors; // Unload color data loaded with LoadImageColors() 2467 void function(Color* colors) UnloadImagePalette; // Unload colors palette loaded with LoadImagePalette() 2468 Rectangle function(Image image, float threshold) GetImageAlphaBorder; // Get image alpha border rectangle 2469 Color function(Image image, int x, int y) GetImageColor; // Get image pixel color at (x, y) position 2470 2471 // Image drawing functions 2472 // NOTE: Image software-rendering functions (CPU) 2473 void function(Image* dst, Color color) ImageClearBackground; // Clear image background with given color 2474 void function(Image* dst, int posX, int posY, Color color) ImageDrawPixel; // Draw pixel within an image 2475 void function(Image* dst, Vector2 position, Color color) ImageDrawPixelV; // Draw pixel within an image (Vector version) 2476 void function(Image* dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color) ImageDrawLine; // Draw line within an image 2477 void function(Image* dst, Vector2 start, Vector2 end, Color color) ImageDrawLineV; // Draw line within an image (Vector version) 2478 void function(Image* dst, int centerX, int centerY, int radius, Color color) ImageDrawCircle; // Draw circle within an image 2479 void function(Image* dst, Vector2 center, int radius, Color color) ImageDrawCircleV; // Draw circle within an image (Vector version) 2480 void function(Image* dst, int posX, int posY, int width, int height, Color color) ImageDrawRectangle; // Draw rectangle within an image 2481 void function(Image* dst, Vector2 position, Vector2 size, Color color) ImageDrawRectangleV; // Draw rectangle within an image (Vector version) 2482 void function(Image* dst, Rectangle rec, Color color) ImageDrawRectangleRec; // Draw rectangle within an image 2483 void function(Image* dst, Rectangle rec, int thick, Color color) ImageDrawRectangleLines; // Draw rectangle lines within an image 2484 void function(Image* dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint) ImageDraw; // Draw a source image within a destination image (tint applied to source) 2485 void function(Image* dst, const(char)* text, int posX, int posY, int fontSize, Color color) ImageDrawText; // Draw text (using default font) within an image (destination) 2486 void function(Image* dst, Font font, const(char)* text, Vector2 position, float fontSize, float spacing, Color tint) ImageDrawTextEx; // Draw text (custom sprite font) within an image (destination) 2487 2488 // Texture loading functions 2489 // NOTE: These functions require GPU access 2490 Texture2D function(const(char)* fileName) LoadTexture; // Load texture from file into GPU memory (VRAM) 2491 Texture2D function(Image image) LoadTextureFromImage; // Load texture from image data 2492 TextureCubemap function(Image image, int layout) LoadTextureCubemap; // Load cubemap from image, multiple image cubemap layouts supported 2493 RenderTexture2D function(int width, int height) LoadRenderTexture; // Load texture for rendering (framebuffer) 2494 void function(Texture2D texture) UnloadTexture; // Unload texture from GPU memory (VRAM) 2495 void function(RenderTexture2D target) UnloadRenderTexture; // Unload render texture from GPU memory (VRAM) 2496 void function(Texture2D texture, const void* pixels) UpdateTexture; // Update GPU texture with new data 2497 void function(Texture2D texture, Rectangle rec, const void* pixels) UpdateTextureRec; // Update GPU texture rectangle with new data 2498 2499 // Texture configuration functions 2500 void function(Texture2D* texture) GenTextureMipmaps; // Generate GPU mipmaps for a texture 2501 void function(Texture2D texture, int filter) SetTextureFilter; // Set texture scaling filter mode 2502 void function(Texture2D texture, int wrap) SetTextureWrap; // Set texture wrapping mode 2503 2504 // Texture drawing functions 2505 void function(Texture2D texture, int posX, int posY, Color tint) DrawTexture; // Draw a Texture2D 2506 void function(Texture2D texture, Vector2 position, Color tint) DrawTextureV; // Draw a Texture2D with position defined as Vector2 2507 void function(Texture2D texture, Vector2 position, float rotation, float scale, Color tint) DrawTextureEx; // Draw a Texture2D with extended parameters 2508 void function(Texture2D texture, Rectangle source, Vector2 position, Color tint) DrawTextureRec; // Draw a part of a texture defined by a rectangle 2509 void function(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint) DrawTextureQuad; // Draw texture quad with tiling and offset parameters 2510 void function(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint) DrawTextureTiled; // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. 2511 void function(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint) DrawTexturePro; // Draw a part of a texture defined by a rectangle with 'pro' parameters 2512 void function(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint) DrawTextureNPatch; // Draws a texture (or part of it) that stretches or shrinks nicely 2513 void function(Texture2D texture, Vector2 center, Vector2* points, Vector2* texcoords, int pointCount, Color tint) DrawTexturePoly; // Draw a textured polygon 2514 2515 // Color/pixel related functions 2516 Color function(Color color, float alpha) Fade; // Get color with alpha applied, alpha goes from 0.0f to 1.0f 2517 int function(Color color) ColorToInt; // Get hexadecimal value for a Color 2518 Vector4 function(Color color) ColorNormalize; // Get Color normalized as float [0..1] 2519 Color function(Vector4 normalized) ColorFromNormalized; // Get Color from normalized values [0..1] 2520 Vector3 function(Color color) ColorToHSV; // Get HSV values for a Color, hue [0..360], saturation/value [0..1] 2521 Color function(float hue, float saturation, float value) ColorFromHSV; // Get a Color from HSV values, hue [0..360], saturation/value [0..1] 2522 Color function(Color color, float alpha) ColorAlpha; // Get color with alpha applied, alpha goes from 0.0f to 1.0f 2523 Color function(Color dst, Color src, Color tint) ColorAlphaBlend; // Get src alpha-blended into dst color with tint 2524 Color function(uint hexValue) GetColor; // Get Color structure from hexadecimal value 2525 Color function(void* srcPtr, int format) GetPixelColor; // Get Color from a source pixel pointer of certain format 2526 void function(void* dstPtr, Color color, int format) SetPixelColor; // Set color formatted into destination pixel pointer 2527 int function(int width, int height, int format) GetPixelDataSize; // Get pixel data size in bytes for certain format 2528 2529 //------------------------------------------------------------------------------------ 2530 // Font Loading and Text Drawing Functions (Module: text) 2531 //------------------------------------------------------------------------------------ 2532 2533 // Font loading/unloading functions 2534 Font function() GetFontDefault; // Get the default Font 2535 Font function(const(char)* fileName) LoadFont; // Load font from file into GPU memory (VRAM) 2536 Font function(const(char)* fileName, int fontSize, int* fontChars, int glyphCount) LoadFontEx; // Load font from file with extended parameters 2537 Font function(Image image, Color key, int firstChar) LoadFontFromImage; // Load font from Image (XNA style) 2538 Font function(const(char)* fileType, const ubyte* fileData, int dataSize, int fontSize, int* fontChars, int glyphCount) LoadFontFromMemory; // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' 2539 GlyphInfo* function(const ubyte* fileData, int dataSize, int fontSize, int* fontChars, int glyphCount, int type) LoadFontData; // Load font data for further use 2540 Image function(const GlyphInfo* chars, Rectangle* *recs, int glyphCount, int fontSize, int padding, int packMethod) GenImageFontAtlas; // Generate image font atlas using chars info 2541 void function(GlyphInfo* chars, int glyphCount) UnloadFontData; // Unload font chars info data (RAM) 2542 void function(Font font) UnloadFont; // Unload Font from GPU memory (VRAM) 2543 2544 // Text drawing functions 2545 void function(int posX, int posY) DrawFPS; // Draw current FPS 2546 void function(const(char)* text, int posX, int posY, int fontSize, Color color) DrawText; // Draw text (using default font) 2547 void function(Font font, const(char)* text, Vector2 position, float fontSize, float spacing, Color tint) DrawTextEx; // Draw text using font and additional parameters 2548 void function(Font font, const(char)* text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint) DrawTextPro; // Draw text using Font and pro parameters (rotation) 2549 void function(Font font, int codepoint, Vector2 position, float fontSize, Color tint) DrawTextCodepoint; // Draw one character (codepoint) 2550 2551 // Text font info functions 2552 int function(const(char)* text, int fontSize) MeasureText; // Measure string width for default font 2553 Vector2 function(Font font, const(char)* text, float fontSize, float spacing) MeasureTextEx; // Measure string size for Font 2554 int function(Font font, int codepoint) GetGlyphIndex; // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found 2555 GlyphInfo function(Font font, int codepoint) GetGlyphInfo; // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found 2556 Rectangle function(Font font, int codepoint) GetGlyphAtlasRec; // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found 2557 2558 // Text codepoints management functions (unicode characters) 2559 int* function(const(char)* text, int* count) LoadCodepoints; // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter 2560 void function(int* codepoints) UnloadCodepoints; // Unload codepoints data from memory 2561 int function(const(char)* text) GetCodepointCount; // Get total number of codepoints in a UTF-8 encoded string 2562 int function(const(char)* text, int* bytesProcessed) GetCodepoint; // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure 2563 const(char)* function(int codepoint, int* byteSize) CodepointToUTF8; // Encode one codepoint into UTF-8 byte array (array length returned as parameter) 2564 char* function(int* codepoints, int length) TextCodepointsToUTF8; // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!) 2565 2566 // Text strings management functions (no UTF-8 strings, only byte chars) 2567 // NOTE: Some strings allocate memory internally for returned strings, just be careful! 2568 int function(char* dst, const(char)* src) TextCopy; // Copy one string to another, returns bytes copied 2569 bool function(const(char)* text1, const(char)* text2) TextIsEqual; // Check if two text string are equal 2570 uint function(const(char)* text) TextLength; // Get text length, checks for '\0' ending 2571 const(char)* function(const(char)* text, ...) TextFormat; // Text formatting with variables (sprintf() style) 2572 const(char)* function(const(char)* text, int position, int length) TextSubtext; // Get a piece of a text string 2573 char* function(char* text, const(char)* replace, const(char)* by) TextReplace; // Replace text string (WARNING: memory must be freed!) 2574 char* function(const(char)* text, const(char)* insert, int position) TextInsert; // Insert text in a position (WARNING: memory must be freed!) 2575 const(char)* function(const(char)** textList, int count, const(char)* delimiter) TextJoin; // Join text strings with delimiter 2576 const(char)** function(const(char)* text, char delimiter, int* count) TextSplit; // Split text into multiple strings 2577 void function(char* text, const(char)* append, int* position) TextAppend; // Append text at specific position and move cursor! 2578 int function(const(char)* text, const(char)* find) TextFindIndex; // Find first text occurrence within a string 2579 const(char)* function(const(char)* text) TextToUpper; // Get upper case version of provided string 2580 const(char)* function(const(char)* text) TextToLower; // Get lower case version of provided string 2581 const(char)* function(const(char)* text) TextToPascal; // Get Pascal case notation version of provided string 2582 int function(const(char)* text) TextToInteger; // Get integer value from text (negative values not supported) 2583 2584 //------------------------------------------------------------------------------------ 2585 // Basic 3d Shapes Drawing Functions (Module: models) 2586 //------------------------------------------------------------------------------------ 2587 2588 // Basic geometric 3D shapes drawing functions 2589 void function(Vector3 startPos, Vector3 endPos, Color color) DrawLine3D; // Draw a line in 3D world space 2590 void function(Vector3 position, Color color) DrawPoint3D; // Draw a point in 3D space, actually a small line 2591 void function(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color) DrawCircle3D; // Draw a circle in 3D world space 2592 void function(Vector3 v1, Vector3 v2, Vector3 v3, Color color) DrawTriangle3D; // Draw a color-filled triangle (vertex in counter-clockwise order!) 2593 void function(Vector3* points, int pointCount, Color color) DrawTriangleStrip3D; // Draw a triangle strip defined by points 2594 void function(Vector3 position, float width, float height, float length, Color color) DrawCube; // Draw cube 2595 void function(Vector3 position, Vector3 size, Color color) DrawCubeV; // Draw cube (Vector version) 2596 void function(Vector3 position, float width, float height, float length, Color color) DrawCubeWires; // Draw cube wires 2597 void function(Vector3 position, Vector3 size, Color color) DrawCubeWiresV; // Draw cube wires (Vector version) 2598 void function(Texture2D texture, Vector3 position, float width, float height, float length, Color color) DrawCubeTexture; // Draw cube textured 2599 void function(Texture2D texture, Rectangle source, Vector3 position, float width, float height, float length, Color color) DrawCubeTextureRec; // Draw cube with a region of a texture 2600 void function(Vector3 centerPos, float radius, Color color) DrawSphere; // Draw sphere 2601 void function(Vector3 centerPos, float radius, int rings, int slices, Color color) DrawSphereEx; // Draw sphere with extended parameters 2602 void function(Vector3 centerPos, float radius, int rings, int slices, Color color) DrawSphereWires; // Draw sphere wires 2603 void function(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color) DrawCylinder; // Draw a cylinder/cone 2604 void function(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color) DrawCylinderEx; // Draw a cylinder with base at startPos and top at endPos 2605 void function(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color) DrawCylinderWires; // Draw a cylinder/cone wires 2606 void function(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color) DrawCylinderWiresEx; // Draw a cylinder wires with base at startPos and top at endPos 2607 void function(Vector3 centerPos, Vector2 size, Color color) DrawPlane; // Draw a plane XZ 2608 void function(Ray ray, Color color) DrawRay; // Draw a ray line 2609 void function(int slices, float spacing) DrawGrid; // Draw a grid (centered at (0, 0, 0)) 2610 2611 //------------------------------------------------------------------------------------ 2612 // Model 3d Loading and Drawing Functions (Module: models) 2613 //------------------------------------------------------------------------------------ 2614 2615 // Model management functions 2616 Model function(const(char)* fileName) LoadModel; // Load model from files (meshes and materials) 2617 Model function(Mesh mesh) LoadModelFromMesh; // Load model from generated mesh (default material) 2618 void function(Model model) UnloadModel; // Unload model (including meshes) from memory (RAM and/or VRAM) 2619 void function(Model model) UnloadModelKeepMeshes; // Unload model (but not meshes) from memory (RAM and/or VRAM) 2620 BoundingBox function(Model model) GetModelBoundingBox; // Compute model bounding box limits (considers all meshes) 2621 2622 // Model drawing functions 2623 void function(Model model, Vector3 position, float scale, Color tint) DrawModel; // Draw a model (with texture if set) 2624 void function(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) DrawModelEx; // Draw a model with extended parameters 2625 void function(Model model, Vector3 position, float scale, Color tint) DrawModelWires; // Draw a model wires (with texture if set) 2626 void function(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) DrawModelWiresEx; // Draw a model wires (with texture if set) with extended parameters 2627 void function(BoundingBox box, Color color) DrawBoundingBox; // Draw bounding box (wires) 2628 void function(Camera camera, Texture2D texture, Vector3 position, float size, Color tint) DrawBillboard; // Draw a billboard texture 2629 void function(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint) DrawBillboardRec; // Draw a billboard texture defined by source 2630 void function(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint) DrawBillboardPro; // Draw a billboard texture defined by source and rotation 2631 2632 // Mesh management functions 2633 void function(Mesh* mesh, bool dynamic) UploadMesh; // Upload mesh vertex data in GPU and provide VAO/VBO ids 2634 void function(Mesh mesh, int index, void* data, int dataSize, int offset) UpdateMeshBuffer; // Update mesh vertex data in GPU for a specific buffer index 2635 void function(Mesh mesh) UnloadMesh; // Unload mesh data from CPU and GPU 2636 void function(Mesh mesh, Material material, Matrix transform) DrawMesh; // Draw a 3d mesh with material and transform 2637 void function(Mesh mesh, Material material, Matrix* transforms, int instances) DrawMeshInstanced; // Draw multiple mesh instances with material and different transforms 2638 bool function(Mesh mesh, const(char)* fileName) ExportMesh; // Export mesh data to file, returns true on success 2639 BoundingBox function(Mesh mesh) GetMeshBoundingBox; // Compute mesh bounding box limits 2640 void function(Mesh* mesh) GenMeshTangents; // Compute mesh tangents 2641 void function(Mesh* mesh) GenMeshBinormals; // Compute mesh binormals 2642 2643 // Mesh generation functions 2644 Mesh function(int sides, float radius) GenMeshPoly; // Generate polygonal mesh 2645 Mesh function(float width, float length, int resX, int resZ) GenMeshPlane; // Generate plane mesh (with subdivisions) 2646 Mesh function(float width, float height, float length) GenMeshCube; // Generate cuboid mesh 2647 Mesh function(float radius, int rings, int slices) GenMeshSphere; // Generate sphere mesh (standard sphere) 2648 Mesh function(float radius, int rings, int slices) GenMeshHemiSphere; // Generate half-sphere mesh (no bottom cap) 2649 Mesh function(float radius, float height, int slices) GenMeshCylinder; // Generate cylinder mesh 2650 Mesh function(float radius, float height, int slices) GenMeshCone; // Generate cone/pyramid mesh 2651 Mesh function(float radius, float size, int radSeg, int sides) GenMeshTorus; // Generate torus mesh 2652 Mesh function(float radius, float size, int radSeg, int sides) GenMeshKnot; // Generate trefoil knot mesh 2653 Mesh function(Image heightmap, Vector3 size) GenMeshHeightmap; // Generate heightmap mesh from image data 2654 Mesh function(Image cubicmap, Vector3 cubeSize) GenMeshCubicmap; // Generate cubes-based map mesh from image data 2655 2656 // Material loading/unloading functions 2657 Material* function(const(char)* fileName, int* materialCount) LoadMaterials; // Load materials from model file 2658 Material function() LoadMaterialDefault; // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) 2659 void function(Material material) UnloadMaterial; // Unload material from GPU memory (VRAM) 2660 void function(Material* material, int mapType, Texture2D texture) SetMaterialTexture; // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) 2661 void function(Model* model, int meshId, int materialId) SetModelMeshMaterial; // Set material for a mesh 2662 2663 // Model animations loading/unloading functions 2664 ModelAnimation* function(const(char)* fileName, uint* animCount) LoadModelAnimations; // Load model animations from file 2665 void function(Model model, ModelAnimation anim, int frame) UpdateModelAnimation; // Update model animation pose 2666 void function(ModelAnimation anim) UnloadModelAnimation; // Unload animation data 2667 void function(ModelAnimation* animations, uint count) UnloadModelAnimations; // Unload animation array data 2668 bool function(Model model, ModelAnimation anim) IsModelAnimationValid; // Check model animation skeleton match 2669 2670 // Collision detection functions 2671 bool function(Vector3 center1, float radius1, Vector3 center2, float radius2) CheckCollisionSpheres; // Check collision between two spheres 2672 bool function(BoundingBox box1, BoundingBox box2) CheckCollisionBoxes; // Check collision between two bounding boxes 2673 bool function(BoundingBox box, Vector3 center, float radius) CheckCollisionBoxSphere; // Check collision between box and sphere 2674 RayCollision function(Ray ray, Vector3 center, float radius) GetRayCollisionSphere; // Get collision info between ray and sphere 2675 RayCollision function(Ray ray, BoundingBox box) GetRayCollisionBox; // Get collision info between ray and box 2676 RayCollision function(Ray ray, Model model) GetRayCollisionModel; // Get collision info between ray and model 2677 RayCollision function(Ray ray, Mesh mesh, Matrix transform) GetRayCollisionMesh; // Get collision info between ray and mesh 2678 RayCollision function(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3) GetRayCollisionTriangle; // Get collision info between ray and triangle 2679 RayCollision function(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4) GetRayCollisionQuad; // Get collision info between ray and quad 2680 2681 //------------------------------------------------------------------------------------ 2682 // Audio Loading and Playing Functions (Module: audio) 2683 //------------------------------------------------------------------------------------ 2684 2685 // Audio device management functions 2686 void function() InitAudioDevice; // Initialize audio device and context 2687 void function() CloseAudioDevice; // Close the audio device and context 2688 bool function() IsAudioDeviceReady; // Check if audio device has been initialized successfully 2689 void function(float volume) SetMasterVolume; // Set master volume (listener) 2690 2691 // Wave/Sound loading/unloading functions 2692 Wave function(const(char)* fileName) LoadWave; // Load wave data from file 2693 Wave function(const(char)* fileType, const ubyte* fileData, int dataSize) LoadWaveFromMemory; // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' 2694 Sound function(const(char)* fileName) LoadSound; // Load sound from file 2695 Sound function(Wave wave) LoadSoundFromWave; // Load sound from wave data 2696 void function(Sound sound, const void* data, int sampleCount) UpdateSound; // Update sound buffer with new data 2697 void function(Wave wave) UnloadWave; // Unload wave data 2698 void function(Sound sound) UnloadSound; // Unload sound 2699 bool function(Wave wave, const(char)* fileName) ExportWave; // Export wave data to file, returns true on success 2700 bool function(Wave wave, const(char)* fileName) ExportWaveAsCode; // Export wave sample data to code (.h), returns true on success 2701 2702 // Wave/Sound management functions 2703 void function(Sound sound) PlaySound; // Play a sound 2704 void function(Sound sound) StopSound; // Stop playing a sound 2705 void function(Sound sound) PauseSound; // Pause a sound 2706 void function(Sound sound) ResumeSound; // Resume a paused sound 2707 void function(Sound sound) PlaySoundMulti; // Play a sound (using multichannel buffer pool) 2708 void function() StopSoundMulti; // Stop any sound playing (using multichannel buffer pool) 2709 int function() GetSoundsPlaying; // Get number of sounds playing in the multichannel 2710 bool function(Sound sound) IsSoundPlaying; // Check if a sound is currently playing 2711 void function(Sound sound, float volume) SetSoundVolume; // Set volume for a sound (1.0 is max level) 2712 void function(Sound sound, float pitch) SetSoundPitch; // Set pitch for a sound (1.0 is base level) 2713 void function(Wave* wave, int sampleRate, int sampleSize, int channels) WaveFormat; // Convert wave data to desired format 2714 Wave function(Wave wave) WaveCopy; // Copy a wave to a new wave 2715 void function(Wave* wave, int initSample, int finalSample) WaveCrop; // Crop a wave to defined samples range 2716 float* function(Wave wave) LoadWaveSamples; // Load samples data from wave as a floats array 2717 void function(float* samples) UnloadWaveSamples; // Unload samples data loaded with LoadWaveSamples() 2718 2719 // Music management functions 2720 Music function(const(char)* fileName) LoadMusicStream; // Load music stream from file 2721 Music function(const(char)* fileType, ubyte* data, int dataSize) LoadMusicStreamFromMemory; // Load music stream from data 2722 void function(Music music) UnloadMusicStream; // Unload music stream 2723 void function(Music music) PlayMusicStream; // Start music playing 2724 bool function(Music music) IsMusicStreamPlaying; // Check if music is playing 2725 void function(Music music) UpdateMusicStream; // Updates buffers for music streaming 2726 void function(Music music) StopMusicStream; // Stop music playing 2727 void function(Music music) PauseMusicStream; // Pause music playing 2728 void function(Music music) ResumeMusicStream; // Resume playing paused music 2729 void function(Music music, float position) SeekMusicStream; // Seek music to a position (in seconds) 2730 void function(Music music, float volume) SetMusicVolume; // Set volume for music (1.0 is max level) 2731 void function(Music music, float pitch) SetMusicPitch; // Set pitch for a music (1.0 is base level) 2732 float function(Music music) GetMusicTimeLength; // Get music time length (in seconds) 2733 float function(Music music) GetMusicTimePlayed; // Get current music time played (in seconds) 2734 2735 // AudioStream management functions 2736 AudioStream function(uint sampleRate, uint sampleSize, uint channels) LoadAudioStream; // Load audio stream (to stream raw audio pcm data) 2737 void function(AudioStream stream) UnloadAudioStream; // Unload audio stream and free memory 2738 void function(AudioStream stream, const void* data, int frameCount) UpdateAudioStream; // Update audio stream buffers with data 2739 bool function(AudioStream stream) IsAudioStreamProcessed; // Check if any audio stream buffers requires refill 2740 void function(AudioStream stream) PlayAudioStream; // Play audio stream 2741 void function(AudioStream stream) PauseAudioStream; // Pause audio stream 2742 void function(AudioStream stream) ResumeAudioStream; // Resume audio stream 2743 bool function(AudioStream stream) IsAudioStreamPlaying; // Check if audio stream is playing 2744 void function(AudioStream stream) StopAudioStream; // Stop audio stream 2745 void function(AudioStream stream, float volume) SetAudioStreamVolume; // Set volume for audio stream (1.0 is max level) 2746 void function(AudioStream stream, float pitch) SetAudioStreamPitch; // Set pitch for audio stream (1.0 is base level) 2747 void function(int size) SetAudioStreamBufferSizeDefault; // Default size for new audio streams 2748 }