raylib_to_parse.h 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. //------------------------------------------------------------------------------------
  2. // Window and Graphics Device Functions (Module: core)
  3. //------------------------------------------------------------------------------------
  4. // Window-related functions
  5. RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context
  6. RLAPI void CloseWindow(void); // Close window and unload OpenGL context
  7. RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully
  8. RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed
  9. RLAPI bool IsWindowMinimized(void); // Check if window has been minimized (or lost focus)
  10. RLAPI void ToggleFullscreen(void); // Toggle fullscreen mode (only PLATFORM_DESKTOP)
  11. RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP)
  12. RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP)
  13. RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP)
  14. RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode)
  15. RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
  16. RLAPI void SetWindowSize(int width, int height); // Set window dimensions
  17. RLAPI int GetScreenWidth(void); // Get current screen width
  18. RLAPI int GetScreenHeight(void); // Get current screen height
  19. // Cursor-related functions
  20. RLAPI void ShowCursor(void); // Shows cursor
  21. RLAPI void HideCursor(void); // Hides cursor
  22. RLAPI bool IsCursorHidden(void); // Check if cursor is not visible
  23. RLAPI void EnableCursor(void); // Enables cursor (unlock cursor)
  24. RLAPI void DisableCursor(void); // Disables cursor (lock cursor)
  25. // Drawing-related functions
  26. RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color)
  27. RLAPI void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing
  28. RLAPI void EndDrawing(void); // End canvas drawing and swap buffers (double buffering)
  29. RLAPI void BeginMode2D(Camera2D camera); // Initialize 2D mode with custom camera (2D)
  30. RLAPI void EndMode2D(void); // Ends 2D mode with custom camera
  31. RLAPI void BeginMode3D(Camera3D camera); // Initializes 3D mode with custom camera (3D)
  32. RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode
  33. RLAPI void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing
  34. RLAPI void EndTextureMode(void); // Ends drawing to render texture
  35. // Screen-space-related functions
  36. RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position
  37. RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position for a 3d world space position
  38. RLAPI Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix)
  39. // Timming-related functions
  40. RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum)
  41. RLAPI int GetFPS(void); // Returns current FPS
  42. RLAPI float GetFrameTime(void); // Returns time in seconds for last frame drawn
  43. RLAPI double GetTime(void); // Returns elapsed time in seconds since InitWindow()
  44. // Color-related functions
  45. RLAPI int ColorToInt(Color color); // Returns hexadecimal value for a Color
  46. RLAPI Vector4 ColorNormalize(Color color); // Returns color normalized as float [0..1]
  47. RLAPI Vector3 ColorToHSV(Color color); // Returns HSV values for a Color
  48. RLAPI Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value
  49. RLAPI Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f
  50. // Misc. functions
  51. RLAPI void ShowLogo(void); // Activate raylib logo at startup (can be done with flags)
  52. RLAPI void SetConfigFlags(unsigned char flags); // Setup window configuration flags (view FLAGS)
  53. RLAPI void SetTraceLog(unsigned char types); // Enable trace log message types (bit flags based)
  54. RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_DEBUG)
  55. RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png)
  56. RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included)
  57. // Files management functions
  58. RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension
  59. RLAPI const char *GetExtension(const char *fileName); // Get pointer to extension for a filename string
  60. RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string
  61. RLAPI const char *GetDirectoryPath(const char *fileName); // Get full path for a given fileName (uses static string)
  62. RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string)
  63. RLAPI bool ChangeDirectory(const char *dir); // Change working directory, returns true if success
  64. RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window
  65. RLAPI char **GetDroppedFiles(int *count); // Get dropped files names
  66. RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer
  67. // Persistent storage management
  68. RLAPI void StorageSaveValue(int position, int value); // Save integer value to storage file (to defined position)
  69. RLAPI int StorageLoadValue(int position); // Load integer value from storage file (from defined position)
  70. //------------------------------------------------------------------------------------
  71. // Input Handling Functions (Module: core)
  72. //------------------------------------------------------------------------------------
  73. // Input-related functions: keyboard
  74. RLAPI bool IsKeyPressed(int key); // Detect if a key has been pressed once
  75. RLAPI bool IsKeyDown(int key); // Detect if a key is being pressed
  76. RLAPI bool IsKeyReleased(int key); // Detect if a key has been released once
  77. RLAPI bool IsKeyUp(int key); // Detect if a key is NOT being pressed
  78. RLAPI int GetKeyPressed(void); // Get latest key pressed
  79. RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC)
  80. // Input-related functions: gamepads
  81. RLAPI bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available
  82. RLAPI bool IsGamepadName(int gamepad, const char *name); // Check gamepad name (if available)
  83. RLAPI const char *GetGamepadName(int gamepad); // Return gamepad internal name id
  84. RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once
  85. RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed
  86. RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once
  87. RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed
  88. RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed
  89. RLAPI int GetGamepadAxisCount(int gamepad); // Return gamepad axis count for a gamepad
  90. RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis
  91. // Input-related functions: mouse
  92. RLAPI bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once
  93. RLAPI bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed
  94. RLAPI bool IsMouseButtonReleased(int button); // Detect if a mouse button has been released once
  95. RLAPI bool IsMouseButtonUp(int button); // Detect if a mouse button is NOT being pressed
  96. RLAPI int GetMouseX(void); // Returns mouse position X
  97. RLAPI int GetMouseY(void); // Returns mouse position Y
  98. RLAPI Vector2 GetMousePosition(void); // Returns mouse position XY
  99. RLAPI void SetMousePosition(Vector2 position); // Set mouse position XY
  100. RLAPI void SetMouseScale(float scale); // Set mouse scaling
  101. RLAPI int GetMouseWheelMove(void); // Returns mouse wheel movement Y
  102. // Input-related functions: touch
  103. RLAPI int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size)
  104. RLAPI int GetTouchY(void); // Returns touch position Y for touch point 0 (relative to screen size)
  105. RLAPI Vector2 GetTouchPosition(int index); // Returns touch position XY for a touch point index (relative to screen size)
  106. //------------------------------------------------------------------------------------
  107. // Gestures and Touch Handling Functions (Module: gestures)
  108. //------------------------------------------------------------------------------------
  109. RLAPI void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags
  110. RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected
  111. RLAPI int GetGestureDetected(void); // Get latest detected gesture
  112. RLAPI int GetTouchPointsCount(void); // Get touch points count
  113. RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds
  114. RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector
  115. RLAPI float GetGestureDragAngle(void); // Get gesture drag angle
  116. RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta
  117. RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle
  118. //------------------------------------------------------------------------------------
  119. // Camera System Functions (Module: camera)
  120. //------------------------------------------------------------------------------------
  121. RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available)
  122. RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode
  123. RLAPI void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera)
  124. RLAPI void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera)
  125. RLAPI void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera)
  126. RLAPI void SetCameraMoveControls(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras)
  127. //------------------------------------------------------------------------------------
  128. // Basic Shapes Drawing Functions (Module: shapes)
  129. //------------------------------------------------------------------------------------
  130. // Basic shapes drawing functions
  131. RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel
  132. RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version)
  133. RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line
  134. RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version)
  135. RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness
  136. RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out
  137. RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle
  138. RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle
  139. RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version)
  140. RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline
  141. RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle
  142. RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version)
  143. RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle
  144. RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters
  145. RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle
  146. RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle
  147. RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors
  148. RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline
  149. RLAPI void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color); // Draw rectangle outline with extended parameters
  150. RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle
  151. RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline
  152. RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version)
  153. RLAPI void DrawPolyEx(Vector2 *points, int numPoints, Color color); // Draw a closed polygon defined by points
  154. RLAPI void DrawPolyExLines(Vector2 *points, int numPoints, Color color); // Draw polygon lines
  155. // Basic shapes collision detection functions
  156. RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles
  157. RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles
  158. RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle
  159. RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision
  160. RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle
  161. RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle
  162. RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle
  163. //------------------------------------------------------------------------------------
  164. // Texture Loading and Drawing Functions (Module: textures)
  165. //------------------------------------------------------------------------------------
  166. // Image/Texture2D data loading/unloading/saving functions
  167. RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM)
  168. RLAPI Image LoadImageEx(Color *pixels, int width, int height); // Load image from Color array data (RGBA - 32bit)
  169. RLAPI Image LoadImagePro(void *data, int width, int height, int format); // Load image from raw data with parameters
  170. RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data
  171. RLAPI void ExportImage(const char *fileName, Image image); // Export image as a PNG file
  172. RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM)
  173. RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data
  174. RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer)
  175. RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM)
  176. RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM)
  177. RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM)
  178. RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array
  179. RLAPI Vector4 *GetImageDataNormalized(Image image); // Get pixel data from image as Vector4 array (float normalized)
  180. RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture)
  181. RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image
  182. RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data
  183. // Image manipulation functions
  184. RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations)
  185. RLAPI void ImageToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two)
  186. RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format
  187. RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image
  188. RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color
  189. RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value
  190. RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
  191. RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle
  192. RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering)
  193. RLAPI void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm)
  194. RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color); // Resize canvas and fill with color
  195. RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image
  196. RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
  197. RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font)
  198. RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font)
  199. RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image
  200. RLAPI void ImageDrawRectangle(Image *dst, Vector2 position, Rectangle rec, Color color); // Draw rectangle within an image
  201. RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination)
  202. RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color); // Draw text (custom sprite font) within an image (destination)
  203. RLAPI void ImageFlipVertical(Image *image); // Flip image vertically
  204. RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally
  205. RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg
  206. RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg
  207. RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint
  208. RLAPI void ImageColorInvert(Image *image); // Modify image color: invert
  209. RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale
  210. RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100)
  211. RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255)
  212. RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color
  213. // Image generation functions
  214. RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color
  215. RLAPI Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient
  216. RLAPI Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient
  217. RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient
  218. RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked
  219. RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise
  220. RLAPI Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); // Generate image: perlin noise
  221. RLAPI Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm. Bigger tileSize means bigger cells
  222. // Texture2D configuration functions
  223. RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture
  224. RLAPI void SetTextureFilter(Texture2D texture, int filterMode); // Set texture scaling filter mode
  225. RLAPI void SetTextureWrap(Texture2D texture, int wrapMode); // Set texture wrapping mode
  226. // Texture2D drawing functions
  227. RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D
  228. RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2
  229. RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
  230. RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
  231. RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters
  232. //------------------------------------------------------------------------------------
  233. // Font Loading and Text Drawing Functions (Module: text)
  234. //------------------------------------------------------------------------------------
  235. // Font loading/unloading functions
  236. RLAPI Font GetFontDefault(void); // Get the default Font
  237. RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
  238. RLAPI Font LoadFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load font from file with extended parameters
  239. RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, bool sdf); // Load font data for further use
  240. RLAPI Image GenImageFontAtlas(CharInfo *chars, int fontSize, int charsCount, int padding, int packMethod); // Generate image font atlas using chars info
  241. RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM)
  242. // Text drawing functions
  243. RLAPI void DrawFPS(int posX, int posY); // Shows current FPS
  244. RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
  245. RLAPI void DrawTextEx(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using Font and additional parameters
  246. // Text misc. functions
  247. RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font
  248. RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
  249. RLAPI const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed'
  250. RLAPI const char *SubText(const char *text, int position, int length); // Get a piece of a text string
  251. RLAPI int GetGlyphIndex(Font font, int character); // Returns index position for a unicode character on sprite font
  252. //------------------------------------------------------------------------------------
  253. // Basic 3d Shapes Drawing Functions (Module: models)
  254. //------------------------------------------------------------------------------------
  255. // Basic geometric 3D shapes drawing functions
  256. RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space
  257. RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space
  258. RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube
  259. RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version)
  260. RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires
  261. RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured
  262. RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere
  263. RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters
  264. RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires
  265. RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone
  266. RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires
  267. RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ
  268. RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line
  269. RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0))
  270. RLAPI void DrawGizmo(Vector3 position); // Draw simple gizmo
  271. //DrawTorus(), DrawTeapot() could be useful?
  272. //------------------------------------------------------------------------------------
  273. // Model 3d Loading and Drawing Functions (Module: models)
  274. //------------------------------------------------------------------------------------
  275. // Model loading/unloading functions
  276. RLAPI Model LoadModel(const char *fileName); // Load model from files (mesh and material)
  277. RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh
  278. RLAPI void UnloadModel(Model model); // Unload model from memory (RAM and/or VRAM)
  279. // Mesh loading/unloading functions
  280. RLAPI Mesh LoadMesh(const char *fileName); // Load mesh from file
  281. RLAPI void UnloadMesh(Mesh *mesh); // Unload mesh from memory (RAM and/or VRAM)
  282. RLAPI void ExportMesh(const char *fileName, Mesh mesh); // Export mesh as an OBJ file
  283. // Mesh manipulation functions
  284. RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits
  285. RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents
  286. RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals
  287. // Mesh generation functions
  288. RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions)
  289. RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh
  290. RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere)
  291. RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap)
  292. RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh
  293. RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh
  294. RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh
  295. RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data
  296. RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data
  297. // Material loading/unloading functions
  298. RLAPI Material LoadMaterial(const char *fileName); // Load material from file
  299. RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
  300. RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM)
  301. // Model drawing functions
  302. RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set)
  303. RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters
  304. RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set)
  305. RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters
  306. RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
  307. RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture
  308. RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec
  309. // Collision detection functions
  310. RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres
  311. RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes
  312. RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere
  313. RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere
  314. RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point
  315. RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box
  316. RLAPI RayHitInfo GetCollisionRayModel(Ray ray, Model *model); // Get collision info between ray and model
  317. RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle
  318. RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane)
  319. //------------------------------------------------------------------------------------
  320. // Shaders System Functions (Module: rlgl)
  321. // NOTE: This functions are useless when using OpenGL 1.1
  322. //------------------------------------------------------------------------------------
  323. // Shader loading/unloading functions
  324. RLAPI char *LoadText(const char *fileName); // Load chars array from text file
  325. RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations
  326. RLAPI Shader LoadShaderCode(char *vsCode, char *fsCode); // Load shader from code strings and bind default locations
  327. RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM)
  328. RLAPI Shader GetShaderDefault(void); // Get default shader
  329. RLAPI Texture2D GetTextureDefault(void); // Get default texture
  330. // Shader configuration functions
  331. RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location
  332. RLAPI void SetShaderValue(Shader shader, int uniformLoc, const float *value, int size); // Set shader uniform value (float)
  333. RLAPI void SetShaderValuei(Shader shader, int uniformLoc, const int *value, int size); // Set shader uniform value (int)
  334. RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4)
  335. RLAPI void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix)
  336. RLAPI void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix)
  337. RLAPI Matrix GetMatrixModelview(); // Get internal modelview matrix
  338. // Texture maps generation (PBR)
  339. // NOTE: Required shaders should be provided
  340. RLAPI Texture2D GenTextureCubemap(Shader shader, Texture2D skyHDR, int size); // Generate cubemap texture from HDR texture
  341. RLAPI Texture2D GenTextureIrradiance(Shader shader, Texture2D cubemap, int size); // Generate irradiance texture using cubemap data
  342. RLAPI Texture2D GenTexturePrefilter(Shader shader, Texture2D cubemap, int size); // Generate prefilter texture using cubemap data
  343. RLAPI Texture2D GenTextureBRDF(Shader shader, Texture2D cubemap, int size); // Generate BRDF texture using cubemap data
  344. // Shading begin/end functions
  345. RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing
  346. RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader)
  347. RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied)
  348. RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending)
  349. // VR control functions
  350. RLAPI VrDeviceInfo GetVrDeviceInfo(int vrDeviceType); // Get VR device information for some standard devices
  351. RLAPI void InitVrSimulator(VrDeviceInfo info); // Init VR simulator for selected device parameters
  352. RLAPI void CloseVrSimulator(void); // Close VR simulator for current device
  353. RLAPI bool IsVrSimulatorReady(void); // Detect if VR simulator is ready
  354. RLAPI void SetVrDistortionShader(Shader shader); // Set VR distortion shader for stereoscopic rendering
  355. RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera
  356. RLAPI void ToggleVrMode(void); // Enable/Disable VR experience
  357. RLAPI void BeginVrDrawing(void); // Begin VR simulator stereo rendering
  358. RLAPI void EndVrDrawing(void); // End VR simulator stereo rendering
  359. //------------------------------------------------------------------------------------
  360. // Audio Loading and Playing Functions (Module: audio)
  361. //------------------------------------------------------------------------------------
  362. // Audio device management functions
  363. RLAPI void InitAudioDevice(void); // Initialize audio device and context
  364. RLAPI void CloseAudioDevice(void); // Close the audio device and context
  365. RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully
  366. RLAPI void SetMasterVolume(float volume); // Set master volume (listener)
  367. // Wave/Sound loading/unloading functions
  368. RLAPI Wave LoadWave(const char *fileName); // Load wave data from file
  369. RLAPI Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data
  370. RLAPI Sound LoadSound(const char *fileName); // Load sound from file
  371. RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data
  372. RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data
  373. RLAPI void UnloadWave(Wave wave); // Unload wave data
  374. RLAPI void UnloadSound(Sound sound); // Unload sound
  375. // Wave/Sound management functions
  376. RLAPI void PlaySound(Sound sound); // Play a sound
  377. RLAPI void PauseSound(Sound sound); // Pause a sound
  378. RLAPI void ResumeSound(Sound sound); // Resume a paused sound
  379. RLAPI void StopSound(Sound sound); // Stop playing a sound
  380. RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing
  381. RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level)
  382. RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level)
  383. RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format
  384. RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave
  385. RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range
  386. RLAPI float *GetWaveData(Wave wave); // Get samples data from wave as a floats array
  387. // Music management functions
  388. RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file
  389. RLAPI void UnloadMusicStream(Music music); // Unload music stream
  390. RLAPI void PlayMusicStream(Music music); // Start music playing
  391. RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming
  392. RLAPI void StopMusicStream(Music music); // Stop music playing
  393. RLAPI void PauseMusicStream(Music music); // Pause music playing
  394. RLAPI void ResumeMusicStream(Music music); // Resume playing paused music
  395. RLAPI bool IsMusicPlaying(Music music); // Check if music is playing
  396. RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level)
  397. RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
  398. RLAPI void SetMusicLoopCount(Music music, int count); // Set music loop count (loop repeats)
  399. RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds)
  400. RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
  401. // AudioStream management functions
  402. RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data)
  403. RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data
  404. RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory
  405. RLAPI bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill
  406. RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream
  407. RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream
  408. RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream
  409. RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing
  410. RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream
  411. RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level)
  412. RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level)