mirror of
				https://github.com/raysan5/raylib.git
				synced 2025-10-26 12:27:01 +00:00 
			
		
		
		
	raylib v1.7 release
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							| @@ -1,51 +1,51 @@ | |||||||
| /********************************************************************************************** | /********************************************************************************************** | ||||||
| * | * | ||||||
| *   raylib 1.6.0 (www.raylib.com) | *   raylib v1.7.0  | ||||||
| * | * | ||||||
| *   A simple and easy-to-use library to learn videogames programming | *   A simple and easy-to-use library to learn videogames programming (www.raylib.com) | ||||||
| * | * | ||||||
| *   Features: | *   FEATURES: | ||||||
| *     Library written in plain C code (C99) | *       - Library written in plain C code (C99) | ||||||
| *     Uses PascalCase/camelCase notation | *       - Multiple platforms supported: Windows, Linux, Mac, Android, Raspberry Pi, HTML5. | ||||||
| *     Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) | *       - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) | ||||||
| *     Unique OpenGL abstraction layer (usable as standalone module): [rlgl] | *       - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] | ||||||
| *     Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) | *       - Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) | ||||||
| *     Multiple textures support, including compressed formats and mipmaps generation | *       - Multiple textures support, including compressed formats and mipmaps generation | ||||||
| *     Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps | *       - Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps | ||||||
| *     Materials (diffuse, normal, specular) and Lighting (point, directional, spot) support | *       - Powerful math module for Vector2, Vector3, Matrix and Quaternion operations: [raymath] | ||||||
| *     Powerful math module for Vector, Matrix and Quaternion operations: [raymath] | *       - Audio loading and playing with streaming support and mixing channels: [audio] | ||||||
| *     Audio loading and playing with streaming support and mixing channels [audio] | *       - VR stereo rendering support with configurable HMD device parameters | ||||||
| *     VR stereo rendering support with configurable HMD device parameters | *       - Minimal external dependencies (GLFW3, OpenGL, OpenAL) | ||||||
| *     Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi, HTML5 and Oculus Rift CV1 | *       - Complete bindings for Lua, Go and Pascal | ||||||
| *     Custom color palette for fancy visuals on raywhite background |  | ||||||
| *     Minimal external dependencies (GLFW3, OpenGL, OpenAL) |  | ||||||
| *     Complete binding for LUA [rlua] |  | ||||||
| * | * | ||||||
| *   External libs: | *   NOTES: | ||||||
| *     GLFW3 (www.glfw.org) for window/context management and input [core] | *       32bit Colors - Any defined Color is always RGBA (4 byte) | ||||||
| *     GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] | *       One custom font is loaded by default when InitWindow() [core] | ||||||
| *     stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] | *       If using OpenGL 3.3 or ES2, one default shader is loaded automatically (internally defined) [rlgl] | ||||||
| *     stb_image_write (Sean Barret) for image writting (PNG) [utils] | *       If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads | ||||||
| *     stb_truetype (Sean Barret) for ttf fonts loading [text] |  | ||||||
| *     stb_vorbis (Sean Barret) for ogg audio loading [audio] |  | ||||||
| *     jar_xm (Joshua Reisenauer) for XM audio module loading [audio] |  | ||||||
| *     jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] |  | ||||||
| *     dr_flac (David Reid) for FLAC audio file loading [audio] |  | ||||||
| *     OpenAL Soft for audio device/context management [audio] |  | ||||||
| *     tinfl for data decompression (DEFLATE algorithm) [utils] |  | ||||||
| * | * | ||||||
| *   Some design decisions: | *   DEPENDENCIES: | ||||||
| *     32bit Colors - All defined color are always RGBA (struct Color is 4 byte) | *       GLFW3 (www.glfw.org) for window/context management and input [core] | ||||||
| *     One custom default font could be loaded automatically when InitWindow() [core] | *       GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] | ||||||
| *     If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads | *       OpenAL Soft for audio device/context management [audio] | ||||||
| *     If using OpenGL 3.3 or ES2, two default shaders could be loaded automatically (internally defined) |  | ||||||
| * | * | ||||||
| *   -- LICENSE -- | *   OPTIONAL DEPENDENCIES: | ||||||
|  | *       stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] | ||||||
|  | *       stb_image_write (Sean Barret) for image writting (PNG) [utils] | ||||||
|  | *       stb_truetype (Sean Barret) for ttf fonts loading [text] | ||||||
|  | *       stb_vorbis (Sean Barret) for ogg audio loading [audio] | ||||||
|  | *       jar_xm (Joshua Reisenauer) for XM audio module loading [audio] | ||||||
|  | *       jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] | ||||||
|  | *       dr_flac (David Reid) for FLAC audio file loading [audio] | ||||||
|  | *       tinfl for data decompression (DEFLATE algorithm) [rres] | ||||||
|  | * | ||||||
|  | * | ||||||
|  | *   LICENSE: zlib/libpng | ||||||
| * | * | ||||||
| *   raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, | *   raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, | ||||||
| *   BSD-like license that allows static linking with closed source software: | *   BSD-like license that allows static linking with closed source software: | ||||||
| * | * | ||||||
| *   Copyright (c) 2013-2016 Ramon Santamaria (@raysan5) | *   Copyright (c) 2013-2017 Ramon Santamaria (@raysan5) | ||||||
| * | * | ||||||
| *   This software is provided "as-is", without any express or implied warranty. In no event | *   This software is provided "as-is", without any express or implied warranty. In no event | ||||||
| *   will the authors be held liable for any damages arising from the use of this software. | *   will the authors be held liable for any damages arising from the use of this software. | ||||||
| @@ -72,7 +72,6 @@ | |||||||
| //#define PLATFORM_ANDROID      // Android device | //#define PLATFORM_ANDROID      // Android device | ||||||
| //#define PLATFORM_RPI          // Raspberry Pi | //#define PLATFORM_RPI          // Raspberry Pi | ||||||
| //#define PLATFORM_WEB          // HTML5 (emscripten, asm.js) | //#define PLATFORM_WEB          // HTML5 (emscripten, asm.js) | ||||||
| //#define RLGL_OCULUS_SUPPORT   // Oculus Rift CV1 (complementary to PLATFORM_DESKTOP) |  | ||||||
|  |  | ||||||
| // Security check in case no PLATFORM_* defined | // Security check in case no PLATFORM_* defined | ||||||
| #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) | #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) | ||||||
| @@ -98,13 +97,13 @@ | |||||||
| #define RAD2DEG (180.0f/PI) | #define RAD2DEG (180.0f/PI) | ||||||
|  |  | ||||||
| // raylib Config Flags | // raylib Config Flags | ||||||
| #define FLAG_FULLSCREEN_MODE    1 | #define FLAG_SHOW_LOGO              1       // Set to show raylib logo at startup | ||||||
| #define FLAG_RESIZABLE_WINDOW   2 | #define FLAG_FULLSCREEN_MODE        2       // Set to run program in fullscreen | ||||||
| #define FLAG_SHOW_LOGO          4 | #define FLAG_WINDOW_RESIZABLE       4       // Set to allow resizable window | ||||||
| #define FLAG_SHOW_MOUSE_CURSOR  8 | #define FLAG_WINDOW_DECORATED       8       // Set to show window decoration (frame and buttons) | ||||||
| #define FLAG_CENTERED_MODE     16 | #define FLAG_WINDOW_TRANSPARENT    16       // Set to allow transparent window | ||||||
| #define FLAG_MSAA_4X_HINT      32 | #define FLAG_MSAA_4X_HINT          32       // Set to try enabling MSAA 4X | ||||||
| #define FLAG_VSYNC_HINT        64 | #define FLAG_VSYNC_HINT            64       // Set to try enabling V-Sync on GPU | ||||||
|  |  | ||||||
| // Keyboard Function Keys | // Keyboard Function Keys | ||||||
| #define KEY_SPACE            32 | #define KEY_SPACE            32 | ||||||
| @@ -293,17 +292,13 @@ | |||||||
| #define RAYWHITE   CLITERAL{ 245, 245, 245, 255 }   // My own White (raylib logo) | #define RAYWHITE   CLITERAL{ 245, 245, 245, 255 }   // My own White (raylib logo) | ||||||
|  |  | ||||||
| //---------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------- | ||||||
| // Types and Structures Definition | // Structures Definition | ||||||
| //---------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------- | ||||||
| #ifndef __cplusplus | #ifndef __cplusplus | ||||||
| // Boolean type | // Boolean type | ||||||
|     #ifndef __APPLE__ |     #if !defined(_STDBOOL_H) | ||||||
|         #if !defined(_STDBOOL_H) |         typedef enum { false, true } bool; | ||||||
|             typedef enum { false, true } bool; |         #define _STDBOOL_H | ||||||
|             #define _STDBOOL_H |  | ||||||
|         #endif |  | ||||||
|     #else |  | ||||||
|         #include <stdbool.h> |  | ||||||
|     #endif |     #endif | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| @@ -351,35 +346,41 @@ typedef struct Image { | |||||||
|     int width;              // Image base width |     int width;              // Image base width | ||||||
|     int height;             // Image base height |     int height;             // Image base height | ||||||
|     int mipmaps;            // Mipmap levels, 1 by default |     int mipmaps;            // Mipmap levels, 1 by default | ||||||
|     int format;             // Data format (TextureFormat) |     int format;             // Data format (TextureFormat type) | ||||||
| } Image; | } Image; | ||||||
|  |  | ||||||
| // Texture2D type, bpp always RGBA (32bit) | // Texture2D type | ||||||
| // NOTE: Data stored in GPU memory | // NOTE: Data stored in GPU memory | ||||||
| typedef struct Texture2D { | typedef struct Texture2D { | ||||||
|     unsigned int id;        // OpenGL texture id |     unsigned int id;        // OpenGL texture id | ||||||
|     int width;              // Texture base width |     int width;              // Texture base width | ||||||
|     int height;             // Texture base height |     int height;             // Texture base height | ||||||
|     int mipmaps;            // Mipmap levels, 1 by default |     int mipmaps;            // Mipmap levels, 1 by default | ||||||
|     int format;             // Data format (TextureFormat) |     int format;             // Data format (TextureFormat type) | ||||||
| } Texture2D; | } Texture2D; | ||||||
|  |  | ||||||
| // RenderTexture2D type, for texture rendering | // RenderTexture2D type, for texture rendering | ||||||
| typedef struct RenderTexture2D { | typedef struct RenderTexture2D { | ||||||
|     unsigned int id;        // Render texture (fbo) id |     unsigned int id;        // OpenGL Framebuffer Object (FBO) id | ||||||
|     Texture2D texture;      // Color buffer attachment texture |     Texture2D texture;      // Color buffer attachment texture | ||||||
|     Texture2D depth;        // Depth buffer attachment texture |     Texture2D depth;        // Depth buffer attachment texture | ||||||
| } RenderTexture2D; | } RenderTexture2D; | ||||||
|  |  | ||||||
|  | // SpriteFont character info | ||||||
|  | typedef struct CharInfo { | ||||||
|  |     int value;              // Character value (Unicode) | ||||||
|  |     Rectangle rec;          // Character rectangle in sprite font | ||||||
|  |     int offsetX;            // Character offset X when drawing | ||||||
|  |     int offsetY;            // Character offset Y when drawing | ||||||
|  |     int advanceX;           // Character advance position X | ||||||
|  | } CharInfo; | ||||||
|  |  | ||||||
| // SpriteFont type, includes texture and charSet array data | // SpriteFont type, includes texture and charSet array data | ||||||
| typedef struct SpriteFont { | typedef struct SpriteFont { | ||||||
|     Texture2D texture;      // Font texture |     Texture2D texture;      // Font texture | ||||||
|     int size;               // Base size (default chars height) |     int baseSize;           // Base size (default chars height) | ||||||
|     int numChars;           // Number of characters |     int charsCount;         // Number of characters | ||||||
|     int *charValues;        // Characters values array |     CharInfo *chars;        // Characters info data | ||||||
|     Rectangle *charRecs;    // Characters rectangles within the texture |  | ||||||
|     Vector2 *charOffsets;   // Characters offsets (on drawing) |  | ||||||
|     int *charAdvanceX;      // Characters x advance (on drawing) |  | ||||||
| } SpriteFont; | } SpriteFont; | ||||||
|  |  | ||||||
| // Camera type, defines a camera position/orientation in 3d space | // Camera type, defines a camera position/orientation in 3d space | ||||||
| @@ -466,31 +467,20 @@ typedef struct Model { | |||||||
|     Material material;      // Shader and textures data |     Material material;      // Shader and textures data | ||||||
| } Model; | } Model; | ||||||
|  |  | ||||||
| // Light type |  | ||||||
| typedef struct LightData { |  | ||||||
|     unsigned int id;        // Light unique id |  | ||||||
|     bool enabled;           // Light enabled |  | ||||||
|     int type;               // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT |  | ||||||
|  |  | ||||||
|     Vector3 position;       // Light position |  | ||||||
|     Vector3 target;         // Light direction: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) |  | ||||||
|     float radius;           // Light attenuation radius light intensity reduced with distance (world distance) |  | ||||||
|  |  | ||||||
|     Color diffuse;          // Light diffuse color |  | ||||||
|     float intensity;        // Light intensity level |  | ||||||
|  |  | ||||||
|     float coneAngle;        // Light cone max angle: LIGHT_SPOT |  | ||||||
| } LightData, *Light; |  | ||||||
|  |  | ||||||
| // Light types |  | ||||||
| typedef enum { LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT } LightType; |  | ||||||
|  |  | ||||||
| // Ray type (useful for raycast) | // Ray type (useful for raycast) | ||||||
| typedef struct Ray { | typedef struct Ray { | ||||||
|     Vector3 position;       // Ray position (origin) |     Vector3 position;       // Ray position (origin) | ||||||
|     Vector3 direction;      // Ray direction |     Vector3 direction;      // Ray direction | ||||||
| } Ray; | } Ray; | ||||||
|  |  | ||||||
|  | // Information returned from a raycast | ||||||
|  | typedef struct RayHitInfo { | ||||||
|  |     bool hit;               // Did the ray hit something? | ||||||
|  |     float distance;         // Distance to nearest hit | ||||||
|  |     Vector3 position;       // Position of nearest hit | ||||||
|  |     Vector3 normal;         // Surface normal of hit | ||||||
|  | } RayHitInfo; | ||||||
|  |  | ||||||
| // Wave type, defines audio wave data | // Wave type, defines audio wave data | ||||||
| typedef struct Wave { | typedef struct Wave { | ||||||
|     unsigned int sampleCount;   // Number of samples |     unsigned int sampleCount;   // Number of samples | ||||||
| @@ -523,6 +513,34 @@ typedef struct AudioStream { | |||||||
|     unsigned int buffers[2];    // OpenAL audio buffers (double buffering) |     unsigned int buffers[2];    // OpenAL audio buffers (double buffering) | ||||||
| } AudioStream; | } AudioStream; | ||||||
|  |  | ||||||
|  | // rRES data returned when reading a resource,  | ||||||
|  | // it contains all required data for user (24 byte) | ||||||
|  | typedef struct RRESData { | ||||||
|  |     unsigned int type;          // Resource type (4 byte) | ||||||
|  |  | ||||||
|  |     unsigned int param1;        // Resouce parameter 1 (4 byte) | ||||||
|  |     unsigned int param2;        // Resouce parameter 2 (4 byte) | ||||||
|  |     unsigned int param3;        // Resouce parameter 3 (4 byte) | ||||||
|  |     unsigned int param4;        // Resouce parameter 4 (4 byte) | ||||||
|  |  | ||||||
|  |     void *data;                 // Resource data pointer (4 byte) | ||||||
|  | } RRESData; | ||||||
|  |  | ||||||
|  | // RRES type (pointer to RRESData array) | ||||||
|  | typedef struct RRESData *RRES; | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------------------------------- | ||||||
|  | // Enumerators Definition | ||||||
|  | //---------------------------------------------------------------------------------- | ||||||
|  | // Trace log type | ||||||
|  | typedef enum {  | ||||||
|  |     INFO = 0, | ||||||
|  |     WARNING,  | ||||||
|  |     ERROR,  | ||||||
|  |     DEBUG,  | ||||||
|  |     OTHER  | ||||||
|  | } LogType; | ||||||
|  |  | ||||||
| // Texture formats | // Texture formats | ||||||
| // NOTE: Support depends on OpenGL version and platform | // NOTE: Support depends on OpenGL version and platform | ||||||
| typedef enum { | typedef enum { | ||||||
| @@ -533,6 +551,7 @@ typedef enum { | |||||||
|     UNCOMPRESSED_R5G5B5A1,          // 16 bpp (1 bit alpha) |     UNCOMPRESSED_R5G5B5A1,          // 16 bpp (1 bit alpha) | ||||||
|     UNCOMPRESSED_R4G4B4A4,          // 16 bpp (4 bit alpha) |     UNCOMPRESSED_R4G4B4A4,          // 16 bpp (4 bit alpha) | ||||||
|     UNCOMPRESSED_R8G8B8A8,          // 32 bpp |     UNCOMPRESSED_R8G8B8A8,          // 32 bpp | ||||||
|  |     UNCOMPRESSED_R32G32B32,         // 32 bit per channel (float) - HDR | ||||||
|     COMPRESSED_DXT1_RGB,            // 4 bpp (no alpha) |     COMPRESSED_DXT1_RGB,            // 4 bpp (no alpha) | ||||||
|     COMPRESSED_DXT1_RGBA,           // 4 bpp (1 bit alpha) |     COMPRESSED_DXT1_RGBA,           // 4 bpp (1 bit alpha) | ||||||
|     COMPRESSED_DXT3_RGBA,           // 8 bpp |     COMPRESSED_DXT3_RGBA,           // 8 bpp | ||||||
| @@ -549,7 +568,7 @@ typedef enum { | |||||||
| // Texture parameters: filter mode | // Texture parameters: filter mode | ||||||
| // NOTE 1: Filtering considers mipmaps if available in the texture | // NOTE 1: Filtering considers mipmaps if available in the texture | ||||||
| // NOTE 2: Filter is accordingly set for minification and magnification | // NOTE 2: Filter is accordingly set for minification and magnification | ||||||
| typedef enum {  | typedef enum { | ||||||
|     FILTER_POINT = 0,               // No filter, just pixel aproximation |     FILTER_POINT = 0,               // No filter, just pixel aproximation | ||||||
|     FILTER_BILINEAR,                // Linear filtering |     FILTER_BILINEAR,                // Linear filtering | ||||||
|     FILTER_TRILINEAR,               // Trilinear filtering (linear with mipmaps) |     FILTER_TRILINEAR,               // Trilinear filtering (linear with mipmaps) | ||||||
| @@ -559,10 +578,18 @@ typedef enum { | |||||||
| } TextureFilterMode; | } TextureFilterMode; | ||||||
|  |  | ||||||
| // Texture parameters: wrap mode | // Texture parameters: wrap mode | ||||||
| typedef enum { WRAP_REPEAT = 0, WRAP_CLAMP, WRAP_MIRROR } TextureWrapMode; | typedef enum {  | ||||||
|  |     WRAP_REPEAT = 0,  | ||||||
|  |     WRAP_CLAMP,  | ||||||
|  |     WRAP_MIRROR  | ||||||
|  | } TextureWrapMode; | ||||||
|  |  | ||||||
| // Color blending modes (pre-defined) | // Color blending modes (pre-defined) | ||||||
| typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode; | typedef enum {  | ||||||
|  |     BLEND_ALPHA = 0,  | ||||||
|  |     BLEND_ADDITIVE,  | ||||||
|  |     BLEND_MULTIPLIED | ||||||
|  | } BlendMode; | ||||||
|  |  | ||||||
| // Gestures type | // Gestures type | ||||||
| // NOTE: It could be used as flags to enable only some gestures | // NOTE: It could be used as flags to enable only some gestures | ||||||
| @@ -581,12 +608,12 @@ typedef enum { | |||||||
| } Gestures; | } Gestures; | ||||||
|  |  | ||||||
| // Camera system modes | // Camera system modes | ||||||
| typedef enum {  | typedef enum { | ||||||
|     CAMERA_CUSTOM = 0,  |     CAMERA_CUSTOM = 0, | ||||||
|     CAMERA_FREE,  |     CAMERA_FREE, | ||||||
|     CAMERA_ORBITAL,  |     CAMERA_ORBITAL, | ||||||
|     CAMERA_FIRST_PERSON,  |     CAMERA_FIRST_PERSON, | ||||||
|     CAMERA_THIRD_PERSON  |     CAMERA_THIRD_PERSON | ||||||
| } CameraMode; | } CameraMode; | ||||||
|  |  | ||||||
| // Head Mounted Display devices | // Head Mounted Display devices | ||||||
| @@ -602,6 +629,18 @@ typedef enum { | |||||||
|     HMD_FOVE_VR, |     HMD_FOVE_VR, | ||||||
| } VrDevice; | } VrDevice; | ||||||
|  |  | ||||||
|  | // RRESData type | ||||||
|  | typedef enum {  | ||||||
|  |     RRES_TYPE_RAW = 0,  | ||||||
|  |     RRES_TYPE_IMAGE,  | ||||||
|  |     RRES_TYPE_WAVE,  | ||||||
|  |     RRES_TYPE_VERTEX,  | ||||||
|  |     RRES_TYPE_TEXT, | ||||||
|  |     RRES_TYPE_FONT_IMAGE, | ||||||
|  |     RRES_TYPE_FONT_CHARDATA,    // CharInfo data array | ||||||
|  |     RRES_TYPE_DIRECTORY | ||||||
|  | } RRESDataType; | ||||||
|  |  | ||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| extern "C" {            // Prevents name mangling of functions | extern "C" {            // Prevents name mangling of functions | ||||||
| #endif | #endif | ||||||
| @@ -615,44 +654,48 @@ extern "C" {            // Prevents name mangling of functions | |||||||
| // Window and Graphics Device Functions (Module: core) | // Window and Graphics Device Functions (Module: core) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| #if defined(PLATFORM_ANDROID) | #if defined(PLATFORM_ANDROID) | ||||||
| RLAPI void InitWindow(int width, int height, void *state);        // Init Android Activity and OpenGL Graphics (struct android_app) | RLAPI void InitWindow(int width, int height, void *state);        // Initialize Android activity | ||||||
| #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) | #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) | ||||||
| RLAPI void InitWindow(int width, int height, const char *title);  // Initialize Window and OpenGL Graphics | RLAPI void InitWindow(int width, int height, const char *title);  // Initialize window and OpenGL context | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| RLAPI void CloseWindow(void);                                     // Close Window and Terminate Context | RLAPI void CloseWindow(void);                                     // Close window and unload OpenGL context | ||||||
| RLAPI bool WindowShouldClose(void);                               // Detect if KEY_ESCAPE pressed or Close icon pressed | RLAPI bool WindowShouldClose(void);                               // Check if KEY_ESCAPE pressed or Close icon pressed | ||||||
| RLAPI bool IsWindowMinimized(void);                               // Detect if window has been minimized (or lost focus) | RLAPI bool IsWindowMinimized(void);                               // Check if window has been minimized (or lost focus) | ||||||
| RLAPI void ToggleFullscreen(void);                                // Fullscreen toggle (only PLATFORM_DESKTOP) | RLAPI void ToggleFullscreen(void);                                // Toggle fullscreen mode (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowIcon(Image image);                            // Set icon for window (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowPosition(int x, int y);                       // Set window position on screen (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowMonitor(int monitor);                         // Set monitor for the current window (fullscreen mode) | ||||||
|  | RLAPI void SetWindowMinSize(int width, int height);               // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) | ||||||
| RLAPI int GetScreenWidth(void);                                   // Get current screen width | RLAPI int GetScreenWidth(void);                                   // Get current screen width | ||||||
| RLAPI int GetScreenHeight(void);                                  // Get current screen height | RLAPI int GetScreenHeight(void);                                  // Get current screen height | ||||||
|  |  | ||||||
| #if !defined(PLATFORM_ANDROID) | #if !defined(PLATFORM_ANDROID) | ||||||
| RLAPI void ShowCursor(void);                                      // Shows cursor | RLAPI void ShowCursor(void);                                      // Shows cursor | ||||||
| RLAPI void HideCursor(void);                                      // Hides cursor | RLAPI void HideCursor(void);                                      // Hides cursor | ||||||
| RLAPI bool IsCursorHidden(void);                                  // Returns true if cursor is not visible | RLAPI bool IsCursorHidden(void);                                  // Check if cursor is not visible | ||||||
| RLAPI void EnableCursor(void);                                    // Enables cursor | RLAPI void EnableCursor(void);                                    // Enables cursor (unlock cursor) | ||||||
| RLAPI void DisableCursor(void);                                   // Disables cursor | RLAPI void DisableCursor(void);                                   // Disables cursor (lock cursor) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| RLAPI void ClearBackground(Color color);                          // Sets Background Color | RLAPI void ClearBackground(Color color);                          // Set background color (framebuffer clear color) | ||||||
| RLAPI void BeginDrawing(void);                                    // Setup drawing canvas to start drawing | RLAPI void BeginDrawing(void);                                    // Setup canvas (framebuffer) to start drawing | ||||||
| RLAPI void EndDrawing(void);                                      // End canvas drawing and Swap Buffers (Double Buffering) | RLAPI void EndDrawing(void);                                      // End canvas drawing and swap buffers (double buffering) | ||||||
|  |  | ||||||
| RLAPI void Begin2dMode(Camera2D camera);                          // Initialize 2D mode with custom camera | RLAPI void Begin2dMode(Camera2D camera);                          // Initialize 2D mode with custom camera (2D) | ||||||
| RLAPI void End2dMode(void);                                       // Ends 2D mode custom camera usage | RLAPI void End2dMode(void);                                       // Ends 2D mode with custom camera | ||||||
| RLAPI void Begin3dMode(Camera camera);                            // Initializes 3D mode for drawing (Camera setup) | RLAPI void Begin3dMode(Camera camera);                            // Initializes 3D mode with custom camera (3D) | ||||||
| RLAPI void End3dMode(void);                                       // Ends 3D mode and returns to default 2D orthographic mode | RLAPI void End3dMode(void);                                       // Ends 3D mode and returns to default 2D orthographic mode | ||||||
| RLAPI void BeginTextureMode(RenderTexture2D target);              // Initializes render texture for drawing | RLAPI void BeginTextureMode(RenderTexture2D target);              // Initializes render texture for drawing | ||||||
| RLAPI void EndTextureMode(void);                                  // Ends drawing to render texture | RLAPI void EndTextureMode(void);                                  // Ends drawing to render texture | ||||||
|  |  | ||||||
| RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera);      // Returns a ray trace from mouse position | RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera);      // Returns a ray trace from mouse position | ||||||
| RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera);  // Returns the screen space position from a 3d world space position | RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera);  // Returns the screen space position for a 3d world space position | ||||||
| RLAPI Matrix GetCameraMatrix(Camera camera);                      // Returns camera transform matrix (view matrix) | RLAPI Matrix GetCameraMatrix(Camera camera);                      // Returns camera transform matrix (view matrix) | ||||||
|  |  | ||||||
| RLAPI void SetTargetFPS(int fps);                                 // Set target FPS (maximum) | RLAPI void SetTargetFPS(int fps);                                 // Set target FPS (maximum) | ||||||
| RLAPI float GetFPS(void);                                         // Returns current FPS | RLAPI int GetFPS(void);                                           // Returns current FPS | ||||||
| RLAPI float GetFrameTime(void);                                   // Returns time in seconds for one frame | RLAPI float GetFrameTime(void);                                   // Returns time in seconds for last frame drawn | ||||||
|  |  | ||||||
| RLAPI Color GetColor(int hexValue);                               // Returns a Color struct from hexadecimal value | RLAPI Color GetColor(int hexValue);                               // Returns a Color struct from hexadecimal value | ||||||
| RLAPI int GetHexValue(Color color);                               // Returns hexadecimal value for a Color | RLAPI int GetHexValue(Color color);                               // Returns hexadecimal value for a Color | ||||||
| @@ -663,15 +706,21 @@ RLAPI float *MatrixToFloat(Matrix mat);                           // Converts Ma | |||||||
| RLAPI int GetRandomValue(int min, int max);                       // Returns a random value between min and max (both included) | RLAPI int GetRandomValue(int min, int max);                       // Returns a random value between min and max (both included) | ||||||
| RLAPI Color Fade(Color color, float alpha);                       // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f | RLAPI Color Fade(Color color, float alpha);                       // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f | ||||||
|  |  | ||||||
| RLAPI void SetConfigFlags(char flags);                            // Setup some window configuration flags | RLAPI void ShowLogo(void);                                        // Activate raylib logo at startup (can be done with flags) | ||||||
| RLAPI void ShowLogo(void);                                        // Activates raylib logo at startup (can be done with flags) | RLAPI void SetConfigFlags(char flags);                            // Setup window configuration flags (view FLAGS) | ||||||
|  | RLAPI void TraceLog(int logType, const char *text, ...);          // Show trace log messages (INFO, WARNING, ERROR, DEBUG) | ||||||
|  | RLAPI void TakeScreenshot(const char *fileName);                  // Takes a screenshot of current screen (saved a .png) | ||||||
|  |  | ||||||
| RLAPI bool IsFileDropped(void);                                   // Check if a file have been dropped into window | RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension | ||||||
| RLAPI char **GetDroppedFiles(int *count);                         // Retrieve dropped files into window | RLAPI const char *GetDirectoryPath(const char *fileName);         // Get directory for a given fileName (with path) | ||||||
|  | RLAPI const char *GetWorkingDirectory(void);                      // Get current working directory | ||||||
|  | RLAPI bool ChangeDirectory(const char *dir);                      // Change working directory, returns true if success | ||||||
|  | RLAPI bool IsFileDropped(void);                                   // Check if a file has been dropped into window | ||||||
|  | RLAPI char **GetDroppedFiles(int *count);                         // Get dropped files names | ||||||
| RLAPI void ClearDroppedFiles(void);                               // Clear dropped files paths buffer | RLAPI void ClearDroppedFiles(void);                               // Clear dropped files paths buffer | ||||||
|  |  | ||||||
| RLAPI void StorageSaveValue(int position, int value);             // Storage save integer value (to defined position) | RLAPI void StorageSaveValue(int position, int value);             // Save integer value to storage file (to defined position) | ||||||
| RLAPI int StorageLoadValue(int position);                         // Storage load integer value (from defined position) | RLAPI int StorageLoadValue(int position);                         // Load integer value from storage file (from defined position) | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Input Handling Functions (Module: core) | // Input Handling Functions (Module: core) | ||||||
| @@ -741,12 +790,15 @@ RLAPI void DrawPixel(int posX, int posY, Color color); | |||||||
| RLAPI void DrawPixelV(Vector2 position, Color color);                                                    // Draw a pixel (Vector version) | RLAPI void DrawPixelV(Vector2 position, Color color);                                                    // Draw a pixel (Vector version) | ||||||
| RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);                // Draw a line | RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);                // Draw a line | ||||||
| RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);                                     // Draw a line (Vector version) | RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);                                     // Draw a line (Vector version) | ||||||
|  | RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color);                       // Draw a line defining thickness | ||||||
|  | RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color);                   // Draw a line using cubic-bezier curves in-out | ||||||
| RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color);                              // Draw a color-filled circle | RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color);                              // Draw a color-filled circle | ||||||
| RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);       // Draw a gradient-filled circle | RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);       // Draw a gradient-filled circle | ||||||
| RLAPI void DrawCircleV(Vector2 center, float radius, Color color);                                       // Draw a color-filled circle (Vector version) | RLAPI void DrawCircleV(Vector2 center, float radius, Color color);                                       // Draw a color-filled circle (Vector version) | ||||||
| RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color);                         // Draw circle outline | RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color);                         // Draw circle outline | ||||||
| RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color);                        // Draw a color-filled rectangle | RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color);                        // Draw a color-filled rectangle | ||||||
| RLAPI void DrawRectangleRec(Rectangle rec, Color color);                                                 // Draw a color-filled rectangle | RLAPI void DrawRectangleRec(Rectangle rec, Color color);                                                 // Draw a color-filled rectangle | ||||||
|  | RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color);                 // Draw a color-filled rectangle with pro parameters | ||||||
| RLAPI void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle | RLAPI void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle | ||||||
| RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color);                                  // Draw a color-filled rectangle (Vector version) | RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color);                                  // Draw a color-filled rectangle (Vector version) | ||||||
| RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color);                   // Draw rectangle outline | RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color);                   // Draw rectangle outline | ||||||
| @@ -767,21 +819,19 @@ RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Ve | |||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Texture Loading and Drawing Functions (Module: textures) | // Texture Loading and Drawing Functions (Module: textures) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI Image LoadImage(const char *fileName);                                                             // Load an image into CPU memory (RAM) | RLAPI Image LoadImage(const char *fileName);                                                             // Load image from file into CPU memory (RAM) | ||||||
| RLAPI Image LoadImageEx(Color *pixels, int width, int height);                                           // Load image data from Color array data (RGBA - 32bit) | RLAPI Image LoadImageEx(Color *pixels, int width, int height);                                           // Load image from Color array data (RGBA - 32bit) | ||||||
| RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize);       // Load image data from RAW file | RLAPI Image LoadImagePro(void *data, int width, int height, int format);                                 // Load image from raw data with parameters | ||||||
| RLAPI Image LoadImageFromRES(const char *rresName, int resId);                                           // Load an image from rRES file (raylib Resource) | RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize);       // Load image from RAW file data | ||||||
| RLAPI Texture2D LoadTexture(const char *fileName);                                                       // Load an image as texture into GPU memory | RLAPI Texture2D LoadTexture(const char *fileName);                                                       // Load texture from file into GPU memory (VRAM) | ||||||
| RLAPI Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat);                     // Load a texture from raw data into GPU memory | RLAPI Texture2D LoadTextureFromImage(Image image);                                                       // Load texture from image data | ||||||
| RLAPI Texture2D LoadTextureFromRES(const char *rresName, int resId);                                     // Load an image as texture from rRES file (raylib Resource) | RLAPI RenderTexture2D LoadRenderTexture(int width, int height);                                          // Load texture for rendering (framebuffer) | ||||||
| RLAPI Texture2D LoadTextureFromImage(Image image);                                                       // Load a texture from image data |  | ||||||
| RLAPI RenderTexture2D LoadRenderTexture(int width, int height);                                          // Load a texture to be used for rendering |  | ||||||
| RLAPI void UnloadImage(Image image);                                                                     // Unload image from CPU memory (RAM) | RLAPI void UnloadImage(Image image);                                                                     // Unload image from CPU memory (RAM) | ||||||
| RLAPI void UnloadTexture(Texture2D texture);                                                             // Unload texture from GPU memory | RLAPI void UnloadTexture(Texture2D texture);                                                             // Unload texture from GPU memory (VRAM) | ||||||
| RLAPI void UnloadRenderTexture(RenderTexture2D target);                                                  // Unload render texture from GPU memory | RLAPI void UnloadRenderTexture(RenderTexture2D target);                                                  // Unload render texture from GPU memory (VRAM) | ||||||
| RLAPI Color *GetImageData(Image image);                                                                  // Get pixel data from image as a Color struct array | RLAPI Color *GetImageData(Image image);                                                                  // Get pixel data from image as a Color struct array | ||||||
| RLAPI Image GetTextureData(Texture2D texture);                                                           // Get pixel data from GPU texture and return an Image | RLAPI Image GetTextureData(Texture2D texture);                                                           // Get pixel data from GPU texture and return an Image | ||||||
| RLAPI void UpdateTexture(Texture2D texture, void *pixels);                                               // Update GPU texture with new data | RLAPI void UpdateTexture(Texture2D texture, const void *pixels);                                         // Update GPU texture with new data | ||||||
| RLAPI void ImageToPOT(Image *image, Color fillColor);                                                    // Convert image to POT (power-of-two) | RLAPI void ImageToPOT(Image *image, Color fillColor);                                                    // Convert image to POT (power-of-two) | ||||||
| RLAPI void ImageFormat(Image *image, int newFormat);                                                     // Convert image data to desired format | RLAPI void ImageFormat(Image *image, int newFormat);                                                     // Convert image data to desired format | ||||||
| RLAPI void ImageAlphaMask(Image *image, Image alphaMask);                                                // Apply alpha mask to image | RLAPI void ImageAlphaMask(Image *image, Image alphaMask);                                                // Apply alpha mask to image | ||||||
| @@ -794,7 +844,8 @@ RLAPI Image ImageText(const char *text, int fontSize, Color color); | |||||||
| RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint);     // Create an image from text (custom sprite font) | RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint);     // Create an image from text (custom sprite font) | ||||||
| RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);                         // Draw a source image within a destination image | RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);                         // Draw a source image within a destination image | ||||||
| RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color);     // Draw text (default font) within an image (destination) | RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color);     // Draw text (default font) within an image (destination) | ||||||
| RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, float fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) | RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, | ||||||
|  |                            float fontSize, int spacing, Color color);                                    // Draw text (custom sprite font) within an image (destination) | ||||||
| RLAPI void ImageFlipVertical(Image *image);                                                              // Flip image vertically | RLAPI void ImageFlipVertical(Image *image);                                                              // Flip image vertically | ||||||
| RLAPI void ImageFlipHorizontal(Image *image);                                                            // Flip image horizontally | RLAPI void ImageFlipHorizontal(Image *image);                                                            // Flip image horizontally | ||||||
| RLAPI void ImageColorTint(Image *image, Color color);                                                    // Modify image color: tint | RLAPI void ImageColorTint(Image *image, Color color);                                                    // Modify image color: tint | ||||||
| @@ -817,9 +868,9 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle dest | |||||||
| // Font Loading and Text Drawing Functions (Module: text) | // Font Loading and Text Drawing Functions (Module: text) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont | RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont | ||||||
| RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load a SpriteFont image into GPU memory | RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load SpriteFont from file into GPU memory (VRAM) | ||||||
| RLAPI SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars);    // Load a SpriteFont from TTF font with parameters | RLAPI SpriteFont LoadSpriteFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars);   // Load SpriteFont from file with extended parameters | ||||||
| RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory | RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory (VRAM) | ||||||
|  |  | ||||||
| RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color);                    // Draw text (using default font) | RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color);                    // Draw text (using default font) | ||||||
| RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position,                         // Draw text using SpriteFont and additional parameters | RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position,                         // Draw text using SpriteFont and additional parameters | ||||||
| @@ -827,7 +878,7 @@ RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, | |||||||
| RLAPI int MeasureText(const char *text, int fontSize);                                                   // Measure string width for default font | RLAPI int MeasureText(const char *text, int fontSize);                                                   // Measure string width for default font | ||||||
| RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing);       // Measure string size for SpriteFont | RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing);       // Measure string size for SpriteFont | ||||||
|  |  | ||||||
| RLAPI void DrawFPS(int posX, int posY);                                                                  // Shows current FPS on top-left corner | RLAPI void DrawFPS(int posX, int posY);                                                                  // Shows current FPS | ||||||
| RLAPI const char *FormatText(const char *text, ...);                                                     // Formatting of text with variables to 'embed' | RLAPI const char *FormatText(const char *text, ...);                                                     // Formatting of text with variables to 'embed' | ||||||
| RLAPI const char *SubText(const char *text, int position, int length);                                   // Get a piece of a text string | RLAPI const char *SubText(const char *text, int position, int length);                                   // Get a piece of a text string | ||||||
|  |  | ||||||
| @@ -849,50 +900,57 @@ RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); | |||||||
| RLAPI void DrawRay(Ray ray, Color color);                                                                // Draw a ray line | RLAPI void DrawRay(Ray ray, Color color);                                                                // Draw a ray line | ||||||
| RLAPI void DrawGrid(int slices, float spacing);                                                          // Draw a grid (centered at (0, 0, 0)) | RLAPI void DrawGrid(int slices, float spacing);                                                          // Draw a grid (centered at (0, 0, 0)) | ||||||
| RLAPI void DrawGizmo(Vector3 position);                                                                  // Draw simple gizmo | RLAPI void DrawGizmo(Vector3 position);                                                                  // Draw simple gizmo | ||||||
| RLAPI void DrawLight(Light light);                                                                       // Draw light in 3D world |  | ||||||
| //DrawTorus(), DrawTeapot() could be useful? | //DrawTorus(), DrawTeapot() could be useful? | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Model 3d Loading and Drawing Functions (Module: models) | // Model 3d Loading and Drawing Functions (Module: models) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI Model LoadModel(const char *fileName);                          // Load a 3d model (.OBJ) | RLAPI Mesh LoadMesh(const char *fileName);                                                              // Load mesh from file | ||||||
| RLAPI Model LoadModelEx(Mesh data, bool dynamic);                     // Load a 3d model (from mesh data) | RLAPI Mesh LoadMeshEx(int numVertex, float *vData, float *vtData, float *vnData, Color *cData);         // Load mesh from vertex data | ||||||
| RLAPI Model LoadModelFromRES(const char *rresName, int resId);        // Load a 3d model from rRES file (raylib Resource) | RLAPI Model LoadModel(const char *fileName);                                                            // Load model from file | ||||||
| RLAPI Model LoadHeightmap(Image heightmap, Vector3 size);             // Load a heightmap image as a 3d model | RLAPI Model LoadModelFromMesh(Mesh data, bool dynamic);                                                 // Load model from mesh data | ||||||
| RLAPI Model LoadCubicmap(Image cubicmap);                             // Load a map image as a 3d model (cubes based) | RLAPI Model LoadHeightmap(Image heightmap, Vector3 size);                                               // Load heightmap model from image data | ||||||
| RLAPI void UnloadModel(Model model);                                  // Unload 3d model from memory | RLAPI Model LoadCubicmap(Image cubicmap);                                                               // Load cubes-based map model from image data | ||||||
|  | RLAPI void UnloadMesh(Mesh *mesh);                                                                      // Unload mesh from memory (RAM and/or VRAM) | ||||||
|  | RLAPI void UnloadModel(Model model);                                                                    // Unload model from memory (RAM and/or VRAM) | ||||||
|  |  | ||||||
| RLAPI Material LoadMaterial(const char *fileName);                    // Load material data (.MTL) | RLAPI Material LoadMaterial(const char *fileName);                                                      // Load material from file | ||||||
| RLAPI Material LoadDefaultMaterial(void);                             // Load default material (uses default models shader) | RLAPI Material LoadDefaultMaterial(void);                                                               // Load default material (uses default models shader) | ||||||
| RLAPI Material LoadStandardMaterial(void);                            // Load standard material (uses material attributes and lighting shader) | RLAPI void UnloadMaterial(Material material);                                                           // Unload material from GPU memory (VRAM) | ||||||
| RLAPI void UnloadMaterial(Material material);                         // Unload material textures from VRAM |  | ||||||
|  |  | ||||||
| RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint);                            // Draw a model (with texture if set) | RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint);                           // Draw a model (with texture if set) | ||||||
| RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);      // Draw a model with extended parameters | RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, | ||||||
|  |                        float rotationAngle, Vector3 scale, Color tint);                                 // Draw a model with extended parameters | ||||||
| RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint);                      // Draw a model wires (with texture if set) | RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint);                      // Draw a model wires (with texture if set) | ||||||
| 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 | RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, | ||||||
| RLAPI void DrawBoundingBox(BoundingBox box, Color color);                                                // Draw bounding box (wires) |                             float rotationAngle, Vector3 scale, Color tint);                            // Draw a model wires (with texture if set) with extended parameters | ||||||
|  | RLAPI void DrawBoundingBox(BoundingBox box, Color color);                                               // Draw bounding box (wires) | ||||||
|  |  | ||||||
| RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);                         // Draw a billboard texture | RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);     // Draw a billboard texture | ||||||
| RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec | RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, | ||||||
|  |                             Vector3 center, float size, Color tint);                                    // Draw a billboard texture defined by sourceRec | ||||||
|  |  | ||||||
| RLAPI BoundingBox CalculateBoundingBox(Mesh mesh);                                                                    // Calculate mesh bounding box limits | RLAPI BoundingBox CalculateBoundingBox(Mesh mesh);                                                      // Calculate mesh bounding box limits | ||||||
| RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);                     // Detect collision between two spheres | RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);       // Detect collision between two spheres | ||||||
| RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);                                                   // Detect collision between two bounding boxes | RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);                                     // Detect collision between two bounding boxes | ||||||
| RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere);                        // Detect collision between box and sphere | RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere);          // Detect collision between box and sphere | ||||||
| RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius);                              // Detect collision between ray and sphere | RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius);                // Detect collision between ray and sphere | ||||||
| RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint);   // Detect collision between ray and sphere with extended parameters and collision point detection | RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, | ||||||
| RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box);                                                            // Detect collision between ray and box |                                      Vector3 *collisionPoint);                                          // Detect collision between ray and sphere, returns collision point | ||||||
|  | RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box);                                              // Detect collision between ray and box | ||||||
|  | RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh);                                              // Get collision info between ray and mesh | ||||||
|  | RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3);                  // Get collision info between ray and triangle | ||||||
|  | RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight);                                    // Get collision info between ray and ground plane (Y-normal plane) | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Shaders System Functions (Module: rlgl) | // Shaders System Functions (Module: rlgl) | ||||||
| // NOTE: This functions are useless when using OpenGL 1.1 | // NOTE: This functions are useless when using OpenGL 1.1 | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI Shader LoadShader(char *vsFileName, char *fsFileName);              // Load a custom shader and bind default locations | RLAPI char *LoadText(const char *fileName);                               // Load chars array from text file | ||||||
| RLAPI void UnloadShader(Shader shader);                                   // Unload a custom shader from memory | RLAPI Shader LoadShader(char *vsFileName, char *fsFileName);              // Load shader from files and bind default locations | ||||||
|  | RLAPI void UnloadShader(Shader shader);                                   // Unload shader from GPU memory (VRAM) | ||||||
|  |  | ||||||
| RLAPI Shader GetDefaultShader(void);                                      // Get default shader | RLAPI Shader GetDefaultShader(void);                                      // Get default shader | ||||||
| RLAPI Shader GetStandardShader(void);                                     // Get standard shader |  | ||||||
| RLAPI Texture2D GetDefaultTexture(void);                                  // Get default texture | RLAPI Texture2D GetDefaultTexture(void);                                  // Get default texture | ||||||
|  |  | ||||||
| RLAPI int GetShaderLocation(Shader shader, const char *uniformName);              // Get shader uniform location | RLAPI int GetShaderLocation(Shader shader, const char *uniformName);              // Get shader uniform location | ||||||
| @@ -908,19 +966,17 @@ RLAPI void EndShaderMode(void);                                           // End | |||||||
| RLAPI void BeginBlendMode(int mode);                                      // Begin blending mode (alpha, additive, multiplied) | RLAPI void BeginBlendMode(int mode);                                      // Begin blending mode (alpha, additive, multiplied) | ||||||
| RLAPI void EndBlendMode(void);                                            // End blending mode (reset to default: alpha blending) | RLAPI void EndBlendMode(void);                                            // End blending mode (reset to default: alpha blending) | ||||||
|  |  | ||||||
| RLAPI Light CreateLight(int type, Vector3 position, Color diffuse);       // Create a new light, initialize it and add to pool |  | ||||||
| RLAPI void DestroyLight(Light light);                                     // Destroy a light and take it out of the list |  | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // VR experience Functions (Module: rlgl) | // VR experience Functions (Module: rlgl) | ||||||
| // NOTE: This functions are useless when using OpenGL 1.1 | // NOTE: This functions are useless when using OpenGL 1.1 | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI void InitVrDevice(int vdDevice);            // Init VR device | RLAPI void InitVrSimulator(int vrDevice);           // Init VR simulator for selected device | ||||||
| RLAPI void CloseVrDevice(void);                   // Close VR device | RLAPI void CloseVrSimulator(void);                  // Close VR simulator for current device | ||||||
| RLAPI bool IsVrDeviceReady(void);                 // Detect if VR device is ready | RLAPI bool IsVrSimulatorReady(void);                // Detect if VR device is ready | ||||||
| RLAPI bool IsVrSimulator(void);                   // Detect if VR simulator is running | RLAPI void UpdateVrTracking(Camera *camera);        // Update VR tracking (position and orientation) and camera | ||||||
| RLAPI void UpdateVrTracking(Camera *camera);      // Update VR tracking (position and orientation) and camera | RLAPI void ToggleVrMode(void);                      // Enable/Disable VR experience (device or simulator) | ||||||
| RLAPI void ToggleVrMode(void);                    // Enable/Disable VR experience (device or simulator) | RLAPI void BeginVrDrawing(void);                    // Begin VR simulator stereo rendering | ||||||
|  | RLAPI void EndVrDrawing(void);                      // End VR simulator stereo rendering | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Audio Loading and Playing Functions (Module: audio) | // Audio Loading and Playing Functions (Module: audio) | ||||||
| @@ -928,13 +984,13 @@ RLAPI void ToggleVrMode(void);                    // Enable/Disable VR experienc | |||||||
| RLAPI void InitAudioDevice(void);                                     // Initialize audio device and context | RLAPI void InitAudioDevice(void);                                     // Initialize audio device and context | ||||||
| RLAPI void CloseAudioDevice(void);                                    // Close the audio device and context | RLAPI void CloseAudioDevice(void);                                    // Close the audio device and context | ||||||
| RLAPI bool IsAudioDeviceReady(void);                                  // Check if audio device has been initialized successfully | RLAPI bool IsAudioDeviceReady(void);                                  // Check if audio device has been initialized successfully | ||||||
|  | RLAPI void SetMasterVolume(float volume);                             // Set master volume (listener) | ||||||
|  |  | ||||||
| RLAPI Wave LoadWave(const char *fileName);                            // Load wave data from file into RAM | RLAPI Wave LoadWave(const char *fileName);                            // Load wave data from file | ||||||
| RLAPI Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from float array data (32bit) | RLAPI Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data | ||||||
| RLAPI Sound LoadSound(const char *fileName);                          // Load sound to memory | RLAPI Sound LoadSound(const char *fileName);                          // Load sound from file | ||||||
| RLAPI Sound LoadSoundFromWave(Wave wave);                             // Load sound to memory from wave data | RLAPI Sound LoadSoundFromWave(Wave wave);                             // Load sound from wave data | ||||||
| RLAPI Sound LoadSoundFromRES(const char *rresName, int resId);        // Load sound to memory from rRES file (raylib Resource) | RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data | ||||||
| RLAPI void UpdateSound(Sound sound, void *data, int numSamples);      // Update sound buffer with new data |  | ||||||
| RLAPI void UnloadWave(Wave wave);                                     // Unload wave data | RLAPI void UnloadWave(Wave wave);                                     // Unload wave data | ||||||
| RLAPI void UnloadSound(Sound sound);                                  // Unload sound | RLAPI void UnloadSound(Sound sound);                                  // Unload sound | ||||||
| RLAPI void PlaySound(Sound sound);                                    // Play a sound | RLAPI void PlaySound(Sound sound);                                    // Play a sound | ||||||
| @@ -958,13 +1014,14 @@ RLAPI void ResumeMusicStream(Music music);                            // Resume | |||||||
| RLAPI bool IsMusicPlaying(Music music);                               // Check if music is playing | RLAPI bool IsMusicPlaying(Music music);                               // Check if music is playing | ||||||
| RLAPI void SetMusicVolume(Music music, float volume);                 // Set volume for music (1.0 is max level) | RLAPI void SetMusicVolume(Music music, float volume);                 // Set volume for music (1.0 is max level) | ||||||
| RLAPI void SetMusicPitch(Music music, float pitch);                   // Set pitch for a music (1.0 is base level) | RLAPI void SetMusicPitch(Music music, float pitch);                   // Set pitch for a music (1.0 is base level) | ||||||
|  | RLAPI void SetMusicLoopCount(Music music, float count);               // Set music loop count (loop repeats) | ||||||
| RLAPI float GetMusicTimeLength(Music music);                          // Get music time length (in seconds) | RLAPI float GetMusicTimeLength(Music music);                          // Get music time length (in seconds) | ||||||
| RLAPI float GetMusicTimePlayed(Music music);                          // Get current music time played (in seconds) | RLAPI float GetMusicTimePlayed(Music music);                          // Get current music time played (in seconds) | ||||||
|  |  | ||||||
| RLAPI AudioStream InitAudioStream(unsigned int sampleRate, | RLAPI AudioStream InitAudioStream(unsigned int sampleRate, | ||||||
|                                   unsigned int sampleSize, |                                   unsigned int sampleSize, | ||||||
|                                   unsigned int channels);             // Init audio stream (to stream raw audio pcm data) |                                   unsigned int channels);             // Init audio stream (to stream raw audio pcm data) | ||||||
| RLAPI void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data | RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data | ||||||
| RLAPI void CloseAudioStream(AudioStream stream);                      // Close audio stream and free memory | RLAPI void CloseAudioStream(AudioStream stream);                      // Close audio stream and free memory | ||||||
| RLAPI bool IsAudioBufferProcessed(AudioStream stream);                // Check if any audio stream buffers requires refill | RLAPI bool IsAudioBufferProcessed(AudioStream stream);                // Check if any audio stream buffers requires refill | ||||||
| RLAPI void PlayAudioStream(AudioStream stream);                       // Play audio stream | RLAPI void PlayAudioStream(AudioStream stream);                       // Play audio stream | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							| @@ -6,25 +6,23 @@ | |||||||
| * | * | ||||||
| *   FEATURES: | *   FEATURES: | ||||||
| *       - Library written in plain C code (C99) | *       - Library written in plain C code (C99) | ||||||
| *       - Uses PascalCase/camelCase notation | *       - Multiple platforms supported: Windows, Linux, Mac, Android, Raspberry Pi, HTML5. | ||||||
| *       - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) | *       - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) | ||||||
| *       - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] | *       - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] | ||||||
| *       - Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) | *       - Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) | ||||||
| *       - Multiple textures support, including compressed formats and mipmaps generation | *       - Multiple textures support, including compressed formats and mipmaps generation | ||||||
| *       - Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps | *       - Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps | ||||||
| *       - Powerful math module for Vector, Matrix and Quaternion operations: [raymath] | *       - Powerful math module for Vector2, Vector3, Matrix and Quaternion operations: [raymath] | ||||||
| *       - Audio loading and playing with streaming support and mixing channels: [audio] | *       - Audio loading and playing with streaming support and mixing channels: [audio] | ||||||
| *       - VR stereo rendering support with configurable HMD device parameters | *       - VR stereo rendering support with configurable HMD device parameters | ||||||
| *       - Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi, HTML5 and Oculus Rift CV1 |  | ||||||
| *       - Custom color palette for fancy visuals on raywhite background |  | ||||||
| *       - Minimal external dependencies (GLFW3, OpenGL, OpenAL) | *       - Minimal external dependencies (GLFW3, OpenGL, OpenAL) | ||||||
| *       - Complete bindings for Lua, Go and Pascal | *       - Complete bindings for Lua, Go and Pascal | ||||||
| * | * | ||||||
| *   NOTES: | *   NOTES: | ||||||
| *       32bit Colors - All defined color are always RGBA (struct Color is 4 byte) | *       32bit Colors - Any defined Color is always RGBA (4 byte) | ||||||
| *       One custom default font could be loaded automatically when InitWindow() [core] | *       One custom font is loaded by default when InitWindow() [core] | ||||||
|  | *       If using OpenGL 3.3 or ES2, one default shader is loaded automatically (internally defined) [rlgl] | ||||||
| *       If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads | *       If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads | ||||||
| *       If using OpenGL 3.3 or ES2, two default shaders could be loaded automatically (internally defined) |  | ||||||
| * | * | ||||||
| *   DEPENDENCIES: | *   DEPENDENCIES: | ||||||
| *       GLFW3 (www.glfw.org) for window/context management and input [core] | *       GLFW3 (www.glfw.org) for window/context management and input [core] | ||||||
| @@ -74,7 +72,6 @@ | |||||||
| //#define PLATFORM_ANDROID      // Android device | //#define PLATFORM_ANDROID      // Android device | ||||||
| //#define PLATFORM_RPI          // Raspberry Pi | //#define PLATFORM_RPI          // Raspberry Pi | ||||||
| //#define PLATFORM_WEB          // HTML5 (emscripten, asm.js) | //#define PLATFORM_WEB          // HTML5 (emscripten, asm.js) | ||||||
| //#define RLGL_OCULUS_SUPPORT   // Oculus Rift CV1 (complementary to PLATFORM_DESKTOP) |  | ||||||
|  |  | ||||||
| // Security check in case no PLATFORM_* defined | // Security check in case no PLATFORM_* defined | ||||||
| #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) | #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) | ||||||
| @@ -295,7 +292,7 @@ | |||||||
| #define RAYWHITE   CLITERAL{ 245, 245, 245, 255 }   // My own White (raylib logo) | #define RAYWHITE   CLITERAL{ 245, 245, 245, 255 }   // My own White (raylib logo) | ||||||
|  |  | ||||||
| //---------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------- | ||||||
| // Types and Structures Definition | // Structures Definition | ||||||
| //---------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------- | ||||||
| #ifndef __cplusplus | #ifndef __cplusplus | ||||||
| // Boolean type | // Boolean type | ||||||
| @@ -352,7 +349,7 @@ typedef struct Image { | |||||||
|     int format;             // Data format (TextureFormat type) |     int format;             // Data format (TextureFormat type) | ||||||
| } Image; | } Image; | ||||||
|  |  | ||||||
| // Texture2D type, bpp always RGBA (32bit) | // Texture2D type | ||||||
| // NOTE: Data stored in GPU memory | // NOTE: Data stored in GPU memory | ||||||
| typedef struct Texture2D { | typedef struct Texture2D { | ||||||
|     unsigned int id;        // OpenGL texture id |     unsigned int id;        // OpenGL texture id | ||||||
| @@ -480,8 +477,8 @@ typedef struct Ray { | |||||||
| typedef struct RayHitInfo { | typedef struct RayHitInfo { | ||||||
|     bool hit;               // Did the ray hit something? |     bool hit;               // Did the ray hit something? | ||||||
|     float distance;         // Distance to nearest hit |     float distance;         // Distance to nearest hit | ||||||
|     Vector3 hitPosition;    // Position of nearest hit |     Vector3 position;       // Position of nearest hit | ||||||
|     Vector3 hitNormal;      // Surface normal of hit |     Vector3 normal;         // Surface normal of hit | ||||||
| } RayHitInfo; | } RayHitInfo; | ||||||
|  |  | ||||||
| // Wave type, defines audio wave data | // Wave type, defines audio wave data | ||||||
| @@ -516,6 +513,34 @@ typedef struct AudioStream { | |||||||
|     unsigned int buffers[2];    // OpenAL audio buffers (double buffering) |     unsigned int buffers[2];    // OpenAL audio buffers (double buffering) | ||||||
| } AudioStream; | } AudioStream; | ||||||
|  |  | ||||||
|  | // rRES data returned when reading a resource,  | ||||||
|  | // it contains all required data for user (24 byte) | ||||||
|  | typedef struct RRESData { | ||||||
|  |     unsigned int type;          // Resource type (4 byte) | ||||||
|  |  | ||||||
|  |     unsigned int param1;        // Resouce parameter 1 (4 byte) | ||||||
|  |     unsigned int param2;        // Resouce parameter 2 (4 byte) | ||||||
|  |     unsigned int param3;        // Resouce parameter 3 (4 byte) | ||||||
|  |     unsigned int param4;        // Resouce parameter 4 (4 byte) | ||||||
|  |  | ||||||
|  |     void *data;                 // Resource data pointer (4 byte) | ||||||
|  | } RRESData; | ||||||
|  |  | ||||||
|  | // RRES type (pointer to RRESData array) | ||||||
|  | typedef struct RRESData *RRES; | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------------------------------- | ||||||
|  | // Enumerators Definition | ||||||
|  | //---------------------------------------------------------------------------------- | ||||||
|  | // Trace log type | ||||||
|  | typedef enum {  | ||||||
|  |     INFO = 0, | ||||||
|  |     WARNING,  | ||||||
|  |     ERROR,  | ||||||
|  |     DEBUG,  | ||||||
|  |     OTHER  | ||||||
|  | } LogType; | ||||||
|  |  | ||||||
| // Texture formats | // Texture formats | ||||||
| // NOTE: Support depends on OpenGL version and platform | // NOTE: Support depends on OpenGL version and platform | ||||||
| typedef enum { | typedef enum { | ||||||
| @@ -526,6 +551,7 @@ typedef enum { | |||||||
|     UNCOMPRESSED_R5G5B5A1,          // 16 bpp (1 bit alpha) |     UNCOMPRESSED_R5G5B5A1,          // 16 bpp (1 bit alpha) | ||||||
|     UNCOMPRESSED_R4G4B4A4,          // 16 bpp (4 bit alpha) |     UNCOMPRESSED_R4G4B4A4,          // 16 bpp (4 bit alpha) | ||||||
|     UNCOMPRESSED_R8G8B8A8,          // 32 bpp |     UNCOMPRESSED_R8G8B8A8,          // 32 bpp | ||||||
|  |     UNCOMPRESSED_R32G32B32,         // 32 bit per channel (float) - HDR | ||||||
|     COMPRESSED_DXT1_RGB,            // 4 bpp (no alpha) |     COMPRESSED_DXT1_RGB,            // 4 bpp (no alpha) | ||||||
|     COMPRESSED_DXT1_RGBA,           // 4 bpp (1 bit alpha) |     COMPRESSED_DXT1_RGBA,           // 4 bpp (1 bit alpha) | ||||||
|     COMPRESSED_DXT3_RGBA,           // 8 bpp |     COMPRESSED_DXT3_RGBA,           // 8 bpp | ||||||
| @@ -552,10 +578,18 @@ typedef enum { | |||||||
| } TextureFilterMode; | } TextureFilterMode; | ||||||
|  |  | ||||||
| // Texture parameters: wrap mode | // Texture parameters: wrap mode | ||||||
| typedef enum { WRAP_REPEAT = 0, WRAP_CLAMP, WRAP_MIRROR } TextureWrapMode; | typedef enum {  | ||||||
|  |     WRAP_REPEAT = 0,  | ||||||
|  |     WRAP_CLAMP,  | ||||||
|  |     WRAP_MIRROR  | ||||||
|  | } TextureWrapMode; | ||||||
|  |  | ||||||
| // Color blending modes (pre-defined) | // Color blending modes (pre-defined) | ||||||
| typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode; | typedef enum {  | ||||||
|  |     BLEND_ALPHA = 0,  | ||||||
|  |     BLEND_ADDITIVE,  | ||||||
|  |     BLEND_MULTIPLIED | ||||||
|  | } BlendMode; | ||||||
|  |  | ||||||
| // Gestures type | // Gestures type | ||||||
| // NOTE: It could be used as flags to enable only some gestures | // NOTE: It could be used as flags to enable only some gestures | ||||||
| @@ -595,19 +629,6 @@ typedef enum { | |||||||
|     HMD_FOVE_VR, |     HMD_FOVE_VR, | ||||||
| } VrDevice; | } VrDevice; | ||||||
|  |  | ||||||
| // rRES data returned when reading a resource,  |  | ||||||
| // it contains all required data for user (24 byte) |  | ||||||
| typedef struct RRESData { |  | ||||||
|     unsigned int type;          // Resource type (4 byte) |  | ||||||
|  |  | ||||||
|     unsigned int param1;        // Resouce parameter 1 (4 byte) |  | ||||||
|     unsigned int param2;        // Resouce parameter 2 (4 byte) |  | ||||||
|     unsigned int param3;        // Resouce parameter 3 (4 byte) |  | ||||||
|     unsigned int param4;        // Resouce parameter 4 (4 byte) |  | ||||||
|  |  | ||||||
|     void *data;                 // Resource data pointer (4 byte) |  | ||||||
| } RRESData; |  | ||||||
|  |  | ||||||
| // RRESData type | // RRESData type | ||||||
| typedef enum {  | typedef enum {  | ||||||
|     RRES_TYPE_RAW = 0,  |     RRES_TYPE_RAW = 0,  | ||||||
| @@ -620,9 +641,6 @@ typedef enum { | |||||||
|     RRES_TYPE_DIRECTORY |     RRES_TYPE_DIRECTORY | ||||||
| } RRESDataType; | } RRESDataType; | ||||||
|  |  | ||||||
| // RRES type (pointer to RRESData array) |  | ||||||
| typedef struct RRESData *RRES; |  | ||||||
|  |  | ||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| extern "C" {            // Prevents name mangling of functions | extern "C" {            // Prevents name mangling of functions | ||||||
| #endif | #endif | ||||||
| @@ -636,47 +654,48 @@ extern "C" {            // Prevents name mangling of functions | |||||||
| // Window and Graphics Device Functions (Module: core) | // Window and Graphics Device Functions (Module: core) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| #if defined(PLATFORM_ANDROID) | #if defined(PLATFORM_ANDROID) | ||||||
| RLAPI void InitWindow(int width, int height, void *state);        // Init Android Activity and OpenGL Graphics (struct android_app) | RLAPI void InitWindow(int width, int height, void *state);        // Initialize Android activity | ||||||
| #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) | #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) | ||||||
| RLAPI void InitWindow(int width, int height, const char *title);  // Initialize Window and OpenGL Graphics | RLAPI void InitWindow(int width, int height, const char *title);  // Initialize window and OpenGL context | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| RLAPI void CloseWindow(void);                                     // Close Window and Terminate Context | RLAPI void CloseWindow(void);                                     // Close window and unload OpenGL context | ||||||
| RLAPI bool WindowShouldClose(void);                               // Detect if KEY_ESCAPE pressed or Close icon pressed | RLAPI bool WindowShouldClose(void);                               // Check if KEY_ESCAPE pressed or Close icon pressed | ||||||
| RLAPI bool IsWindowMinimized(void);                               // Detect if window has been minimized (or lost focus) | RLAPI bool IsWindowMinimized(void);                               // Check if window has been minimized (or lost focus) | ||||||
| RLAPI void ToggleFullscreen(void);                                // Fullscreen toggle (only PLATFORM_DESKTOP) | RLAPI void ToggleFullscreen(void);                                // Toggle fullscreen mode (only PLATFORM_DESKTOP) | ||||||
| RLAPI void SetWindowIcon(Image image);                            // Set icon for window (only PLATFORM_DESKTOP) | RLAPI void SetWindowIcon(Image image);                            // Set icon for window (only PLATFORM_DESKTOP) | ||||||
| RLAPI void SetWindowPosition(int x, int y);                       // Set window position on screen (only PLATFORM_DESKTOP) | RLAPI void SetWindowPosition(int x, int y);                       // Set window position on screen (only PLATFORM_DESKTOP) | ||||||
| RLAPI void SetWindowMonitor(int monitor);                         // Set monitor for the current window (fullscreen mode) | RLAPI void SetWindowMonitor(int monitor);                         // Set monitor for the current window (fullscreen mode) | ||||||
|  | RLAPI void SetWindowMinSize(int width, int height);               // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) | ||||||
| RLAPI int GetScreenWidth(void);                                   // Get current screen width | RLAPI int GetScreenWidth(void);                                   // Get current screen width | ||||||
| RLAPI int GetScreenHeight(void);                                  // Get current screen height | RLAPI int GetScreenHeight(void);                                  // Get current screen height | ||||||
|  |  | ||||||
| #if !defined(PLATFORM_ANDROID) | #if !defined(PLATFORM_ANDROID) | ||||||
| RLAPI void ShowCursor(void);                                      // Shows cursor | RLAPI void ShowCursor(void);                                      // Shows cursor | ||||||
| RLAPI void HideCursor(void);                                      // Hides cursor | RLAPI void HideCursor(void);                                      // Hides cursor | ||||||
| RLAPI bool IsCursorHidden(void);                                  // Returns true if cursor is not visible | RLAPI bool IsCursorHidden(void);                                  // Check if cursor is not visible | ||||||
| RLAPI void EnableCursor(void);                                    // Enables cursor | RLAPI void EnableCursor(void);                                    // Enables cursor (unlock cursor) | ||||||
| RLAPI void DisableCursor(void);                                   // Disables cursor | RLAPI void DisableCursor(void);                                   // Disables cursor (lock cursor) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| RLAPI void ClearBackground(Color color);                          // Sets Background Color | RLAPI void ClearBackground(Color color);                          // Set background color (framebuffer clear color) | ||||||
| RLAPI void BeginDrawing(void);                                    // Setup drawing canvas to start drawing | RLAPI void BeginDrawing(void);                                    // Setup canvas (framebuffer) to start drawing | ||||||
| RLAPI void EndDrawing(void);                                      // End canvas drawing and Swap Buffers (Double Buffering) | RLAPI void EndDrawing(void);                                      // End canvas drawing and swap buffers (double buffering) | ||||||
|  |  | ||||||
| RLAPI void Begin2dMode(Camera2D camera);                          // Initialize 2D mode with custom camera | RLAPI void Begin2dMode(Camera2D camera);                          // Initialize 2D mode with custom camera (2D) | ||||||
| RLAPI void End2dMode(void);                                       // Ends 2D mode custom camera usage | RLAPI void End2dMode(void);                                       // Ends 2D mode with custom camera | ||||||
| RLAPI void Begin3dMode(Camera camera);                            // Initializes 3D mode for drawing (Camera setup) | RLAPI void Begin3dMode(Camera camera);                            // Initializes 3D mode with custom camera (3D) | ||||||
| RLAPI void End3dMode(void);                                       // Ends 3D mode and returns to default 2D orthographic mode | RLAPI void End3dMode(void);                                       // Ends 3D mode and returns to default 2D orthographic mode | ||||||
| RLAPI void BeginTextureMode(RenderTexture2D target);              // Initializes render texture for drawing | RLAPI void BeginTextureMode(RenderTexture2D target);              // Initializes render texture for drawing | ||||||
| RLAPI void EndTextureMode(void);                                  // Ends drawing to render texture | RLAPI void EndTextureMode(void);                                  // Ends drawing to render texture | ||||||
|  |  | ||||||
| RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera);      // Returns a ray trace from mouse position | RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera);      // Returns a ray trace from mouse position | ||||||
| RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera);  // Returns the screen space position from a 3d world space position | RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera);  // Returns the screen space position for a 3d world space position | ||||||
| RLAPI Matrix GetCameraMatrix(Camera camera);                      // Returns camera transform matrix (view matrix) | RLAPI Matrix GetCameraMatrix(Camera camera);                      // Returns camera transform matrix (view matrix) | ||||||
|  |  | ||||||
| RLAPI void SetTargetFPS(int fps);                                 // Set target FPS (maximum) | RLAPI void SetTargetFPS(int fps);                                 // Set target FPS (maximum) | ||||||
| RLAPI int GetFPS(void);                                           // Returns current FPS | RLAPI int GetFPS(void);                                           // Returns current FPS | ||||||
| RLAPI float GetFrameTime(void);                                   // Returns time in seconds for one frame | RLAPI float GetFrameTime(void);                                   // Returns time in seconds for last frame drawn | ||||||
|  |  | ||||||
| RLAPI Color GetColor(int hexValue);                               // Returns a Color struct from hexadecimal value | RLAPI Color GetColor(int hexValue);                               // Returns a Color struct from hexadecimal value | ||||||
| RLAPI int GetHexValue(Color color);                               // Returns hexadecimal value for a Color | RLAPI int GetHexValue(Color color);                               // Returns hexadecimal value for a Color | ||||||
| @@ -687,18 +706,21 @@ RLAPI float *MatrixToFloat(Matrix mat);                           // Converts Ma | |||||||
| RLAPI int GetRandomValue(int min, int max);                       // Returns a random value between min and max (both included) | RLAPI int GetRandomValue(int min, int max);                       // Returns a random value between min and max (both included) | ||||||
| RLAPI Color Fade(Color color, float alpha);                       // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f | RLAPI Color Fade(Color color, float alpha);                       // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f | ||||||
|  |  | ||||||
| RLAPI void ShowLogo(void);                                        // Activates raylib logo at startup (can be done with flags) | RLAPI void ShowLogo(void);                                        // Activate raylib logo at startup (can be done with flags) | ||||||
| RLAPI void SetConfigFlags(char flags);                            // Setup some window configuration flags | RLAPI void SetConfigFlags(char flags);                            // Setup window configuration flags (view FLAGS) | ||||||
| //RLAPI void TraceLog(int logType, const char *text, ...);          // Show trace log messages (INFO, WARNING, ERROR, DEBUG) | RLAPI void TraceLog(int logType, const char *text, ...);          // Show trace log messages (INFO, WARNING, ERROR, DEBUG) | ||||||
| RLAPI void TakeScreenshot(void);                                  // Takes a screenshot and saves it in the same folder as executable | RLAPI void TakeScreenshot(const char *fileName);                  // Takes a screenshot of current screen (saved a .png) | ||||||
| RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension |  | ||||||
|  |  | ||||||
| RLAPI bool IsFileDropped(void);                                   // Check if a file have been dropped into window | RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension | ||||||
| RLAPI char **GetDroppedFiles(int *count);                         // Retrieve dropped files into window | RLAPI const char *GetDirectoryPath(const char *fileName);         // Get directory for a given fileName (with path) | ||||||
|  | RLAPI const char *GetWorkingDirectory(void);                      // Get current working directory | ||||||
|  | RLAPI bool ChangeDirectory(const char *dir);                      // Change working directory, returns true if success | ||||||
|  | RLAPI bool IsFileDropped(void);                                   // Check if a file has been dropped into window | ||||||
|  | RLAPI char **GetDroppedFiles(int *count);                         // Get dropped files names | ||||||
| RLAPI void ClearDroppedFiles(void);                               // Clear dropped files paths buffer | RLAPI void ClearDroppedFiles(void);                               // Clear dropped files paths buffer | ||||||
|  |  | ||||||
| RLAPI void StorageSaveValue(int position, int value);             // Storage save integer value (to defined position) | RLAPI void StorageSaveValue(int position, int value);             // Save integer value to storage file (to defined position) | ||||||
| RLAPI int StorageLoadValue(int position);                         // Storage load integer value (from defined position) | RLAPI int StorageLoadValue(int position);                         // Load integer value from storage file (from defined position) | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Input Handling Functions (Module: core) | // Input Handling Functions (Module: core) | ||||||
| @@ -847,7 +869,7 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle dest | |||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont | RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont | ||||||
| RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load SpriteFont from file into GPU memory (VRAM) | RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load SpriteFont from file into GPU memory (VRAM) | ||||||
| RLAPI SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int charsCount, int *fontChars);  // Load SpriteFont from TTF font file with generation parameters | RLAPI SpriteFont LoadSpriteFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars);   // Load SpriteFont from file with extended parameters | ||||||
| RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory (VRAM) | RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory (VRAM) | ||||||
|  |  | ||||||
| RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color);                    // Draw text (using default font) | RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color);                    // Draw text (using default font) | ||||||
| @@ -856,7 +878,7 @@ RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, | |||||||
| RLAPI int MeasureText(const char *text, int fontSize);                                                   // Measure string width for default font | RLAPI int MeasureText(const char *text, int fontSize);                                                   // Measure string width for default font | ||||||
| RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing);       // Measure string size for SpriteFont | RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing);       // Measure string size for SpriteFont | ||||||
|  |  | ||||||
| RLAPI void DrawFPS(int posX, int posY);                                                                  // Shows current FPS on top-left corner | RLAPI void DrawFPS(int posX, int posY);                                                                  // Shows current FPS | ||||||
| RLAPI const char *FormatText(const char *text, ...);                                                     // Formatting of text with variables to 'embed' | RLAPI const char *FormatText(const char *text, ...);                                                     // Formatting of text with variables to 'embed' | ||||||
| RLAPI const char *SubText(const char *text, int position, int length);                                   // Get a piece of a text string | RLAPI const char *SubText(const char *text, int position, int length);                                   // Get a piece of a text string | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,51 +1,51 @@ | |||||||
| /********************************************************************************************** | /********************************************************************************************** | ||||||
| * | * | ||||||
| *   raylib 1.6.0 (www.raylib.com) | *   raylib v1.7.0  | ||||||
| * | * | ||||||
| *   A simple and easy-to-use library to learn videogames programming | *   A simple and easy-to-use library to learn videogames programming (www.raylib.com) | ||||||
| * | * | ||||||
| *   Features: | *   FEATURES: | ||||||
| *     Library written in plain C code (C99) | *       - Library written in plain C code (C99) | ||||||
| *     Uses PascalCase/camelCase notation | *       - Multiple platforms supported: Windows, Linux, Mac, Android, Raspberry Pi, HTML5. | ||||||
| *     Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) | *       - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) | ||||||
| *     Unique OpenGL abstraction layer (usable as standalone module): [rlgl] | *       - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] | ||||||
| *     Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) | *       - Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) | ||||||
| *     Multiple textures support, including compressed formats and mipmaps generation | *       - Multiple textures support, including compressed formats and mipmaps generation | ||||||
| *     Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps | *       - Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps | ||||||
| *     Materials (diffuse, normal, specular) and Lighting (point, directional, spot) support | *       - Powerful math module for Vector2, Vector3, Matrix and Quaternion operations: [raymath] | ||||||
| *     Powerful math module for Vector, Matrix and Quaternion operations: [raymath] | *       - Audio loading and playing with streaming support and mixing channels: [audio] | ||||||
| *     Audio loading and playing with streaming support and mixing channels [audio] | *       - VR stereo rendering support with configurable HMD device parameters | ||||||
| *     VR stereo rendering support with configurable HMD device parameters | *       - Minimal external dependencies (GLFW3, OpenGL, OpenAL) | ||||||
| *     Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi, HTML5 and Oculus Rift CV1 | *       - Complete bindings for Lua, Go and Pascal | ||||||
| *     Custom color palette for fancy visuals on raywhite background |  | ||||||
| *     Minimal external dependencies (GLFW3, OpenGL, OpenAL) |  | ||||||
| *     Complete binding for LUA [rlua] |  | ||||||
| * | * | ||||||
| *   External libs: | *   NOTES: | ||||||
| *     GLFW3 (www.glfw.org) for window/context management and input [core] | *       32bit Colors - Any defined Color is always RGBA (4 byte) | ||||||
| *     GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] | *       One custom font is loaded by default when InitWindow() [core] | ||||||
| *     stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] | *       If using OpenGL 3.3 or ES2, one default shader is loaded automatically (internally defined) [rlgl] | ||||||
| *     stb_image_write (Sean Barret) for image writting (PNG) [utils] | *       If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads | ||||||
| *     stb_truetype (Sean Barret) for ttf fonts loading [text] |  | ||||||
| *     stb_vorbis (Sean Barret) for ogg audio loading [audio] |  | ||||||
| *     jar_xm (Joshua Reisenauer) for XM audio module loading [audio] |  | ||||||
| *     jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] |  | ||||||
| *     dr_flac (David Reid) for FLAC audio file loading [audio] |  | ||||||
| *     OpenAL Soft for audio device/context management [audio] |  | ||||||
| *     tinfl for data decompression (DEFLATE algorithm) [utils] |  | ||||||
| * | * | ||||||
| *   Some design decisions: | *   DEPENDENCIES: | ||||||
| *     32bit Colors - All defined color are always RGBA (struct Color is 4 byte) | *       GLFW3 (www.glfw.org) for window/context management and input [core] | ||||||
| *     One custom default font could be loaded automatically when InitWindow() [core] | *       GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] | ||||||
| *     If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads | *       OpenAL Soft for audio device/context management [audio] | ||||||
| *     If using OpenGL 3.3 or ES2, two default shaders could be loaded automatically (internally defined) |  | ||||||
| * | * | ||||||
| *   -- LICENSE -- | *   OPTIONAL DEPENDENCIES: | ||||||
|  | *       stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] | ||||||
|  | *       stb_image_write (Sean Barret) for image writting (PNG) [utils] | ||||||
|  | *       stb_truetype (Sean Barret) for ttf fonts loading [text] | ||||||
|  | *       stb_vorbis (Sean Barret) for ogg audio loading [audio] | ||||||
|  | *       jar_xm (Joshua Reisenauer) for XM audio module loading [audio] | ||||||
|  | *       jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] | ||||||
|  | *       dr_flac (David Reid) for FLAC audio file loading [audio] | ||||||
|  | *       tinfl for data decompression (DEFLATE algorithm) [rres] | ||||||
|  | * | ||||||
|  | * | ||||||
|  | *   LICENSE: zlib/libpng | ||||||
| * | * | ||||||
| *   raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, | *   raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, | ||||||
| *   BSD-like license that allows static linking with closed source software: | *   BSD-like license that allows static linking with closed source software: | ||||||
| * | * | ||||||
| *   Copyright (c) 2013-2016 Ramon Santamaria (@raysan5) | *   Copyright (c) 2013-2017 Ramon Santamaria (@raysan5) | ||||||
| * | * | ||||||
| *   This software is provided "as-is", without any express or implied warranty. In no event | *   This software is provided "as-is", without any express or implied warranty. In no event | ||||||
| *   will the authors be held liable for any damages arising from the use of this software. | *   will the authors be held liable for any damages arising from the use of this software. | ||||||
| @@ -72,7 +72,6 @@ | |||||||
| //#define PLATFORM_ANDROID      // Android device | //#define PLATFORM_ANDROID      // Android device | ||||||
| //#define PLATFORM_RPI          // Raspberry Pi | //#define PLATFORM_RPI          // Raspberry Pi | ||||||
| //#define PLATFORM_WEB          // HTML5 (emscripten, asm.js) | //#define PLATFORM_WEB          // HTML5 (emscripten, asm.js) | ||||||
| //#define RLGL_OCULUS_SUPPORT   // Oculus Rift CV1 (complementary to PLATFORM_DESKTOP) |  | ||||||
|  |  | ||||||
| // Security check in case no PLATFORM_* defined | // Security check in case no PLATFORM_* defined | ||||||
| #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) | #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) | ||||||
| @@ -98,13 +97,13 @@ | |||||||
| #define RAD2DEG (180.0f/PI) | #define RAD2DEG (180.0f/PI) | ||||||
|  |  | ||||||
| // raylib Config Flags | // raylib Config Flags | ||||||
| #define FLAG_FULLSCREEN_MODE    1 | #define FLAG_SHOW_LOGO              1       // Set to show raylib logo at startup | ||||||
| #define FLAG_RESIZABLE_WINDOW   2 | #define FLAG_FULLSCREEN_MODE        2       // Set to run program in fullscreen | ||||||
| #define FLAG_SHOW_LOGO          4 | #define FLAG_WINDOW_RESIZABLE       4       // Set to allow resizable window | ||||||
| #define FLAG_SHOW_MOUSE_CURSOR  8 | #define FLAG_WINDOW_DECORATED       8       // Set to show window decoration (frame and buttons) | ||||||
| #define FLAG_CENTERED_MODE     16 | #define FLAG_WINDOW_TRANSPARENT    16       // Set to allow transparent window | ||||||
| #define FLAG_MSAA_4X_HINT      32 | #define FLAG_MSAA_4X_HINT          32       // Set to try enabling MSAA 4X | ||||||
| #define FLAG_VSYNC_HINT        64 | #define FLAG_VSYNC_HINT            64       // Set to try enabling V-Sync on GPU | ||||||
|  |  | ||||||
| // Keyboard Function Keys | // Keyboard Function Keys | ||||||
| #define KEY_SPACE            32 | #define KEY_SPACE            32 | ||||||
| @@ -293,17 +292,13 @@ | |||||||
| #define RAYWHITE   CLITERAL{ 245, 245, 245, 255 }   // My own White (raylib logo) | #define RAYWHITE   CLITERAL{ 245, 245, 245, 255 }   // My own White (raylib logo) | ||||||
|  |  | ||||||
| //---------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------- | ||||||
| // Types and Structures Definition | // Structures Definition | ||||||
| //---------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------- | ||||||
| #ifndef __cplusplus | #ifndef __cplusplus | ||||||
| // Boolean type | // Boolean type | ||||||
|     #ifndef __APPLE__ |     #if !defined(_STDBOOL_H) | ||||||
|         #if !defined(_STDBOOL_H) |         typedef enum { false, true } bool; | ||||||
|             typedef enum { false, true } bool; |         #define _STDBOOL_H | ||||||
|             #define _STDBOOL_H |  | ||||||
|         #endif |  | ||||||
|     #else |  | ||||||
|         #include <stdbool.h> |  | ||||||
|     #endif |     #endif | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| @@ -351,35 +346,41 @@ typedef struct Image { | |||||||
|     int width;              // Image base width |     int width;              // Image base width | ||||||
|     int height;             // Image base height |     int height;             // Image base height | ||||||
|     int mipmaps;            // Mipmap levels, 1 by default |     int mipmaps;            // Mipmap levels, 1 by default | ||||||
|     int format;             // Data format (TextureFormat) |     int format;             // Data format (TextureFormat type) | ||||||
| } Image; | } Image; | ||||||
|  |  | ||||||
| // Texture2D type, bpp always RGBA (32bit) | // Texture2D type | ||||||
| // NOTE: Data stored in GPU memory | // NOTE: Data stored in GPU memory | ||||||
| typedef struct Texture2D { | typedef struct Texture2D { | ||||||
|     unsigned int id;        // OpenGL texture id |     unsigned int id;        // OpenGL texture id | ||||||
|     int width;              // Texture base width |     int width;              // Texture base width | ||||||
|     int height;             // Texture base height |     int height;             // Texture base height | ||||||
|     int mipmaps;            // Mipmap levels, 1 by default |     int mipmaps;            // Mipmap levels, 1 by default | ||||||
|     int format;             // Data format (TextureFormat) |     int format;             // Data format (TextureFormat type) | ||||||
| } Texture2D; | } Texture2D; | ||||||
|  |  | ||||||
| // RenderTexture2D type, for texture rendering | // RenderTexture2D type, for texture rendering | ||||||
| typedef struct RenderTexture2D { | typedef struct RenderTexture2D { | ||||||
|     unsigned int id;        // Render texture (fbo) id |     unsigned int id;        // OpenGL Framebuffer Object (FBO) id | ||||||
|     Texture2D texture;      // Color buffer attachment texture |     Texture2D texture;      // Color buffer attachment texture | ||||||
|     Texture2D depth;        // Depth buffer attachment texture |     Texture2D depth;        // Depth buffer attachment texture | ||||||
| } RenderTexture2D; | } RenderTexture2D; | ||||||
|  |  | ||||||
|  | // SpriteFont character info | ||||||
|  | typedef struct CharInfo { | ||||||
|  |     int value;              // Character value (Unicode) | ||||||
|  |     Rectangle rec;          // Character rectangle in sprite font | ||||||
|  |     int offsetX;            // Character offset X when drawing | ||||||
|  |     int offsetY;            // Character offset Y when drawing | ||||||
|  |     int advanceX;           // Character advance position X | ||||||
|  | } CharInfo; | ||||||
|  |  | ||||||
| // SpriteFont type, includes texture and charSet array data | // SpriteFont type, includes texture and charSet array data | ||||||
| typedef struct SpriteFont { | typedef struct SpriteFont { | ||||||
|     Texture2D texture;      // Font texture |     Texture2D texture;      // Font texture | ||||||
|     int size;               // Base size (default chars height) |     int baseSize;           // Base size (default chars height) | ||||||
|     int numChars;           // Number of characters |     int charsCount;         // Number of characters | ||||||
|     int *charValues;        // Characters values array |     CharInfo *chars;        // Characters info data | ||||||
|     Rectangle *charRecs;    // Characters rectangles within the texture |  | ||||||
|     Vector2 *charOffsets;   // Characters offsets (on drawing) |  | ||||||
|     int *charAdvanceX;      // Characters x advance (on drawing) |  | ||||||
| } SpriteFont; | } SpriteFont; | ||||||
|  |  | ||||||
| // Camera type, defines a camera position/orientation in 3d space | // Camera type, defines a camera position/orientation in 3d space | ||||||
| @@ -466,31 +467,20 @@ typedef struct Model { | |||||||
|     Material material;      // Shader and textures data |     Material material;      // Shader and textures data | ||||||
| } Model; | } Model; | ||||||
|  |  | ||||||
| // Light type |  | ||||||
| typedef struct LightData { |  | ||||||
|     unsigned int id;        // Light unique id |  | ||||||
|     bool enabled;           // Light enabled |  | ||||||
|     int type;               // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT |  | ||||||
|  |  | ||||||
|     Vector3 position;       // Light position |  | ||||||
|     Vector3 target;         // Light direction: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) |  | ||||||
|     float radius;           // Light attenuation radius light intensity reduced with distance (world distance) |  | ||||||
|  |  | ||||||
|     Color diffuse;          // Light diffuse color |  | ||||||
|     float intensity;        // Light intensity level |  | ||||||
|  |  | ||||||
|     float coneAngle;        // Light cone max angle: LIGHT_SPOT |  | ||||||
| } LightData, *Light; |  | ||||||
|  |  | ||||||
| // Light types |  | ||||||
| typedef enum { LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT } LightType; |  | ||||||
|  |  | ||||||
| // Ray type (useful for raycast) | // Ray type (useful for raycast) | ||||||
| typedef struct Ray { | typedef struct Ray { | ||||||
|     Vector3 position;       // Ray position (origin) |     Vector3 position;       // Ray position (origin) | ||||||
|     Vector3 direction;      // Ray direction |     Vector3 direction;      // Ray direction | ||||||
| } Ray; | } Ray; | ||||||
|  |  | ||||||
|  | // Information returned from a raycast | ||||||
|  | typedef struct RayHitInfo { | ||||||
|  |     bool hit;               // Did the ray hit something? | ||||||
|  |     float distance;         // Distance to nearest hit | ||||||
|  |     Vector3 position;       // Position of nearest hit | ||||||
|  |     Vector3 normal;         // Surface normal of hit | ||||||
|  | } RayHitInfo; | ||||||
|  |  | ||||||
| // Wave type, defines audio wave data | // Wave type, defines audio wave data | ||||||
| typedef struct Wave { | typedef struct Wave { | ||||||
|     unsigned int sampleCount;   // Number of samples |     unsigned int sampleCount;   // Number of samples | ||||||
| @@ -523,6 +513,34 @@ typedef struct AudioStream { | |||||||
|     unsigned int buffers[2];    // OpenAL audio buffers (double buffering) |     unsigned int buffers[2];    // OpenAL audio buffers (double buffering) | ||||||
| } AudioStream; | } AudioStream; | ||||||
|  |  | ||||||
|  | // rRES data returned when reading a resource,  | ||||||
|  | // it contains all required data for user (24 byte) | ||||||
|  | typedef struct RRESData { | ||||||
|  |     unsigned int type;          // Resource type (4 byte) | ||||||
|  |  | ||||||
|  |     unsigned int param1;        // Resouce parameter 1 (4 byte) | ||||||
|  |     unsigned int param2;        // Resouce parameter 2 (4 byte) | ||||||
|  |     unsigned int param3;        // Resouce parameter 3 (4 byte) | ||||||
|  |     unsigned int param4;        // Resouce parameter 4 (4 byte) | ||||||
|  |  | ||||||
|  |     void *data;                 // Resource data pointer (4 byte) | ||||||
|  | } RRESData; | ||||||
|  |  | ||||||
|  | // RRES type (pointer to RRESData array) | ||||||
|  | typedef struct RRESData *RRES; | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------------------------------- | ||||||
|  | // Enumerators Definition | ||||||
|  | //---------------------------------------------------------------------------------- | ||||||
|  | // Trace log type | ||||||
|  | typedef enum {  | ||||||
|  |     INFO = 0, | ||||||
|  |     WARNING,  | ||||||
|  |     ERROR,  | ||||||
|  |     DEBUG,  | ||||||
|  |     OTHER  | ||||||
|  | } LogType; | ||||||
|  |  | ||||||
| // Texture formats | // Texture formats | ||||||
| // NOTE: Support depends on OpenGL version and platform | // NOTE: Support depends on OpenGL version and platform | ||||||
| typedef enum { | typedef enum { | ||||||
| @@ -533,6 +551,7 @@ typedef enum { | |||||||
|     UNCOMPRESSED_R5G5B5A1,          // 16 bpp (1 bit alpha) |     UNCOMPRESSED_R5G5B5A1,          // 16 bpp (1 bit alpha) | ||||||
|     UNCOMPRESSED_R4G4B4A4,          // 16 bpp (4 bit alpha) |     UNCOMPRESSED_R4G4B4A4,          // 16 bpp (4 bit alpha) | ||||||
|     UNCOMPRESSED_R8G8B8A8,          // 32 bpp |     UNCOMPRESSED_R8G8B8A8,          // 32 bpp | ||||||
|  |     UNCOMPRESSED_R32G32B32,         // 32 bit per channel (float) - HDR | ||||||
|     COMPRESSED_DXT1_RGB,            // 4 bpp (no alpha) |     COMPRESSED_DXT1_RGB,            // 4 bpp (no alpha) | ||||||
|     COMPRESSED_DXT1_RGBA,           // 4 bpp (1 bit alpha) |     COMPRESSED_DXT1_RGBA,           // 4 bpp (1 bit alpha) | ||||||
|     COMPRESSED_DXT3_RGBA,           // 8 bpp |     COMPRESSED_DXT3_RGBA,           // 8 bpp | ||||||
| @@ -549,7 +568,7 @@ typedef enum { | |||||||
| // Texture parameters: filter mode | // Texture parameters: filter mode | ||||||
| // NOTE 1: Filtering considers mipmaps if available in the texture | // NOTE 1: Filtering considers mipmaps if available in the texture | ||||||
| // NOTE 2: Filter is accordingly set for minification and magnification | // NOTE 2: Filter is accordingly set for minification and magnification | ||||||
| typedef enum {  | typedef enum { | ||||||
|     FILTER_POINT = 0,               // No filter, just pixel aproximation |     FILTER_POINT = 0,               // No filter, just pixel aproximation | ||||||
|     FILTER_BILINEAR,                // Linear filtering |     FILTER_BILINEAR,                // Linear filtering | ||||||
|     FILTER_TRILINEAR,               // Trilinear filtering (linear with mipmaps) |     FILTER_TRILINEAR,               // Trilinear filtering (linear with mipmaps) | ||||||
| @@ -559,10 +578,18 @@ typedef enum { | |||||||
| } TextureFilterMode; | } TextureFilterMode; | ||||||
|  |  | ||||||
| // Texture parameters: wrap mode | // Texture parameters: wrap mode | ||||||
| typedef enum { WRAP_REPEAT = 0, WRAP_CLAMP, WRAP_MIRROR } TextureWrapMode; | typedef enum {  | ||||||
|  |     WRAP_REPEAT = 0,  | ||||||
|  |     WRAP_CLAMP,  | ||||||
|  |     WRAP_MIRROR  | ||||||
|  | } TextureWrapMode; | ||||||
|  |  | ||||||
| // Color blending modes (pre-defined) | // Color blending modes (pre-defined) | ||||||
| typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode; | typedef enum {  | ||||||
|  |     BLEND_ALPHA = 0,  | ||||||
|  |     BLEND_ADDITIVE,  | ||||||
|  |     BLEND_MULTIPLIED | ||||||
|  | } BlendMode; | ||||||
|  |  | ||||||
| // Gestures type | // Gestures type | ||||||
| // NOTE: It could be used as flags to enable only some gestures | // NOTE: It could be used as flags to enable only some gestures | ||||||
| @@ -581,12 +608,12 @@ typedef enum { | |||||||
| } Gestures; | } Gestures; | ||||||
|  |  | ||||||
| // Camera system modes | // Camera system modes | ||||||
| typedef enum {  | typedef enum { | ||||||
|     CAMERA_CUSTOM = 0,  |     CAMERA_CUSTOM = 0, | ||||||
|     CAMERA_FREE,  |     CAMERA_FREE, | ||||||
|     CAMERA_ORBITAL,  |     CAMERA_ORBITAL, | ||||||
|     CAMERA_FIRST_PERSON,  |     CAMERA_FIRST_PERSON, | ||||||
|     CAMERA_THIRD_PERSON  |     CAMERA_THIRD_PERSON | ||||||
| } CameraMode; | } CameraMode; | ||||||
|  |  | ||||||
| // Head Mounted Display devices | // Head Mounted Display devices | ||||||
| @@ -602,6 +629,18 @@ typedef enum { | |||||||
|     HMD_FOVE_VR, |     HMD_FOVE_VR, | ||||||
| } VrDevice; | } VrDevice; | ||||||
|  |  | ||||||
|  | // RRESData type | ||||||
|  | typedef enum {  | ||||||
|  |     RRES_TYPE_RAW = 0,  | ||||||
|  |     RRES_TYPE_IMAGE,  | ||||||
|  |     RRES_TYPE_WAVE,  | ||||||
|  |     RRES_TYPE_VERTEX,  | ||||||
|  |     RRES_TYPE_TEXT, | ||||||
|  |     RRES_TYPE_FONT_IMAGE, | ||||||
|  |     RRES_TYPE_FONT_CHARDATA,    // CharInfo data array | ||||||
|  |     RRES_TYPE_DIRECTORY | ||||||
|  | } RRESDataType; | ||||||
|  |  | ||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| extern "C" {            // Prevents name mangling of functions | extern "C" {            // Prevents name mangling of functions | ||||||
| #endif | #endif | ||||||
| @@ -615,44 +654,48 @@ extern "C" {            // Prevents name mangling of functions | |||||||
| // Window and Graphics Device Functions (Module: core) | // Window and Graphics Device Functions (Module: core) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| #if defined(PLATFORM_ANDROID) | #if defined(PLATFORM_ANDROID) | ||||||
| RLAPI void InitWindow(int width, int height, void *state);        // Init Android Activity and OpenGL Graphics (struct android_app) | RLAPI void InitWindow(int width, int height, void *state);        // Initialize Android activity | ||||||
| #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) | #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) | ||||||
| RLAPI void InitWindow(int width, int height, const char *title);  // Initialize Window and OpenGL Graphics | RLAPI void InitWindow(int width, int height, const char *title);  // Initialize window and OpenGL context | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| RLAPI void CloseWindow(void);                                     // Close Window and Terminate Context | RLAPI void CloseWindow(void);                                     // Close window and unload OpenGL context | ||||||
| RLAPI bool WindowShouldClose(void);                               // Detect if KEY_ESCAPE pressed or Close icon pressed | RLAPI bool WindowShouldClose(void);                               // Check if KEY_ESCAPE pressed or Close icon pressed | ||||||
| RLAPI bool IsWindowMinimized(void);                               // Detect if window has been minimized (or lost focus) | RLAPI bool IsWindowMinimized(void);                               // Check if window has been minimized (or lost focus) | ||||||
| RLAPI void ToggleFullscreen(void);                                // Fullscreen toggle (only PLATFORM_DESKTOP) | RLAPI void ToggleFullscreen(void);                                // Toggle fullscreen mode (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowIcon(Image image);                            // Set icon for window (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowPosition(int x, int y);                       // Set window position on screen (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowMonitor(int monitor);                         // Set monitor for the current window (fullscreen mode) | ||||||
|  | RLAPI void SetWindowMinSize(int width, int height);               // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) | ||||||
| RLAPI int GetScreenWidth(void);                                   // Get current screen width | RLAPI int GetScreenWidth(void);                                   // Get current screen width | ||||||
| RLAPI int GetScreenHeight(void);                                  // Get current screen height | RLAPI int GetScreenHeight(void);                                  // Get current screen height | ||||||
|  |  | ||||||
| #if !defined(PLATFORM_ANDROID) | #if !defined(PLATFORM_ANDROID) | ||||||
| RLAPI void ShowCursor(void);                                      // Shows cursor | RLAPI void ShowCursor(void);                                      // Shows cursor | ||||||
| RLAPI void HideCursor(void);                                      // Hides cursor | RLAPI void HideCursor(void);                                      // Hides cursor | ||||||
| RLAPI bool IsCursorHidden(void);                                  // Returns true if cursor is not visible | RLAPI bool IsCursorHidden(void);                                  // Check if cursor is not visible | ||||||
| RLAPI void EnableCursor(void);                                    // Enables cursor | RLAPI void EnableCursor(void);                                    // Enables cursor (unlock cursor) | ||||||
| RLAPI void DisableCursor(void);                                   // Disables cursor | RLAPI void DisableCursor(void);                                   // Disables cursor (lock cursor) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| RLAPI void ClearBackground(Color color);                          // Sets Background Color | RLAPI void ClearBackground(Color color);                          // Set background color (framebuffer clear color) | ||||||
| RLAPI void BeginDrawing(void);                                    // Setup drawing canvas to start drawing | RLAPI void BeginDrawing(void);                                    // Setup canvas (framebuffer) to start drawing | ||||||
| RLAPI void EndDrawing(void);                                      // End canvas drawing and Swap Buffers (Double Buffering) | RLAPI void EndDrawing(void);                                      // End canvas drawing and swap buffers (double buffering) | ||||||
|  |  | ||||||
| RLAPI void Begin2dMode(Camera2D camera);                          // Initialize 2D mode with custom camera | RLAPI void Begin2dMode(Camera2D camera);                          // Initialize 2D mode with custom camera (2D) | ||||||
| RLAPI void End2dMode(void);                                       // Ends 2D mode custom camera usage | RLAPI void End2dMode(void);                                       // Ends 2D mode with custom camera | ||||||
| RLAPI void Begin3dMode(Camera camera);                            // Initializes 3D mode for drawing (Camera setup) | RLAPI void Begin3dMode(Camera camera);                            // Initializes 3D mode with custom camera (3D) | ||||||
| RLAPI void End3dMode(void);                                       // Ends 3D mode and returns to default 2D orthographic mode | RLAPI void End3dMode(void);                                       // Ends 3D mode and returns to default 2D orthographic mode | ||||||
| RLAPI void BeginTextureMode(RenderTexture2D target);              // Initializes render texture for drawing | RLAPI void BeginTextureMode(RenderTexture2D target);              // Initializes render texture for drawing | ||||||
| RLAPI void EndTextureMode(void);                                  // Ends drawing to render texture | RLAPI void EndTextureMode(void);                                  // Ends drawing to render texture | ||||||
|  |  | ||||||
| RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera);      // Returns a ray trace from mouse position | RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera);      // Returns a ray trace from mouse position | ||||||
| RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera);  // Returns the screen space position from a 3d world space position | RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera);  // Returns the screen space position for a 3d world space position | ||||||
| RLAPI Matrix GetCameraMatrix(Camera camera);                      // Returns camera transform matrix (view matrix) | RLAPI Matrix GetCameraMatrix(Camera camera);                      // Returns camera transform matrix (view matrix) | ||||||
|  |  | ||||||
| RLAPI void SetTargetFPS(int fps);                                 // Set target FPS (maximum) | RLAPI void SetTargetFPS(int fps);                                 // Set target FPS (maximum) | ||||||
| RLAPI float GetFPS(void);                                         // Returns current FPS | RLAPI int GetFPS(void);                                           // Returns current FPS | ||||||
| RLAPI float GetFrameTime(void);                                   // Returns time in seconds for one frame | RLAPI float GetFrameTime(void);                                   // Returns time in seconds for last frame drawn | ||||||
|  |  | ||||||
| RLAPI Color GetColor(int hexValue);                               // Returns a Color struct from hexadecimal value | RLAPI Color GetColor(int hexValue);                               // Returns a Color struct from hexadecimal value | ||||||
| RLAPI int GetHexValue(Color color);                               // Returns hexadecimal value for a Color | RLAPI int GetHexValue(Color color);                               // Returns hexadecimal value for a Color | ||||||
| @@ -663,15 +706,21 @@ RLAPI float *MatrixToFloat(Matrix mat);                           // Converts Ma | |||||||
| RLAPI int GetRandomValue(int min, int max);                       // Returns a random value between min and max (both included) | RLAPI int GetRandomValue(int min, int max);                       // Returns a random value between min and max (both included) | ||||||
| RLAPI Color Fade(Color color, float alpha);                       // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f | RLAPI Color Fade(Color color, float alpha);                       // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f | ||||||
|  |  | ||||||
| RLAPI void SetConfigFlags(char flags);                            // Setup some window configuration flags | RLAPI void ShowLogo(void);                                        // Activate raylib logo at startup (can be done with flags) | ||||||
| RLAPI void ShowLogo(void);                                        // Activates raylib logo at startup (can be done with flags) | RLAPI void SetConfigFlags(char flags);                            // Setup window configuration flags (view FLAGS) | ||||||
|  | RLAPI void TraceLog(int logType, const char *text, ...);          // Show trace log messages (INFO, WARNING, ERROR, DEBUG) | ||||||
|  | RLAPI void TakeScreenshot(const char *fileName);                  // Takes a screenshot of current screen (saved a .png) | ||||||
|  |  | ||||||
| RLAPI bool IsFileDropped(void);                                   // Check if a file have been dropped into window | RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension | ||||||
| RLAPI char **GetDroppedFiles(int *count);                         // Retrieve dropped files into window | RLAPI const char *GetDirectoryPath(const char *fileName);         // Get directory for a given fileName (with path) | ||||||
|  | RLAPI const char *GetWorkingDirectory(void);                      // Get current working directory | ||||||
|  | RLAPI bool ChangeDirectory(const char *dir);                      // Change working directory, returns true if success | ||||||
|  | RLAPI bool IsFileDropped(void);                                   // Check if a file has been dropped into window | ||||||
|  | RLAPI char **GetDroppedFiles(int *count);                         // Get dropped files names | ||||||
| RLAPI void ClearDroppedFiles(void);                               // Clear dropped files paths buffer | RLAPI void ClearDroppedFiles(void);                               // Clear dropped files paths buffer | ||||||
|  |  | ||||||
| RLAPI void StorageSaveValue(int position, int value);             // Storage save integer value (to defined position) | RLAPI void StorageSaveValue(int position, int value);             // Save integer value to storage file (to defined position) | ||||||
| RLAPI int StorageLoadValue(int position);                         // Storage load integer value (from defined position) | RLAPI int StorageLoadValue(int position);                         // Load integer value from storage file (from defined position) | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Input Handling Functions (Module: core) | // Input Handling Functions (Module: core) | ||||||
| @@ -741,12 +790,15 @@ RLAPI void DrawPixel(int posX, int posY, Color color); | |||||||
| RLAPI void DrawPixelV(Vector2 position, Color color);                                                    // Draw a pixel (Vector version) | RLAPI void DrawPixelV(Vector2 position, Color color);                                                    // Draw a pixel (Vector version) | ||||||
| RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);                // Draw a line | RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);                // Draw a line | ||||||
| RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);                                     // Draw a line (Vector version) | RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);                                     // Draw a line (Vector version) | ||||||
|  | RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color);                       // Draw a line defining thickness | ||||||
|  | RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color);                   // Draw a line using cubic-bezier curves in-out | ||||||
| RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color);                              // Draw a color-filled circle | RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color);                              // Draw a color-filled circle | ||||||
| RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);       // Draw a gradient-filled circle | RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);       // Draw a gradient-filled circle | ||||||
| RLAPI void DrawCircleV(Vector2 center, float radius, Color color);                                       // Draw a color-filled circle (Vector version) | RLAPI void DrawCircleV(Vector2 center, float radius, Color color);                                       // Draw a color-filled circle (Vector version) | ||||||
| RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color);                         // Draw circle outline | RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color);                         // Draw circle outline | ||||||
| RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color);                        // Draw a color-filled rectangle | RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color);                        // Draw a color-filled rectangle | ||||||
| RLAPI void DrawRectangleRec(Rectangle rec, Color color);                                                 // Draw a color-filled rectangle | RLAPI void DrawRectangleRec(Rectangle rec, Color color);                                                 // Draw a color-filled rectangle | ||||||
|  | RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color);                 // Draw a color-filled rectangle with pro parameters | ||||||
| RLAPI void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle | RLAPI void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle | ||||||
| RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color);                                  // Draw a color-filled rectangle (Vector version) | RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color);                                  // Draw a color-filled rectangle (Vector version) | ||||||
| RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color);                   // Draw rectangle outline | RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color);                   // Draw rectangle outline | ||||||
| @@ -767,21 +819,19 @@ RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Ve | |||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Texture Loading and Drawing Functions (Module: textures) | // Texture Loading and Drawing Functions (Module: textures) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI Image LoadImage(const char *fileName);                                                             // Load an image into CPU memory (RAM) | RLAPI Image LoadImage(const char *fileName);                                                             // Load image from file into CPU memory (RAM) | ||||||
| RLAPI Image LoadImageEx(Color *pixels, int width, int height);                                           // Load image data from Color array data (RGBA - 32bit) | RLAPI Image LoadImageEx(Color *pixels, int width, int height);                                           // Load image from Color array data (RGBA - 32bit) | ||||||
| RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize);       // Load image data from RAW file | RLAPI Image LoadImagePro(void *data, int width, int height, int format);                                 // Load image from raw data with parameters | ||||||
| RLAPI Image LoadImageFromRES(const char *rresName, int resId);                                           // Load an image from rRES file (raylib Resource) | RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize);       // Load image from RAW file data | ||||||
| RLAPI Texture2D LoadTexture(const char *fileName);                                                       // Load an image as texture into GPU memory | RLAPI Texture2D LoadTexture(const char *fileName);                                                       // Load texture from file into GPU memory (VRAM) | ||||||
| RLAPI Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat);                     // Load a texture from raw data into GPU memory | RLAPI Texture2D LoadTextureFromImage(Image image);                                                       // Load texture from image data | ||||||
| RLAPI Texture2D LoadTextureFromRES(const char *rresName, int resId);                                     // Load an image as texture from rRES file (raylib Resource) | RLAPI RenderTexture2D LoadRenderTexture(int width, int height);                                          // Load texture for rendering (framebuffer) | ||||||
| RLAPI Texture2D LoadTextureFromImage(Image image);                                                       // Load a texture from image data |  | ||||||
| RLAPI RenderTexture2D LoadRenderTexture(int width, int height);                                          // Load a texture to be used for rendering |  | ||||||
| RLAPI void UnloadImage(Image image);                                                                     // Unload image from CPU memory (RAM) | RLAPI void UnloadImage(Image image);                                                                     // Unload image from CPU memory (RAM) | ||||||
| RLAPI void UnloadTexture(Texture2D texture);                                                             // Unload texture from GPU memory | RLAPI void UnloadTexture(Texture2D texture);                                                             // Unload texture from GPU memory (VRAM) | ||||||
| RLAPI void UnloadRenderTexture(RenderTexture2D target);                                                  // Unload render texture from GPU memory | RLAPI void UnloadRenderTexture(RenderTexture2D target);                                                  // Unload render texture from GPU memory (VRAM) | ||||||
| RLAPI Color *GetImageData(Image image);                                                                  // Get pixel data from image as a Color struct array | RLAPI Color *GetImageData(Image image);                                                                  // Get pixel data from image as a Color struct array | ||||||
| RLAPI Image GetTextureData(Texture2D texture);                                                           // Get pixel data from GPU texture and return an Image | RLAPI Image GetTextureData(Texture2D texture);                                                           // Get pixel data from GPU texture and return an Image | ||||||
| RLAPI void UpdateTexture(Texture2D texture, void *pixels);                                               // Update GPU texture with new data | RLAPI void UpdateTexture(Texture2D texture, const void *pixels);                                         // Update GPU texture with new data | ||||||
| RLAPI void ImageToPOT(Image *image, Color fillColor);                                                    // Convert image to POT (power-of-two) | RLAPI void ImageToPOT(Image *image, Color fillColor);                                                    // Convert image to POT (power-of-two) | ||||||
| RLAPI void ImageFormat(Image *image, int newFormat);                                                     // Convert image data to desired format | RLAPI void ImageFormat(Image *image, int newFormat);                                                     // Convert image data to desired format | ||||||
| RLAPI void ImageAlphaMask(Image *image, Image alphaMask);                                                // Apply alpha mask to image | RLAPI void ImageAlphaMask(Image *image, Image alphaMask);                                                // Apply alpha mask to image | ||||||
| @@ -794,7 +844,8 @@ RLAPI Image ImageText(const char *text, int fontSize, Color color); | |||||||
| RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint);     // Create an image from text (custom sprite font) | RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint);     // Create an image from text (custom sprite font) | ||||||
| RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);                         // Draw a source image within a destination image | RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);                         // Draw a source image within a destination image | ||||||
| RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color);     // Draw text (default font) within an image (destination) | RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color);     // Draw text (default font) within an image (destination) | ||||||
| RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, float fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) | RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, | ||||||
|  |                            float fontSize, int spacing, Color color);                                    // Draw text (custom sprite font) within an image (destination) | ||||||
| RLAPI void ImageFlipVertical(Image *image);                                                              // Flip image vertically | RLAPI void ImageFlipVertical(Image *image);                                                              // Flip image vertically | ||||||
| RLAPI void ImageFlipHorizontal(Image *image);                                                            // Flip image horizontally | RLAPI void ImageFlipHorizontal(Image *image);                                                            // Flip image horizontally | ||||||
| RLAPI void ImageColorTint(Image *image, Color color);                                                    // Modify image color: tint | RLAPI void ImageColorTint(Image *image, Color color);                                                    // Modify image color: tint | ||||||
| @@ -817,9 +868,9 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle dest | |||||||
| // Font Loading and Text Drawing Functions (Module: text) | // Font Loading and Text Drawing Functions (Module: text) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont | RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont | ||||||
| RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load a SpriteFont image into GPU memory | RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load SpriteFont from file into GPU memory (VRAM) | ||||||
| RLAPI SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars);    // Load a SpriteFont from TTF font with parameters | RLAPI SpriteFont LoadSpriteFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars);   // Load SpriteFont from file with extended parameters | ||||||
| RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory | RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory (VRAM) | ||||||
|  |  | ||||||
| RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color);                    // Draw text (using default font) | RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color);                    // Draw text (using default font) | ||||||
| RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position,                         // Draw text using SpriteFont and additional parameters | RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position,                         // Draw text using SpriteFont and additional parameters | ||||||
| @@ -827,7 +878,7 @@ RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, | |||||||
| RLAPI int MeasureText(const char *text, int fontSize);                                                   // Measure string width for default font | RLAPI int MeasureText(const char *text, int fontSize);                                                   // Measure string width for default font | ||||||
| RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing);       // Measure string size for SpriteFont | RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing);       // Measure string size for SpriteFont | ||||||
|  |  | ||||||
| RLAPI void DrawFPS(int posX, int posY);                                                                  // Shows current FPS on top-left corner | RLAPI void DrawFPS(int posX, int posY);                                                                  // Shows current FPS | ||||||
| RLAPI const char *FormatText(const char *text, ...);                                                     // Formatting of text with variables to 'embed' | RLAPI const char *FormatText(const char *text, ...);                                                     // Formatting of text with variables to 'embed' | ||||||
| RLAPI const char *SubText(const char *text, int position, int length);                                   // Get a piece of a text string | RLAPI const char *SubText(const char *text, int position, int length);                                   // Get a piece of a text string | ||||||
|  |  | ||||||
| @@ -849,50 +900,57 @@ RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); | |||||||
| RLAPI void DrawRay(Ray ray, Color color);                                                                // Draw a ray line | RLAPI void DrawRay(Ray ray, Color color);                                                                // Draw a ray line | ||||||
| RLAPI void DrawGrid(int slices, float spacing);                                                          // Draw a grid (centered at (0, 0, 0)) | RLAPI void DrawGrid(int slices, float spacing);                                                          // Draw a grid (centered at (0, 0, 0)) | ||||||
| RLAPI void DrawGizmo(Vector3 position);                                                                  // Draw simple gizmo | RLAPI void DrawGizmo(Vector3 position);                                                                  // Draw simple gizmo | ||||||
| RLAPI void DrawLight(Light light);                                                                       // Draw light in 3D world |  | ||||||
| //DrawTorus(), DrawTeapot() could be useful? | //DrawTorus(), DrawTeapot() could be useful? | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Model 3d Loading and Drawing Functions (Module: models) | // Model 3d Loading and Drawing Functions (Module: models) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI Model LoadModel(const char *fileName);                          // Load a 3d model (.OBJ) | RLAPI Mesh LoadMesh(const char *fileName);                                                              // Load mesh from file | ||||||
| RLAPI Model LoadModelEx(Mesh data, bool dynamic);                     // Load a 3d model (from mesh data) | RLAPI Mesh LoadMeshEx(int numVertex, float *vData, float *vtData, float *vnData, Color *cData);         // Load mesh from vertex data | ||||||
| RLAPI Model LoadModelFromRES(const char *rresName, int resId);        // Load a 3d model from rRES file (raylib Resource) | RLAPI Model LoadModel(const char *fileName);                                                            // Load model from file | ||||||
| RLAPI Model LoadHeightmap(Image heightmap, Vector3 size);             // Load a heightmap image as a 3d model | RLAPI Model LoadModelFromMesh(Mesh data, bool dynamic);                                                 // Load model from mesh data | ||||||
| RLAPI Model LoadCubicmap(Image cubicmap);                             // Load a map image as a 3d model (cubes based) | RLAPI Model LoadHeightmap(Image heightmap, Vector3 size);                                               // Load heightmap model from image data | ||||||
| RLAPI void UnloadModel(Model model);                                  // Unload 3d model from memory | RLAPI Model LoadCubicmap(Image cubicmap);                                                               // Load cubes-based map model from image data | ||||||
|  | RLAPI void UnloadMesh(Mesh *mesh);                                                                      // Unload mesh from memory (RAM and/or VRAM) | ||||||
|  | RLAPI void UnloadModel(Model model);                                                                    // Unload model from memory (RAM and/or VRAM) | ||||||
|  |  | ||||||
| RLAPI Material LoadMaterial(const char *fileName);                    // Load material data (.MTL) | RLAPI Material LoadMaterial(const char *fileName);                                                      // Load material from file | ||||||
| RLAPI Material LoadDefaultMaterial(void);                             // Load default material (uses default models shader) | RLAPI Material LoadDefaultMaterial(void);                                                               // Load default material (uses default models shader) | ||||||
| RLAPI Material LoadStandardMaterial(void);                            // Load standard material (uses material attributes and lighting shader) | RLAPI void UnloadMaterial(Material material);                                                           // Unload material from GPU memory (VRAM) | ||||||
| RLAPI void UnloadMaterial(Material material);                         // Unload material textures from VRAM |  | ||||||
|  |  | ||||||
| RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint);                            // Draw a model (with texture if set) | RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint);                           // Draw a model (with texture if set) | ||||||
| RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);      // Draw a model with extended parameters | RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, | ||||||
|  |                        float rotationAngle, Vector3 scale, Color tint);                                 // Draw a model with extended parameters | ||||||
| RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint);                      // Draw a model wires (with texture if set) | RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint);                      // Draw a model wires (with texture if set) | ||||||
| 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 | RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, | ||||||
| RLAPI void DrawBoundingBox(BoundingBox box, Color color);                                                // Draw bounding box (wires) |                             float rotationAngle, Vector3 scale, Color tint);                            // Draw a model wires (with texture if set) with extended parameters | ||||||
|  | RLAPI void DrawBoundingBox(BoundingBox box, Color color);                                               // Draw bounding box (wires) | ||||||
|  |  | ||||||
| RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);                         // Draw a billboard texture | RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);     // Draw a billboard texture | ||||||
| RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec | RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, | ||||||
|  |                             Vector3 center, float size, Color tint);                                    // Draw a billboard texture defined by sourceRec | ||||||
|  |  | ||||||
| RLAPI BoundingBox CalculateBoundingBox(Mesh mesh);                                                                    // Calculate mesh bounding box limits | RLAPI BoundingBox CalculateBoundingBox(Mesh mesh);                                                      // Calculate mesh bounding box limits | ||||||
| RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);                     // Detect collision between two spheres | RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);       // Detect collision between two spheres | ||||||
| RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);                                                   // Detect collision between two bounding boxes | RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);                                     // Detect collision between two bounding boxes | ||||||
| RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere);                        // Detect collision between box and sphere | RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere);          // Detect collision between box and sphere | ||||||
| RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius);                              // Detect collision between ray and sphere | RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius);                // Detect collision between ray and sphere | ||||||
| RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint);   // Detect collision between ray and sphere with extended parameters and collision point detection | RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, | ||||||
| RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box);                                                            // Detect collision between ray and box |                                      Vector3 *collisionPoint);                                          // Detect collision between ray and sphere, returns collision point | ||||||
|  | RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box);                                              // Detect collision between ray and box | ||||||
|  | RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh);                                              // Get collision info between ray and mesh | ||||||
|  | RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3);                  // Get collision info between ray and triangle | ||||||
|  | RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight);                                    // Get collision info between ray and ground plane (Y-normal plane) | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Shaders System Functions (Module: rlgl) | // Shaders System Functions (Module: rlgl) | ||||||
| // NOTE: This functions are useless when using OpenGL 1.1 | // NOTE: This functions are useless when using OpenGL 1.1 | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI Shader LoadShader(char *vsFileName, char *fsFileName);              // Load a custom shader and bind default locations | RLAPI char *LoadText(const char *fileName);                               // Load chars array from text file | ||||||
| RLAPI void UnloadShader(Shader shader);                                   // Unload a custom shader from memory | RLAPI Shader LoadShader(char *vsFileName, char *fsFileName);              // Load shader from files and bind default locations | ||||||
|  | RLAPI void UnloadShader(Shader shader);                                   // Unload shader from GPU memory (VRAM) | ||||||
|  |  | ||||||
| RLAPI Shader GetDefaultShader(void);                                      // Get default shader | RLAPI Shader GetDefaultShader(void);                                      // Get default shader | ||||||
| RLAPI Shader GetStandardShader(void);                                     // Get standard shader |  | ||||||
| RLAPI Texture2D GetDefaultTexture(void);                                  // Get default texture | RLAPI Texture2D GetDefaultTexture(void);                                  // Get default texture | ||||||
|  |  | ||||||
| RLAPI int GetShaderLocation(Shader shader, const char *uniformName);              // Get shader uniform location | RLAPI int GetShaderLocation(Shader shader, const char *uniformName);              // Get shader uniform location | ||||||
| @@ -908,19 +966,17 @@ RLAPI void EndShaderMode(void);                                           // End | |||||||
| RLAPI void BeginBlendMode(int mode);                                      // Begin blending mode (alpha, additive, multiplied) | RLAPI void BeginBlendMode(int mode);                                      // Begin blending mode (alpha, additive, multiplied) | ||||||
| RLAPI void EndBlendMode(void);                                            // End blending mode (reset to default: alpha blending) | RLAPI void EndBlendMode(void);                                            // End blending mode (reset to default: alpha blending) | ||||||
|  |  | ||||||
| RLAPI Light CreateLight(int type, Vector3 position, Color diffuse);       // Create a new light, initialize it and add to pool |  | ||||||
| RLAPI void DestroyLight(Light light);                                     // Destroy a light and take it out of the list |  | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // VR experience Functions (Module: rlgl) | // VR experience Functions (Module: rlgl) | ||||||
| // NOTE: This functions are useless when using OpenGL 1.1 | // NOTE: This functions are useless when using OpenGL 1.1 | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI void InitVrDevice(int vdDevice);            // Init VR device | RLAPI void InitVrSimulator(int vrDevice);           // Init VR simulator for selected device | ||||||
| RLAPI void CloseVrDevice(void);                   // Close VR device | RLAPI void CloseVrSimulator(void);                  // Close VR simulator for current device | ||||||
| RLAPI bool IsVrDeviceReady(void);                 // Detect if VR device is ready | RLAPI bool IsVrSimulatorReady(void);                // Detect if VR device is ready | ||||||
| RLAPI bool IsVrSimulator(void);                   // Detect if VR simulator is running | RLAPI void UpdateVrTracking(Camera *camera);        // Update VR tracking (position and orientation) and camera | ||||||
| RLAPI void UpdateVrTracking(Camera *camera);      // Update VR tracking (position and orientation) and camera | RLAPI void ToggleVrMode(void);                      // Enable/Disable VR experience (device or simulator) | ||||||
| RLAPI void ToggleVrMode(void);                    // Enable/Disable VR experience (device or simulator) | RLAPI void BeginVrDrawing(void);                    // Begin VR simulator stereo rendering | ||||||
|  | RLAPI void EndVrDrawing(void);                      // End VR simulator stereo rendering | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Audio Loading and Playing Functions (Module: audio) | // Audio Loading and Playing Functions (Module: audio) | ||||||
| @@ -928,13 +984,13 @@ RLAPI void ToggleVrMode(void);                    // Enable/Disable VR experienc | |||||||
| RLAPI void InitAudioDevice(void);                                     // Initialize audio device and context | RLAPI void InitAudioDevice(void);                                     // Initialize audio device and context | ||||||
| RLAPI void CloseAudioDevice(void);                                    // Close the audio device and context | RLAPI void CloseAudioDevice(void);                                    // Close the audio device and context | ||||||
| RLAPI bool IsAudioDeviceReady(void);                                  // Check if audio device has been initialized successfully | RLAPI bool IsAudioDeviceReady(void);                                  // Check if audio device has been initialized successfully | ||||||
|  | RLAPI void SetMasterVolume(float volume);                             // Set master volume (listener) | ||||||
|  |  | ||||||
| RLAPI Wave LoadWave(const char *fileName);                            // Load wave data from file into RAM | RLAPI Wave LoadWave(const char *fileName);                            // Load wave data from file | ||||||
| RLAPI Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from float array data (32bit) | RLAPI Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data | ||||||
| RLAPI Sound LoadSound(const char *fileName);                          // Load sound to memory | RLAPI Sound LoadSound(const char *fileName);                          // Load sound from file | ||||||
| RLAPI Sound LoadSoundFromWave(Wave wave);                             // Load sound to memory from wave data | RLAPI Sound LoadSoundFromWave(Wave wave);                             // Load sound from wave data | ||||||
| RLAPI Sound LoadSoundFromRES(const char *rresName, int resId);        // Load sound to memory from rRES file (raylib Resource) | RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data | ||||||
| RLAPI void UpdateSound(Sound sound, void *data, int numSamples);      // Update sound buffer with new data |  | ||||||
| RLAPI void UnloadWave(Wave wave);                                     // Unload wave data | RLAPI void UnloadWave(Wave wave);                                     // Unload wave data | ||||||
| RLAPI void UnloadSound(Sound sound);                                  // Unload sound | RLAPI void UnloadSound(Sound sound);                                  // Unload sound | ||||||
| RLAPI void PlaySound(Sound sound);                                    // Play a sound | RLAPI void PlaySound(Sound sound);                                    // Play a sound | ||||||
| @@ -958,13 +1014,14 @@ RLAPI void ResumeMusicStream(Music music);                            // Resume | |||||||
| RLAPI bool IsMusicPlaying(Music music);                               // Check if music is playing | RLAPI bool IsMusicPlaying(Music music);                               // Check if music is playing | ||||||
| RLAPI void SetMusicVolume(Music music, float volume);                 // Set volume for music (1.0 is max level) | RLAPI void SetMusicVolume(Music music, float volume);                 // Set volume for music (1.0 is max level) | ||||||
| RLAPI void SetMusicPitch(Music music, float pitch);                   // Set pitch for a music (1.0 is base level) | RLAPI void SetMusicPitch(Music music, float pitch);                   // Set pitch for a music (1.0 is base level) | ||||||
|  | RLAPI void SetMusicLoopCount(Music music, float count);               // Set music loop count (loop repeats) | ||||||
| RLAPI float GetMusicTimeLength(Music music);                          // Get music time length (in seconds) | RLAPI float GetMusicTimeLength(Music music);                          // Get music time length (in seconds) | ||||||
| RLAPI float GetMusicTimePlayed(Music music);                          // Get current music time played (in seconds) | RLAPI float GetMusicTimePlayed(Music music);                          // Get current music time played (in seconds) | ||||||
|  |  | ||||||
| RLAPI AudioStream InitAudioStream(unsigned int sampleRate, | RLAPI AudioStream InitAudioStream(unsigned int sampleRate, | ||||||
|                                   unsigned int sampleSize, |                                   unsigned int sampleSize, | ||||||
|                                   unsigned int channels);             // Init audio stream (to stream raw audio pcm data) |                                   unsigned int channels);             // Init audio stream (to stream raw audio pcm data) | ||||||
| RLAPI void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data | RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data | ||||||
| RLAPI void CloseAudioStream(AudioStream stream);                      // Close audio stream and free memory | RLAPI void CloseAudioStream(AudioStream stream);                      // Close audio stream and free memory | ||||||
| RLAPI bool IsAudioBufferProcessed(AudioStream stream);                // Check if any audio stream buffers requires refill | RLAPI bool IsAudioBufferProcessed(AudioStream stream);                // Check if any audio stream buffers requires refill | ||||||
| RLAPI void PlayAudioStream(AudioStream stream);                       // Play audio stream | RLAPI void PlayAudioStream(AudioStream stream);                       // Play audio stream | ||||||
|   | |||||||
| @@ -1,51 +1,51 @@ | |||||||
| /********************************************************************************************** | /********************************************************************************************** | ||||||
| * | * | ||||||
| *   raylib 1.6.0 (www.raylib.com) | *   raylib v1.7.0  | ||||||
| * | * | ||||||
| *   A simple and easy-to-use library to learn videogames programming | *   A simple and easy-to-use library to learn videogames programming (www.raylib.com) | ||||||
| * | * | ||||||
| *   Features: | *   FEATURES: | ||||||
| *     Library written in plain C code (C99) | *       - Library written in plain C code (C99) | ||||||
| *     Uses PascalCase/camelCase notation | *       - Multiple platforms supported: Windows, Linux, Mac, Android, Raspberry Pi, HTML5. | ||||||
| *     Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) | *       - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) | ||||||
| *     Unique OpenGL abstraction layer (usable as standalone module): [rlgl] | *       - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] | ||||||
| *     Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) | *       - Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) | ||||||
| *     Multiple textures support, including compressed formats and mipmaps generation | *       - Multiple textures support, including compressed formats and mipmaps generation | ||||||
| *     Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps | *       - Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps | ||||||
| *     Materials (diffuse, normal, specular) and Lighting (point, directional, spot) support | *       - Powerful math module for Vector2, Vector3, Matrix and Quaternion operations: [raymath] | ||||||
| *     Powerful math module for Vector, Matrix and Quaternion operations: [raymath] | *       - Audio loading and playing with streaming support and mixing channels: [audio] | ||||||
| *     Audio loading and playing with streaming support and mixing channels [audio] | *       - VR stereo rendering support with configurable HMD device parameters | ||||||
| *     VR stereo rendering support with configurable HMD device parameters | *       - Minimal external dependencies (GLFW3, OpenGL, OpenAL) | ||||||
| *     Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi, HTML5 and Oculus Rift CV1 | *       - Complete bindings for Lua, Go and Pascal | ||||||
| *     Custom color palette for fancy visuals on raywhite background |  | ||||||
| *     Minimal external dependencies (GLFW3, OpenGL, OpenAL) |  | ||||||
| *     Complete binding for LUA [rlua] |  | ||||||
| * | * | ||||||
| *   External libs: | *   NOTES: | ||||||
| *     GLFW3 (www.glfw.org) for window/context management and input [core] | *       32bit Colors - Any defined Color is always RGBA (4 byte) | ||||||
| *     GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] | *       One custom font is loaded by default when InitWindow() [core] | ||||||
| *     stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] | *       If using OpenGL 3.3 or ES2, one default shader is loaded automatically (internally defined) [rlgl] | ||||||
| *     stb_image_write (Sean Barret) for image writting (PNG) [utils] | *       If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads | ||||||
| *     stb_truetype (Sean Barret) for ttf fonts loading [text] |  | ||||||
| *     stb_vorbis (Sean Barret) for ogg audio loading [audio] |  | ||||||
| *     jar_xm (Joshua Reisenauer) for XM audio module loading [audio] |  | ||||||
| *     jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] |  | ||||||
| *     dr_flac (David Reid) for FLAC audio file loading [audio] |  | ||||||
| *     OpenAL Soft for audio device/context management [audio] |  | ||||||
| *     tinfl for data decompression (DEFLATE algorithm) [utils] |  | ||||||
| * | * | ||||||
| *   Some design decisions: | *   DEPENDENCIES: | ||||||
| *     32bit Colors - All defined color are always RGBA (struct Color is 4 byte) | *       GLFW3 (www.glfw.org) for window/context management and input [core] | ||||||
| *     One custom default font could be loaded automatically when InitWindow() [core] | *       GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] | ||||||
| *     If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads | *       OpenAL Soft for audio device/context management [audio] | ||||||
| *     If using OpenGL 3.3 or ES2, two default shaders could be loaded automatically (internally defined) |  | ||||||
| * | * | ||||||
| *   -- LICENSE -- | *   OPTIONAL DEPENDENCIES: | ||||||
|  | *       stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] | ||||||
|  | *       stb_image_write (Sean Barret) for image writting (PNG) [utils] | ||||||
|  | *       stb_truetype (Sean Barret) for ttf fonts loading [text] | ||||||
|  | *       stb_vorbis (Sean Barret) for ogg audio loading [audio] | ||||||
|  | *       jar_xm (Joshua Reisenauer) for XM audio module loading [audio] | ||||||
|  | *       jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] | ||||||
|  | *       dr_flac (David Reid) for FLAC audio file loading [audio] | ||||||
|  | *       tinfl for data decompression (DEFLATE algorithm) [rres] | ||||||
|  | * | ||||||
|  | * | ||||||
|  | *   LICENSE: zlib/libpng | ||||||
| * | * | ||||||
| *   raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, | *   raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, | ||||||
| *   BSD-like license that allows static linking with closed source software: | *   BSD-like license that allows static linking with closed source software: | ||||||
| * | * | ||||||
| *   Copyright (c) 2013-2016 Ramon Santamaria (@raysan5) | *   Copyright (c) 2013-2017 Ramon Santamaria (@raysan5) | ||||||
| * | * | ||||||
| *   This software is provided "as-is", without any express or implied warranty. In no event | *   This software is provided "as-is", without any express or implied warranty. In no event | ||||||
| *   will the authors be held liable for any damages arising from the use of this software. | *   will the authors be held liable for any damages arising from the use of this software. | ||||||
| @@ -72,7 +72,6 @@ | |||||||
| //#define PLATFORM_ANDROID      // Android device | //#define PLATFORM_ANDROID      // Android device | ||||||
| //#define PLATFORM_RPI          // Raspberry Pi | //#define PLATFORM_RPI          // Raspberry Pi | ||||||
| //#define PLATFORM_WEB          // HTML5 (emscripten, asm.js) | //#define PLATFORM_WEB          // HTML5 (emscripten, asm.js) | ||||||
| //#define RLGL_OCULUS_SUPPORT   // Oculus Rift CV1 (complementary to PLATFORM_DESKTOP) |  | ||||||
|  |  | ||||||
| // Security check in case no PLATFORM_* defined | // Security check in case no PLATFORM_* defined | ||||||
| #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) | #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) | ||||||
| @@ -98,13 +97,13 @@ | |||||||
| #define RAD2DEG (180.0f/PI) | #define RAD2DEG (180.0f/PI) | ||||||
|  |  | ||||||
| // raylib Config Flags | // raylib Config Flags | ||||||
| #define FLAG_FULLSCREEN_MODE    1 | #define FLAG_SHOW_LOGO              1       // Set to show raylib logo at startup | ||||||
| #define FLAG_RESIZABLE_WINDOW   2 | #define FLAG_FULLSCREEN_MODE        2       // Set to run program in fullscreen | ||||||
| #define FLAG_SHOW_LOGO          4 | #define FLAG_WINDOW_RESIZABLE       4       // Set to allow resizable window | ||||||
| #define FLAG_SHOW_MOUSE_CURSOR  8 | #define FLAG_WINDOW_DECORATED       8       // Set to show window decoration (frame and buttons) | ||||||
| #define FLAG_CENTERED_MODE     16 | #define FLAG_WINDOW_TRANSPARENT    16       // Set to allow transparent window | ||||||
| #define FLAG_MSAA_4X_HINT      32 | #define FLAG_MSAA_4X_HINT          32       // Set to try enabling MSAA 4X | ||||||
| #define FLAG_VSYNC_HINT        64 | #define FLAG_VSYNC_HINT            64       // Set to try enabling V-Sync on GPU | ||||||
|  |  | ||||||
| // Keyboard Function Keys | // Keyboard Function Keys | ||||||
| #define KEY_SPACE            32 | #define KEY_SPACE            32 | ||||||
| @@ -293,17 +292,13 @@ | |||||||
| #define RAYWHITE   CLITERAL{ 245, 245, 245, 255 }   // My own White (raylib logo) | #define RAYWHITE   CLITERAL{ 245, 245, 245, 255 }   // My own White (raylib logo) | ||||||
|  |  | ||||||
| //---------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------- | ||||||
| // Types and Structures Definition | // Structures Definition | ||||||
| //---------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------- | ||||||
| #ifndef __cplusplus | #ifndef __cplusplus | ||||||
| // Boolean type | // Boolean type | ||||||
|     #ifndef __APPLE__ |     #if !defined(_STDBOOL_H) | ||||||
|         #if !defined(_STDBOOL_H) |         typedef enum { false, true } bool; | ||||||
|             typedef enum { false, true } bool; |         #define _STDBOOL_H | ||||||
|             #define _STDBOOL_H |  | ||||||
|         #endif |  | ||||||
|     #else |  | ||||||
|         #include <stdbool.h> |  | ||||||
|     #endif |     #endif | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| @@ -351,35 +346,41 @@ typedef struct Image { | |||||||
|     int width;              // Image base width |     int width;              // Image base width | ||||||
|     int height;             // Image base height |     int height;             // Image base height | ||||||
|     int mipmaps;            // Mipmap levels, 1 by default |     int mipmaps;            // Mipmap levels, 1 by default | ||||||
|     int format;             // Data format (TextureFormat) |     int format;             // Data format (TextureFormat type) | ||||||
| } Image; | } Image; | ||||||
|  |  | ||||||
| // Texture2D type, bpp always RGBA (32bit) | // Texture2D type | ||||||
| // NOTE: Data stored in GPU memory | // NOTE: Data stored in GPU memory | ||||||
| typedef struct Texture2D { | typedef struct Texture2D { | ||||||
|     unsigned int id;        // OpenGL texture id |     unsigned int id;        // OpenGL texture id | ||||||
|     int width;              // Texture base width |     int width;              // Texture base width | ||||||
|     int height;             // Texture base height |     int height;             // Texture base height | ||||||
|     int mipmaps;            // Mipmap levels, 1 by default |     int mipmaps;            // Mipmap levels, 1 by default | ||||||
|     int format;             // Data format (TextureFormat) |     int format;             // Data format (TextureFormat type) | ||||||
| } Texture2D; | } Texture2D; | ||||||
|  |  | ||||||
| // RenderTexture2D type, for texture rendering | // RenderTexture2D type, for texture rendering | ||||||
| typedef struct RenderTexture2D { | typedef struct RenderTexture2D { | ||||||
|     unsigned int id;        // Render texture (fbo) id |     unsigned int id;        // OpenGL Framebuffer Object (FBO) id | ||||||
|     Texture2D texture;      // Color buffer attachment texture |     Texture2D texture;      // Color buffer attachment texture | ||||||
|     Texture2D depth;        // Depth buffer attachment texture |     Texture2D depth;        // Depth buffer attachment texture | ||||||
| } RenderTexture2D; | } RenderTexture2D; | ||||||
|  |  | ||||||
|  | // SpriteFont character info | ||||||
|  | typedef struct CharInfo { | ||||||
|  |     int value;              // Character value (Unicode) | ||||||
|  |     Rectangle rec;          // Character rectangle in sprite font | ||||||
|  |     int offsetX;            // Character offset X when drawing | ||||||
|  |     int offsetY;            // Character offset Y when drawing | ||||||
|  |     int advanceX;           // Character advance position X | ||||||
|  | } CharInfo; | ||||||
|  |  | ||||||
| // SpriteFont type, includes texture and charSet array data | // SpriteFont type, includes texture and charSet array data | ||||||
| typedef struct SpriteFont { | typedef struct SpriteFont { | ||||||
|     Texture2D texture;      // Font texture |     Texture2D texture;      // Font texture | ||||||
|     int size;               // Base size (default chars height) |     int baseSize;           // Base size (default chars height) | ||||||
|     int numChars;           // Number of characters |     int charsCount;         // Number of characters | ||||||
|     int *charValues;        // Characters values array |     CharInfo *chars;        // Characters info data | ||||||
|     Rectangle *charRecs;    // Characters rectangles within the texture |  | ||||||
|     Vector2 *charOffsets;   // Characters offsets (on drawing) |  | ||||||
|     int *charAdvanceX;      // Characters x advance (on drawing) |  | ||||||
| } SpriteFont; | } SpriteFont; | ||||||
|  |  | ||||||
| // Camera type, defines a camera position/orientation in 3d space | // Camera type, defines a camera position/orientation in 3d space | ||||||
| @@ -466,31 +467,20 @@ typedef struct Model { | |||||||
|     Material material;      // Shader and textures data |     Material material;      // Shader and textures data | ||||||
| } Model; | } Model; | ||||||
|  |  | ||||||
| // Light type |  | ||||||
| typedef struct LightData { |  | ||||||
|     unsigned int id;        // Light unique id |  | ||||||
|     bool enabled;           // Light enabled |  | ||||||
|     int type;               // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT |  | ||||||
|  |  | ||||||
|     Vector3 position;       // Light position |  | ||||||
|     Vector3 target;         // Light direction: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) |  | ||||||
|     float radius;           // Light attenuation radius light intensity reduced with distance (world distance) |  | ||||||
|  |  | ||||||
|     Color diffuse;          // Light diffuse color |  | ||||||
|     float intensity;        // Light intensity level |  | ||||||
|  |  | ||||||
|     float coneAngle;        // Light cone max angle: LIGHT_SPOT |  | ||||||
| } LightData, *Light; |  | ||||||
|  |  | ||||||
| // Light types |  | ||||||
| typedef enum { LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT } LightType; |  | ||||||
|  |  | ||||||
| // Ray type (useful for raycast) | // Ray type (useful for raycast) | ||||||
| typedef struct Ray { | typedef struct Ray { | ||||||
|     Vector3 position;       // Ray position (origin) |     Vector3 position;       // Ray position (origin) | ||||||
|     Vector3 direction;      // Ray direction |     Vector3 direction;      // Ray direction | ||||||
| } Ray; | } Ray; | ||||||
|  |  | ||||||
|  | // Information returned from a raycast | ||||||
|  | typedef struct RayHitInfo { | ||||||
|  |     bool hit;               // Did the ray hit something? | ||||||
|  |     float distance;         // Distance to nearest hit | ||||||
|  |     Vector3 position;       // Position of nearest hit | ||||||
|  |     Vector3 normal;         // Surface normal of hit | ||||||
|  | } RayHitInfo; | ||||||
|  |  | ||||||
| // Wave type, defines audio wave data | // Wave type, defines audio wave data | ||||||
| typedef struct Wave { | typedef struct Wave { | ||||||
|     unsigned int sampleCount;   // Number of samples |     unsigned int sampleCount;   // Number of samples | ||||||
| @@ -523,6 +513,34 @@ typedef struct AudioStream { | |||||||
|     unsigned int buffers[2];    // OpenAL audio buffers (double buffering) |     unsigned int buffers[2];    // OpenAL audio buffers (double buffering) | ||||||
| } AudioStream; | } AudioStream; | ||||||
|  |  | ||||||
|  | // rRES data returned when reading a resource,  | ||||||
|  | // it contains all required data for user (24 byte) | ||||||
|  | typedef struct RRESData { | ||||||
|  |     unsigned int type;          // Resource type (4 byte) | ||||||
|  |  | ||||||
|  |     unsigned int param1;        // Resouce parameter 1 (4 byte) | ||||||
|  |     unsigned int param2;        // Resouce parameter 2 (4 byte) | ||||||
|  |     unsigned int param3;        // Resouce parameter 3 (4 byte) | ||||||
|  |     unsigned int param4;        // Resouce parameter 4 (4 byte) | ||||||
|  |  | ||||||
|  |     void *data;                 // Resource data pointer (4 byte) | ||||||
|  | } RRESData; | ||||||
|  |  | ||||||
|  | // RRES type (pointer to RRESData array) | ||||||
|  | typedef struct RRESData *RRES; | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------------------------------- | ||||||
|  | // Enumerators Definition | ||||||
|  | //---------------------------------------------------------------------------------- | ||||||
|  | // Trace log type | ||||||
|  | typedef enum {  | ||||||
|  |     INFO = 0, | ||||||
|  |     WARNING,  | ||||||
|  |     ERROR,  | ||||||
|  |     DEBUG,  | ||||||
|  |     OTHER  | ||||||
|  | } LogType; | ||||||
|  |  | ||||||
| // Texture formats | // Texture formats | ||||||
| // NOTE: Support depends on OpenGL version and platform | // NOTE: Support depends on OpenGL version and platform | ||||||
| typedef enum { | typedef enum { | ||||||
| @@ -533,6 +551,7 @@ typedef enum { | |||||||
|     UNCOMPRESSED_R5G5B5A1,          // 16 bpp (1 bit alpha) |     UNCOMPRESSED_R5G5B5A1,          // 16 bpp (1 bit alpha) | ||||||
|     UNCOMPRESSED_R4G4B4A4,          // 16 bpp (4 bit alpha) |     UNCOMPRESSED_R4G4B4A4,          // 16 bpp (4 bit alpha) | ||||||
|     UNCOMPRESSED_R8G8B8A8,          // 32 bpp |     UNCOMPRESSED_R8G8B8A8,          // 32 bpp | ||||||
|  |     UNCOMPRESSED_R32G32B32,         // 32 bit per channel (float) - HDR | ||||||
|     COMPRESSED_DXT1_RGB,            // 4 bpp (no alpha) |     COMPRESSED_DXT1_RGB,            // 4 bpp (no alpha) | ||||||
|     COMPRESSED_DXT1_RGBA,           // 4 bpp (1 bit alpha) |     COMPRESSED_DXT1_RGBA,           // 4 bpp (1 bit alpha) | ||||||
|     COMPRESSED_DXT3_RGBA,           // 8 bpp |     COMPRESSED_DXT3_RGBA,           // 8 bpp | ||||||
| @@ -549,7 +568,7 @@ typedef enum { | |||||||
| // Texture parameters: filter mode | // Texture parameters: filter mode | ||||||
| // NOTE 1: Filtering considers mipmaps if available in the texture | // NOTE 1: Filtering considers mipmaps if available in the texture | ||||||
| // NOTE 2: Filter is accordingly set for minification and magnification | // NOTE 2: Filter is accordingly set for minification and magnification | ||||||
| typedef enum {  | typedef enum { | ||||||
|     FILTER_POINT = 0,               // No filter, just pixel aproximation |     FILTER_POINT = 0,               // No filter, just pixel aproximation | ||||||
|     FILTER_BILINEAR,                // Linear filtering |     FILTER_BILINEAR,                // Linear filtering | ||||||
|     FILTER_TRILINEAR,               // Trilinear filtering (linear with mipmaps) |     FILTER_TRILINEAR,               // Trilinear filtering (linear with mipmaps) | ||||||
| @@ -559,10 +578,18 @@ typedef enum { | |||||||
| } TextureFilterMode; | } TextureFilterMode; | ||||||
|  |  | ||||||
| // Texture parameters: wrap mode | // Texture parameters: wrap mode | ||||||
| typedef enum { WRAP_REPEAT = 0, WRAP_CLAMP, WRAP_MIRROR } TextureWrapMode; | typedef enum {  | ||||||
|  |     WRAP_REPEAT = 0,  | ||||||
|  |     WRAP_CLAMP,  | ||||||
|  |     WRAP_MIRROR  | ||||||
|  | } TextureWrapMode; | ||||||
|  |  | ||||||
| // Color blending modes (pre-defined) | // Color blending modes (pre-defined) | ||||||
| typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode; | typedef enum {  | ||||||
|  |     BLEND_ALPHA = 0,  | ||||||
|  |     BLEND_ADDITIVE,  | ||||||
|  |     BLEND_MULTIPLIED | ||||||
|  | } BlendMode; | ||||||
|  |  | ||||||
| // Gestures type | // Gestures type | ||||||
| // NOTE: It could be used as flags to enable only some gestures | // NOTE: It could be used as flags to enable only some gestures | ||||||
| @@ -581,12 +608,12 @@ typedef enum { | |||||||
| } Gestures; | } Gestures; | ||||||
|  |  | ||||||
| // Camera system modes | // Camera system modes | ||||||
| typedef enum {  | typedef enum { | ||||||
|     CAMERA_CUSTOM = 0,  |     CAMERA_CUSTOM = 0, | ||||||
|     CAMERA_FREE,  |     CAMERA_FREE, | ||||||
|     CAMERA_ORBITAL,  |     CAMERA_ORBITAL, | ||||||
|     CAMERA_FIRST_PERSON,  |     CAMERA_FIRST_PERSON, | ||||||
|     CAMERA_THIRD_PERSON  |     CAMERA_THIRD_PERSON | ||||||
| } CameraMode; | } CameraMode; | ||||||
|  |  | ||||||
| // Head Mounted Display devices | // Head Mounted Display devices | ||||||
| @@ -602,6 +629,18 @@ typedef enum { | |||||||
|     HMD_FOVE_VR, |     HMD_FOVE_VR, | ||||||
| } VrDevice; | } VrDevice; | ||||||
|  |  | ||||||
|  | // RRESData type | ||||||
|  | typedef enum {  | ||||||
|  |     RRES_TYPE_RAW = 0,  | ||||||
|  |     RRES_TYPE_IMAGE,  | ||||||
|  |     RRES_TYPE_WAVE,  | ||||||
|  |     RRES_TYPE_VERTEX,  | ||||||
|  |     RRES_TYPE_TEXT, | ||||||
|  |     RRES_TYPE_FONT_IMAGE, | ||||||
|  |     RRES_TYPE_FONT_CHARDATA,    // CharInfo data array | ||||||
|  |     RRES_TYPE_DIRECTORY | ||||||
|  | } RRESDataType; | ||||||
|  |  | ||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| extern "C" {            // Prevents name mangling of functions | extern "C" {            // Prevents name mangling of functions | ||||||
| #endif | #endif | ||||||
| @@ -615,44 +654,48 @@ extern "C" {            // Prevents name mangling of functions | |||||||
| // Window and Graphics Device Functions (Module: core) | // Window and Graphics Device Functions (Module: core) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| #if defined(PLATFORM_ANDROID) | #if defined(PLATFORM_ANDROID) | ||||||
| RLAPI void InitWindow(int width, int height, void *state);        // Init Android Activity and OpenGL Graphics (struct android_app) | RLAPI void InitWindow(int width, int height, void *state);        // Initialize Android activity | ||||||
| #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) | #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) | ||||||
| RLAPI void InitWindow(int width, int height, const char *title);  // Initialize Window and OpenGL Graphics | RLAPI void InitWindow(int width, int height, const char *title);  // Initialize window and OpenGL context | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| RLAPI void CloseWindow(void);                                     // Close Window and Terminate Context | RLAPI void CloseWindow(void);                                     // Close window and unload OpenGL context | ||||||
| RLAPI bool WindowShouldClose(void);                               // Detect if KEY_ESCAPE pressed or Close icon pressed | RLAPI bool WindowShouldClose(void);                               // Check if KEY_ESCAPE pressed or Close icon pressed | ||||||
| RLAPI bool IsWindowMinimized(void);                               // Detect if window has been minimized (or lost focus) | RLAPI bool IsWindowMinimized(void);                               // Check if window has been minimized (or lost focus) | ||||||
| RLAPI void ToggleFullscreen(void);                                // Fullscreen toggle (only PLATFORM_DESKTOP) | RLAPI void ToggleFullscreen(void);                                // Toggle fullscreen mode (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowIcon(Image image);                            // Set icon for window (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowPosition(int x, int y);                       // Set window position on screen (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowMonitor(int monitor);                         // Set monitor for the current window (fullscreen mode) | ||||||
|  | RLAPI void SetWindowMinSize(int width, int height);               // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) | ||||||
| RLAPI int GetScreenWidth(void);                                   // Get current screen width | RLAPI int GetScreenWidth(void);                                   // Get current screen width | ||||||
| RLAPI int GetScreenHeight(void);                                  // Get current screen height | RLAPI int GetScreenHeight(void);                                  // Get current screen height | ||||||
|  |  | ||||||
| #if !defined(PLATFORM_ANDROID) | #if !defined(PLATFORM_ANDROID) | ||||||
| RLAPI void ShowCursor(void);                                      // Shows cursor | RLAPI void ShowCursor(void);                                      // Shows cursor | ||||||
| RLAPI void HideCursor(void);                                      // Hides cursor | RLAPI void HideCursor(void);                                      // Hides cursor | ||||||
| RLAPI bool IsCursorHidden(void);                                  // Returns true if cursor is not visible | RLAPI bool IsCursorHidden(void);                                  // Check if cursor is not visible | ||||||
| RLAPI void EnableCursor(void);                                    // Enables cursor | RLAPI void EnableCursor(void);                                    // Enables cursor (unlock cursor) | ||||||
| RLAPI void DisableCursor(void);                                   // Disables cursor | RLAPI void DisableCursor(void);                                   // Disables cursor (lock cursor) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| RLAPI void ClearBackground(Color color);                          // Sets Background Color | RLAPI void ClearBackground(Color color);                          // Set background color (framebuffer clear color) | ||||||
| RLAPI void BeginDrawing(void);                                    // Setup drawing canvas to start drawing | RLAPI void BeginDrawing(void);                                    // Setup canvas (framebuffer) to start drawing | ||||||
| RLAPI void EndDrawing(void);                                      // End canvas drawing and Swap Buffers (Double Buffering) | RLAPI void EndDrawing(void);                                      // End canvas drawing and swap buffers (double buffering) | ||||||
|  |  | ||||||
| RLAPI void Begin2dMode(Camera2D camera);                          // Initialize 2D mode with custom camera | RLAPI void Begin2dMode(Camera2D camera);                          // Initialize 2D mode with custom camera (2D) | ||||||
| RLAPI void End2dMode(void);                                       // Ends 2D mode custom camera usage | RLAPI void End2dMode(void);                                       // Ends 2D mode with custom camera | ||||||
| RLAPI void Begin3dMode(Camera camera);                            // Initializes 3D mode for drawing (Camera setup) | RLAPI void Begin3dMode(Camera camera);                            // Initializes 3D mode with custom camera (3D) | ||||||
| RLAPI void End3dMode(void);                                       // Ends 3D mode and returns to default 2D orthographic mode | RLAPI void End3dMode(void);                                       // Ends 3D mode and returns to default 2D orthographic mode | ||||||
| RLAPI void BeginTextureMode(RenderTexture2D target);              // Initializes render texture for drawing | RLAPI void BeginTextureMode(RenderTexture2D target);              // Initializes render texture for drawing | ||||||
| RLAPI void EndTextureMode(void);                                  // Ends drawing to render texture | RLAPI void EndTextureMode(void);                                  // Ends drawing to render texture | ||||||
|  |  | ||||||
| RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera);      // Returns a ray trace from mouse position | RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera);      // Returns a ray trace from mouse position | ||||||
| RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera);  // Returns the screen space position from a 3d world space position | RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera);  // Returns the screen space position for a 3d world space position | ||||||
| RLAPI Matrix GetCameraMatrix(Camera camera);                      // Returns camera transform matrix (view matrix) | RLAPI Matrix GetCameraMatrix(Camera camera);                      // Returns camera transform matrix (view matrix) | ||||||
|  |  | ||||||
| RLAPI void SetTargetFPS(int fps);                                 // Set target FPS (maximum) | RLAPI void SetTargetFPS(int fps);                                 // Set target FPS (maximum) | ||||||
| RLAPI float GetFPS(void);                                         // Returns current FPS | RLAPI int GetFPS(void);                                           // Returns current FPS | ||||||
| RLAPI float GetFrameTime(void);                                   // Returns time in seconds for one frame | RLAPI float GetFrameTime(void);                                   // Returns time in seconds for last frame drawn | ||||||
|  |  | ||||||
| RLAPI Color GetColor(int hexValue);                               // Returns a Color struct from hexadecimal value | RLAPI Color GetColor(int hexValue);                               // Returns a Color struct from hexadecimal value | ||||||
| RLAPI int GetHexValue(Color color);                               // Returns hexadecimal value for a Color | RLAPI int GetHexValue(Color color);                               // Returns hexadecimal value for a Color | ||||||
| @@ -663,15 +706,21 @@ RLAPI float *MatrixToFloat(Matrix mat);                           // Converts Ma | |||||||
| RLAPI int GetRandomValue(int min, int max);                       // Returns a random value between min and max (both included) | RLAPI int GetRandomValue(int min, int max);                       // Returns a random value between min and max (both included) | ||||||
| RLAPI Color Fade(Color color, float alpha);                       // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f | RLAPI Color Fade(Color color, float alpha);                       // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f | ||||||
|  |  | ||||||
| RLAPI void SetConfigFlags(char flags);                            // Setup some window configuration flags | RLAPI void ShowLogo(void);                                        // Activate raylib logo at startup (can be done with flags) | ||||||
| RLAPI void ShowLogo(void);                                        // Activates raylib logo at startup (can be done with flags) | RLAPI void SetConfigFlags(char flags);                            // Setup window configuration flags (view FLAGS) | ||||||
|  | RLAPI void TraceLog(int logType, const char *text, ...);          // Show trace log messages (INFO, WARNING, ERROR, DEBUG) | ||||||
|  | RLAPI void TakeScreenshot(const char *fileName);                  // Takes a screenshot of current screen (saved a .png) | ||||||
|  |  | ||||||
| RLAPI bool IsFileDropped(void);                                   // Check if a file have been dropped into window | RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension | ||||||
| RLAPI char **GetDroppedFiles(int *count);                         // Retrieve dropped files into window | RLAPI const char *GetDirectoryPath(const char *fileName);         // Get directory for a given fileName (with path) | ||||||
|  | RLAPI const char *GetWorkingDirectory(void);                      // Get current working directory | ||||||
|  | RLAPI bool ChangeDirectory(const char *dir);                      // Change working directory, returns true if success | ||||||
|  | RLAPI bool IsFileDropped(void);                                   // Check if a file has been dropped into window | ||||||
|  | RLAPI char **GetDroppedFiles(int *count);                         // Get dropped files names | ||||||
| RLAPI void ClearDroppedFiles(void);                               // Clear dropped files paths buffer | RLAPI void ClearDroppedFiles(void);                               // Clear dropped files paths buffer | ||||||
|  |  | ||||||
| RLAPI void StorageSaveValue(int position, int value);             // Storage save integer value (to defined position) | RLAPI void StorageSaveValue(int position, int value);             // Save integer value to storage file (to defined position) | ||||||
| RLAPI int StorageLoadValue(int position);                         // Storage load integer value (from defined position) | RLAPI int StorageLoadValue(int position);                         // Load integer value from storage file (from defined position) | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Input Handling Functions (Module: core) | // Input Handling Functions (Module: core) | ||||||
| @@ -741,12 +790,15 @@ RLAPI void DrawPixel(int posX, int posY, Color color); | |||||||
| RLAPI void DrawPixelV(Vector2 position, Color color);                                                    // Draw a pixel (Vector version) | RLAPI void DrawPixelV(Vector2 position, Color color);                                                    // Draw a pixel (Vector version) | ||||||
| RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);                // Draw a line | RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);                // Draw a line | ||||||
| RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);                                     // Draw a line (Vector version) | RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);                                     // Draw a line (Vector version) | ||||||
|  | RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color);                       // Draw a line defining thickness | ||||||
|  | RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color);                   // Draw a line using cubic-bezier curves in-out | ||||||
| RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color);                              // Draw a color-filled circle | RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color);                              // Draw a color-filled circle | ||||||
| RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);       // Draw a gradient-filled circle | RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);       // Draw a gradient-filled circle | ||||||
| RLAPI void DrawCircleV(Vector2 center, float radius, Color color);                                       // Draw a color-filled circle (Vector version) | RLAPI void DrawCircleV(Vector2 center, float radius, Color color);                                       // Draw a color-filled circle (Vector version) | ||||||
| RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color);                         // Draw circle outline | RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color);                         // Draw circle outline | ||||||
| RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color);                        // Draw a color-filled rectangle | RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color);                        // Draw a color-filled rectangle | ||||||
| RLAPI void DrawRectangleRec(Rectangle rec, Color color);                                                 // Draw a color-filled rectangle | RLAPI void DrawRectangleRec(Rectangle rec, Color color);                                                 // Draw a color-filled rectangle | ||||||
|  | RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color);                 // Draw a color-filled rectangle with pro parameters | ||||||
| RLAPI void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle | RLAPI void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle | ||||||
| RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color);                                  // Draw a color-filled rectangle (Vector version) | RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color);                                  // Draw a color-filled rectangle (Vector version) | ||||||
| RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color);                   // Draw rectangle outline | RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color);                   // Draw rectangle outline | ||||||
| @@ -767,21 +819,19 @@ RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Ve | |||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Texture Loading and Drawing Functions (Module: textures) | // Texture Loading and Drawing Functions (Module: textures) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI Image LoadImage(const char *fileName);                                                             // Load an image into CPU memory (RAM) | RLAPI Image LoadImage(const char *fileName);                                                             // Load image from file into CPU memory (RAM) | ||||||
| RLAPI Image LoadImageEx(Color *pixels, int width, int height);                                           // Load image data from Color array data (RGBA - 32bit) | RLAPI Image LoadImageEx(Color *pixels, int width, int height);                                           // Load image from Color array data (RGBA - 32bit) | ||||||
| RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize);       // Load image data from RAW file | RLAPI Image LoadImagePro(void *data, int width, int height, int format);                                 // Load image from raw data with parameters | ||||||
| RLAPI Image LoadImageFromRES(const char *rresName, int resId);                                           // Load an image from rRES file (raylib Resource) | RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize);       // Load image from RAW file data | ||||||
| RLAPI Texture2D LoadTexture(const char *fileName);                                                       // Load an image as texture into GPU memory | RLAPI Texture2D LoadTexture(const char *fileName);                                                       // Load texture from file into GPU memory (VRAM) | ||||||
| RLAPI Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat);                     // Load a texture from raw data into GPU memory | RLAPI Texture2D LoadTextureFromImage(Image image);                                                       // Load texture from image data | ||||||
| RLAPI Texture2D LoadTextureFromRES(const char *rresName, int resId);                                     // Load an image as texture from rRES file (raylib Resource) | RLAPI RenderTexture2D LoadRenderTexture(int width, int height);                                          // Load texture for rendering (framebuffer) | ||||||
| RLAPI Texture2D LoadTextureFromImage(Image image);                                                       // Load a texture from image data |  | ||||||
| RLAPI RenderTexture2D LoadRenderTexture(int width, int height);                                          // Load a texture to be used for rendering |  | ||||||
| RLAPI void UnloadImage(Image image);                                                                     // Unload image from CPU memory (RAM) | RLAPI void UnloadImage(Image image);                                                                     // Unload image from CPU memory (RAM) | ||||||
| RLAPI void UnloadTexture(Texture2D texture);                                                             // Unload texture from GPU memory | RLAPI void UnloadTexture(Texture2D texture);                                                             // Unload texture from GPU memory (VRAM) | ||||||
| RLAPI void UnloadRenderTexture(RenderTexture2D target);                                                  // Unload render texture from GPU memory | RLAPI void UnloadRenderTexture(RenderTexture2D target);                                                  // Unload render texture from GPU memory (VRAM) | ||||||
| RLAPI Color *GetImageData(Image image);                                                                  // Get pixel data from image as a Color struct array | RLAPI Color *GetImageData(Image image);                                                                  // Get pixel data from image as a Color struct array | ||||||
| RLAPI Image GetTextureData(Texture2D texture);                                                           // Get pixel data from GPU texture and return an Image | RLAPI Image GetTextureData(Texture2D texture);                                                           // Get pixel data from GPU texture and return an Image | ||||||
| RLAPI void UpdateTexture(Texture2D texture, void *pixels);                                               // Update GPU texture with new data | RLAPI void UpdateTexture(Texture2D texture, const void *pixels);                                         // Update GPU texture with new data | ||||||
| RLAPI void ImageToPOT(Image *image, Color fillColor);                                                    // Convert image to POT (power-of-two) | RLAPI void ImageToPOT(Image *image, Color fillColor);                                                    // Convert image to POT (power-of-two) | ||||||
| RLAPI void ImageFormat(Image *image, int newFormat);                                                     // Convert image data to desired format | RLAPI void ImageFormat(Image *image, int newFormat);                                                     // Convert image data to desired format | ||||||
| RLAPI void ImageAlphaMask(Image *image, Image alphaMask);                                                // Apply alpha mask to image | RLAPI void ImageAlphaMask(Image *image, Image alphaMask);                                                // Apply alpha mask to image | ||||||
| @@ -794,7 +844,8 @@ RLAPI Image ImageText(const char *text, int fontSize, Color color); | |||||||
| RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint);     // Create an image from text (custom sprite font) | RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint);     // Create an image from text (custom sprite font) | ||||||
| RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);                         // Draw a source image within a destination image | RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);                         // Draw a source image within a destination image | ||||||
| RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color);     // Draw text (default font) within an image (destination) | RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color);     // Draw text (default font) within an image (destination) | ||||||
| RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, float fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) | RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, | ||||||
|  |                            float fontSize, int spacing, Color color);                                    // Draw text (custom sprite font) within an image (destination) | ||||||
| RLAPI void ImageFlipVertical(Image *image);                                                              // Flip image vertically | RLAPI void ImageFlipVertical(Image *image);                                                              // Flip image vertically | ||||||
| RLAPI void ImageFlipHorizontal(Image *image);                                                            // Flip image horizontally | RLAPI void ImageFlipHorizontal(Image *image);                                                            // Flip image horizontally | ||||||
| RLAPI void ImageColorTint(Image *image, Color color);                                                    // Modify image color: tint | RLAPI void ImageColorTint(Image *image, Color color);                                                    // Modify image color: tint | ||||||
| @@ -817,9 +868,9 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle dest | |||||||
| // Font Loading and Text Drawing Functions (Module: text) | // Font Loading and Text Drawing Functions (Module: text) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont | RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont | ||||||
| RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load a SpriteFont image into GPU memory | RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load SpriteFont from file into GPU memory (VRAM) | ||||||
| RLAPI SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars);    // Load a SpriteFont from TTF font with parameters | RLAPI SpriteFont LoadSpriteFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars);   // Load SpriteFont from file with extended parameters | ||||||
| RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory | RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory (VRAM) | ||||||
|  |  | ||||||
| RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color);                    // Draw text (using default font) | RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color);                    // Draw text (using default font) | ||||||
| RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position,                         // Draw text using SpriteFont and additional parameters | RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position,                         // Draw text using SpriteFont and additional parameters | ||||||
| @@ -827,7 +878,7 @@ RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, | |||||||
| RLAPI int MeasureText(const char *text, int fontSize);                                                   // Measure string width for default font | RLAPI int MeasureText(const char *text, int fontSize);                                                   // Measure string width for default font | ||||||
| RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing);       // Measure string size for SpriteFont | RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing);       // Measure string size for SpriteFont | ||||||
|  |  | ||||||
| RLAPI void DrawFPS(int posX, int posY);                                                                  // Shows current FPS on top-left corner | RLAPI void DrawFPS(int posX, int posY);                                                                  // Shows current FPS | ||||||
| RLAPI const char *FormatText(const char *text, ...);                                                     // Formatting of text with variables to 'embed' | RLAPI const char *FormatText(const char *text, ...);                                                     // Formatting of text with variables to 'embed' | ||||||
| RLAPI const char *SubText(const char *text, int position, int length);                                   // Get a piece of a text string | RLAPI const char *SubText(const char *text, int position, int length);                                   // Get a piece of a text string | ||||||
|  |  | ||||||
| @@ -849,50 +900,57 @@ RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); | |||||||
| RLAPI void DrawRay(Ray ray, Color color);                                                                // Draw a ray line | RLAPI void DrawRay(Ray ray, Color color);                                                                // Draw a ray line | ||||||
| RLAPI void DrawGrid(int slices, float spacing);                                                          // Draw a grid (centered at (0, 0, 0)) | RLAPI void DrawGrid(int slices, float spacing);                                                          // Draw a grid (centered at (0, 0, 0)) | ||||||
| RLAPI void DrawGizmo(Vector3 position);                                                                  // Draw simple gizmo | RLAPI void DrawGizmo(Vector3 position);                                                                  // Draw simple gizmo | ||||||
| RLAPI void DrawLight(Light light);                                                                       // Draw light in 3D world |  | ||||||
| //DrawTorus(), DrawTeapot() could be useful? | //DrawTorus(), DrawTeapot() could be useful? | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Model 3d Loading and Drawing Functions (Module: models) | // Model 3d Loading and Drawing Functions (Module: models) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI Model LoadModel(const char *fileName);                          // Load a 3d model (.OBJ) | RLAPI Mesh LoadMesh(const char *fileName);                                                              // Load mesh from file | ||||||
| RLAPI Model LoadModelEx(Mesh data, bool dynamic);                     // Load a 3d model (from mesh data) | RLAPI Mesh LoadMeshEx(int numVertex, float *vData, float *vtData, float *vnData, Color *cData);         // Load mesh from vertex data | ||||||
| RLAPI Model LoadModelFromRES(const char *rresName, int resId);        // Load a 3d model from rRES file (raylib Resource) | RLAPI Model LoadModel(const char *fileName);                                                            // Load model from file | ||||||
| RLAPI Model LoadHeightmap(Image heightmap, Vector3 size);             // Load a heightmap image as a 3d model | RLAPI Model LoadModelFromMesh(Mesh data, bool dynamic);                                                 // Load model from mesh data | ||||||
| RLAPI Model LoadCubicmap(Image cubicmap);                             // Load a map image as a 3d model (cubes based) | RLAPI Model LoadHeightmap(Image heightmap, Vector3 size);                                               // Load heightmap model from image data | ||||||
| RLAPI void UnloadModel(Model model);                                  // Unload 3d model from memory | RLAPI Model LoadCubicmap(Image cubicmap);                                                               // Load cubes-based map model from image data | ||||||
|  | RLAPI void UnloadMesh(Mesh *mesh);                                                                      // Unload mesh from memory (RAM and/or VRAM) | ||||||
|  | RLAPI void UnloadModel(Model model);                                                                    // Unload model from memory (RAM and/or VRAM) | ||||||
|  |  | ||||||
| RLAPI Material LoadMaterial(const char *fileName);                    // Load material data (.MTL) | RLAPI Material LoadMaterial(const char *fileName);                                                      // Load material from file | ||||||
| RLAPI Material LoadDefaultMaterial(void);                             // Load default material (uses default models shader) | RLAPI Material LoadDefaultMaterial(void);                                                               // Load default material (uses default models shader) | ||||||
| RLAPI Material LoadStandardMaterial(void);                            // Load standard material (uses material attributes and lighting shader) | RLAPI void UnloadMaterial(Material material);                                                           // Unload material from GPU memory (VRAM) | ||||||
| RLAPI void UnloadMaterial(Material material);                         // Unload material textures from VRAM |  | ||||||
|  |  | ||||||
| RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint);                            // Draw a model (with texture if set) | RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint);                           // Draw a model (with texture if set) | ||||||
| RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);      // Draw a model with extended parameters | RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, | ||||||
|  |                        float rotationAngle, Vector3 scale, Color tint);                                 // Draw a model with extended parameters | ||||||
| RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint);                      // Draw a model wires (with texture if set) | RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint);                      // Draw a model wires (with texture if set) | ||||||
| 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 | RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, | ||||||
| RLAPI void DrawBoundingBox(BoundingBox box, Color color);                                                // Draw bounding box (wires) |                             float rotationAngle, Vector3 scale, Color tint);                            // Draw a model wires (with texture if set) with extended parameters | ||||||
|  | RLAPI void DrawBoundingBox(BoundingBox box, Color color);                                               // Draw bounding box (wires) | ||||||
|  |  | ||||||
| RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);                         // Draw a billboard texture | RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);     // Draw a billboard texture | ||||||
| RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec | RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, | ||||||
|  |                             Vector3 center, float size, Color tint);                                    // Draw a billboard texture defined by sourceRec | ||||||
|  |  | ||||||
| RLAPI BoundingBox CalculateBoundingBox(Mesh mesh);                                                                    // Calculate mesh bounding box limits | RLAPI BoundingBox CalculateBoundingBox(Mesh mesh);                                                      // Calculate mesh bounding box limits | ||||||
| RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);                     // Detect collision between two spheres | RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);       // Detect collision between two spheres | ||||||
| RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);                                                   // Detect collision between two bounding boxes | RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);                                     // Detect collision between two bounding boxes | ||||||
| RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere);                        // Detect collision between box and sphere | RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere);          // Detect collision between box and sphere | ||||||
| RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius);                              // Detect collision between ray and sphere | RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius);                // Detect collision between ray and sphere | ||||||
| RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint);   // Detect collision between ray and sphere with extended parameters and collision point detection | RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, | ||||||
| RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box);                                                            // Detect collision between ray and box |                                      Vector3 *collisionPoint);                                          // Detect collision between ray and sphere, returns collision point | ||||||
|  | RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box);                                              // Detect collision between ray and box | ||||||
|  | RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh);                                              // Get collision info between ray and mesh | ||||||
|  | RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3);                  // Get collision info between ray and triangle | ||||||
|  | RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight);                                    // Get collision info between ray and ground plane (Y-normal plane) | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Shaders System Functions (Module: rlgl) | // Shaders System Functions (Module: rlgl) | ||||||
| // NOTE: This functions are useless when using OpenGL 1.1 | // NOTE: This functions are useless when using OpenGL 1.1 | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI Shader LoadShader(char *vsFileName, char *fsFileName);              // Load a custom shader and bind default locations | RLAPI char *LoadText(const char *fileName);                               // Load chars array from text file | ||||||
| RLAPI void UnloadShader(Shader shader);                                   // Unload a custom shader from memory | RLAPI Shader LoadShader(char *vsFileName, char *fsFileName);              // Load shader from files and bind default locations | ||||||
|  | RLAPI void UnloadShader(Shader shader);                                   // Unload shader from GPU memory (VRAM) | ||||||
|  |  | ||||||
| RLAPI Shader GetDefaultShader(void);                                      // Get default shader | RLAPI Shader GetDefaultShader(void);                                      // Get default shader | ||||||
| RLAPI Shader GetStandardShader(void);                                     // Get standard shader |  | ||||||
| RLAPI Texture2D GetDefaultTexture(void);                                  // Get default texture | RLAPI Texture2D GetDefaultTexture(void);                                  // Get default texture | ||||||
|  |  | ||||||
| RLAPI int GetShaderLocation(Shader shader, const char *uniformName);              // Get shader uniform location | RLAPI int GetShaderLocation(Shader shader, const char *uniformName);              // Get shader uniform location | ||||||
| @@ -908,19 +966,17 @@ RLAPI void EndShaderMode(void);                                           // End | |||||||
| RLAPI void BeginBlendMode(int mode);                                      // Begin blending mode (alpha, additive, multiplied) | RLAPI void BeginBlendMode(int mode);                                      // Begin blending mode (alpha, additive, multiplied) | ||||||
| RLAPI void EndBlendMode(void);                                            // End blending mode (reset to default: alpha blending) | RLAPI void EndBlendMode(void);                                            // End blending mode (reset to default: alpha blending) | ||||||
|  |  | ||||||
| RLAPI Light CreateLight(int type, Vector3 position, Color diffuse);       // Create a new light, initialize it and add to pool |  | ||||||
| RLAPI void DestroyLight(Light light);                                     // Destroy a light and take it out of the list |  | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // VR experience Functions (Module: rlgl) | // VR experience Functions (Module: rlgl) | ||||||
| // NOTE: This functions are useless when using OpenGL 1.1 | // NOTE: This functions are useless when using OpenGL 1.1 | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI void InitVrDevice(int vdDevice);            // Init VR device | RLAPI void InitVrSimulator(int vrDevice);           // Init VR simulator for selected device | ||||||
| RLAPI void CloseVrDevice(void);                   // Close VR device | RLAPI void CloseVrSimulator(void);                  // Close VR simulator for current device | ||||||
| RLAPI bool IsVrDeviceReady(void);                 // Detect if VR device is ready | RLAPI bool IsVrSimulatorReady(void);                // Detect if VR device is ready | ||||||
| RLAPI bool IsVrSimulator(void);                   // Detect if VR simulator is running | RLAPI void UpdateVrTracking(Camera *camera);        // Update VR tracking (position and orientation) and camera | ||||||
| RLAPI void UpdateVrTracking(Camera *camera);      // Update VR tracking (position and orientation) and camera | RLAPI void ToggleVrMode(void);                      // Enable/Disable VR experience (device or simulator) | ||||||
| RLAPI void ToggleVrMode(void);                    // Enable/Disable VR experience (device or simulator) | RLAPI void BeginVrDrawing(void);                    // Begin VR simulator stereo rendering | ||||||
|  | RLAPI void EndVrDrawing(void);                      // End VR simulator stereo rendering | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Audio Loading and Playing Functions (Module: audio) | // Audio Loading and Playing Functions (Module: audio) | ||||||
| @@ -928,13 +984,13 @@ RLAPI void ToggleVrMode(void);                    // Enable/Disable VR experienc | |||||||
| RLAPI void InitAudioDevice(void);                                     // Initialize audio device and context | RLAPI void InitAudioDevice(void);                                     // Initialize audio device and context | ||||||
| RLAPI void CloseAudioDevice(void);                                    // Close the audio device and context | RLAPI void CloseAudioDevice(void);                                    // Close the audio device and context | ||||||
| RLAPI bool IsAudioDeviceReady(void);                                  // Check if audio device has been initialized successfully | RLAPI bool IsAudioDeviceReady(void);                                  // Check if audio device has been initialized successfully | ||||||
|  | RLAPI void SetMasterVolume(float volume);                             // Set master volume (listener) | ||||||
|  |  | ||||||
| RLAPI Wave LoadWave(const char *fileName);                            // Load wave data from file into RAM | RLAPI Wave LoadWave(const char *fileName);                            // Load wave data from file | ||||||
| RLAPI Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from float array data (32bit) | RLAPI Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data | ||||||
| RLAPI Sound LoadSound(const char *fileName);                          // Load sound to memory | RLAPI Sound LoadSound(const char *fileName);                          // Load sound from file | ||||||
| RLAPI Sound LoadSoundFromWave(Wave wave);                             // Load sound to memory from wave data | RLAPI Sound LoadSoundFromWave(Wave wave);                             // Load sound from wave data | ||||||
| RLAPI Sound LoadSoundFromRES(const char *rresName, int resId);        // Load sound to memory from rRES file (raylib Resource) | RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data | ||||||
| RLAPI void UpdateSound(Sound sound, void *data, int numSamples);      // Update sound buffer with new data |  | ||||||
| RLAPI void UnloadWave(Wave wave);                                     // Unload wave data | RLAPI void UnloadWave(Wave wave);                                     // Unload wave data | ||||||
| RLAPI void UnloadSound(Sound sound);                                  // Unload sound | RLAPI void UnloadSound(Sound sound);                                  // Unload sound | ||||||
| RLAPI void PlaySound(Sound sound);                                    // Play a sound | RLAPI void PlaySound(Sound sound);                                    // Play a sound | ||||||
| @@ -958,13 +1014,14 @@ RLAPI void ResumeMusicStream(Music music);                            // Resume | |||||||
| RLAPI bool IsMusicPlaying(Music music);                               // Check if music is playing | RLAPI bool IsMusicPlaying(Music music);                               // Check if music is playing | ||||||
| RLAPI void SetMusicVolume(Music music, float volume);                 // Set volume for music (1.0 is max level) | RLAPI void SetMusicVolume(Music music, float volume);                 // Set volume for music (1.0 is max level) | ||||||
| RLAPI void SetMusicPitch(Music music, float pitch);                   // Set pitch for a music (1.0 is base level) | RLAPI void SetMusicPitch(Music music, float pitch);                   // Set pitch for a music (1.0 is base level) | ||||||
|  | RLAPI void SetMusicLoopCount(Music music, float count);               // Set music loop count (loop repeats) | ||||||
| RLAPI float GetMusicTimeLength(Music music);                          // Get music time length (in seconds) | RLAPI float GetMusicTimeLength(Music music);                          // Get music time length (in seconds) | ||||||
| RLAPI float GetMusicTimePlayed(Music music);                          // Get current music time played (in seconds) | RLAPI float GetMusicTimePlayed(Music music);                          // Get current music time played (in seconds) | ||||||
|  |  | ||||||
| RLAPI AudioStream InitAudioStream(unsigned int sampleRate, | RLAPI AudioStream InitAudioStream(unsigned int sampleRate, | ||||||
|                                   unsigned int sampleSize, |                                   unsigned int sampleSize, | ||||||
|                                   unsigned int channels);             // Init audio stream (to stream raw audio pcm data) |                                   unsigned int channels);             // Init audio stream (to stream raw audio pcm data) | ||||||
| RLAPI void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data | RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data | ||||||
| RLAPI void CloseAudioStream(AudioStream stream);                      // Close audio stream and free memory | RLAPI void CloseAudioStream(AudioStream stream);                      // Close audio stream and free memory | ||||||
| RLAPI bool IsAudioBufferProcessed(AudioStream stream);                // Check if any audio stream buffers requires refill | RLAPI bool IsAudioBufferProcessed(AudioStream stream);                // Check if any audio stream buffers requires refill | ||||||
| RLAPI void PlayAudioStream(AudioStream stream);                       // Play audio stream | RLAPI void PlayAudioStream(AudioStream stream);                       // Play audio stream | ||||||
|   | |||||||
| @@ -1,51 +1,51 @@ | |||||||
| /********************************************************************************************** | /********************************************************************************************** | ||||||
| * | * | ||||||
| *   raylib 1.6.0 (www.raylib.com) | *   raylib v1.7.0  | ||||||
| * | * | ||||||
| *   A simple and easy-to-use library to learn videogames programming | *   A simple and easy-to-use library to learn videogames programming (www.raylib.com) | ||||||
| * | * | ||||||
| *   Features: | *   FEATURES: | ||||||
| *     Library written in plain C code (C99) | *       - Library written in plain C code (C99) | ||||||
| *     Uses PascalCase/camelCase notation | *       - Multiple platforms supported: Windows, Linux, Mac, Android, Raspberry Pi, HTML5. | ||||||
| *     Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) | *       - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) | ||||||
| *     Unique OpenGL abstraction layer (usable as standalone module): [rlgl] | *       - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] | ||||||
| *     Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) | *       - Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) | ||||||
| *     Multiple textures support, including compressed formats and mipmaps generation | *       - Multiple textures support, including compressed formats and mipmaps generation | ||||||
| *     Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps | *       - Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps | ||||||
| *     Materials (diffuse, normal, specular) and Lighting (point, directional, spot) support | *       - Powerful math module for Vector2, Vector3, Matrix and Quaternion operations: [raymath] | ||||||
| *     Powerful math module for Vector, Matrix and Quaternion operations: [raymath] | *       - Audio loading and playing with streaming support and mixing channels: [audio] | ||||||
| *     Audio loading and playing with streaming support and mixing channels [audio] | *       - VR stereo rendering support with configurable HMD device parameters | ||||||
| *     VR stereo rendering support with configurable HMD device parameters | *       - Minimal external dependencies (GLFW3, OpenGL, OpenAL) | ||||||
| *     Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi, HTML5 and Oculus Rift CV1 | *       - Complete bindings for Lua, Go and Pascal | ||||||
| *     Custom color palette for fancy visuals on raywhite background |  | ||||||
| *     Minimal external dependencies (GLFW3, OpenGL, OpenAL) |  | ||||||
| *     Complete binding for LUA [rlua] |  | ||||||
| * | * | ||||||
| *   External libs: | *   NOTES: | ||||||
| *     GLFW3 (www.glfw.org) for window/context management and input [core] | *       32bit Colors - Any defined Color is always RGBA (4 byte) | ||||||
| *     GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] | *       One custom font is loaded by default when InitWindow() [core] | ||||||
| *     stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] | *       If using OpenGL 3.3 or ES2, one default shader is loaded automatically (internally defined) [rlgl] | ||||||
| *     stb_image_write (Sean Barret) for image writting (PNG) [utils] | *       If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads | ||||||
| *     stb_truetype (Sean Barret) for ttf fonts loading [text] |  | ||||||
| *     stb_vorbis (Sean Barret) for ogg audio loading [audio] |  | ||||||
| *     jar_xm (Joshua Reisenauer) for XM audio module loading [audio] |  | ||||||
| *     jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] |  | ||||||
| *     dr_flac (David Reid) for FLAC audio file loading [audio] |  | ||||||
| *     OpenAL Soft for audio device/context management [audio] |  | ||||||
| *     tinfl for data decompression (DEFLATE algorithm) [utils] |  | ||||||
| * | * | ||||||
| *   Some design decisions: | *   DEPENDENCIES: | ||||||
| *     32bit Colors - All defined color are always RGBA (struct Color is 4 byte) | *       GLFW3 (www.glfw.org) for window/context management and input [core] | ||||||
| *     One custom default font could be loaded automatically when InitWindow() [core] | *       GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] | ||||||
| *     If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads | *       OpenAL Soft for audio device/context management [audio] | ||||||
| *     If using OpenGL 3.3 or ES2, two default shaders could be loaded automatically (internally defined) |  | ||||||
| * | * | ||||||
| *   -- LICENSE -- | *   OPTIONAL DEPENDENCIES: | ||||||
|  | *       stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] | ||||||
|  | *       stb_image_write (Sean Barret) for image writting (PNG) [utils] | ||||||
|  | *       stb_truetype (Sean Barret) for ttf fonts loading [text] | ||||||
|  | *       stb_vorbis (Sean Barret) for ogg audio loading [audio] | ||||||
|  | *       jar_xm (Joshua Reisenauer) for XM audio module loading [audio] | ||||||
|  | *       jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] | ||||||
|  | *       dr_flac (David Reid) for FLAC audio file loading [audio] | ||||||
|  | *       tinfl for data decompression (DEFLATE algorithm) [rres] | ||||||
|  | * | ||||||
|  | * | ||||||
|  | *   LICENSE: zlib/libpng | ||||||
| * | * | ||||||
| *   raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, | *   raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, | ||||||
| *   BSD-like license that allows static linking with closed source software: | *   BSD-like license that allows static linking with closed source software: | ||||||
| * | * | ||||||
| *   Copyright (c) 2013-2016 Ramon Santamaria (@raysan5) | *   Copyright (c) 2013-2017 Ramon Santamaria (@raysan5) | ||||||
| * | * | ||||||
| *   This software is provided "as-is", without any express or implied warranty. In no event | *   This software is provided "as-is", without any express or implied warranty. In no event | ||||||
| *   will the authors be held liable for any damages arising from the use of this software. | *   will the authors be held liable for any damages arising from the use of this software. | ||||||
| @@ -72,7 +72,6 @@ | |||||||
| //#define PLATFORM_ANDROID      // Android device | //#define PLATFORM_ANDROID      // Android device | ||||||
| //#define PLATFORM_RPI          // Raspberry Pi | //#define PLATFORM_RPI          // Raspberry Pi | ||||||
| //#define PLATFORM_WEB          // HTML5 (emscripten, asm.js) | //#define PLATFORM_WEB          // HTML5 (emscripten, asm.js) | ||||||
| //#define RLGL_OCULUS_SUPPORT   // Oculus Rift CV1 (complementary to PLATFORM_DESKTOP) |  | ||||||
|  |  | ||||||
| // Security check in case no PLATFORM_* defined | // Security check in case no PLATFORM_* defined | ||||||
| #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) | #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) | ||||||
| @@ -98,13 +97,13 @@ | |||||||
| #define RAD2DEG (180.0f/PI) | #define RAD2DEG (180.0f/PI) | ||||||
|  |  | ||||||
| // raylib Config Flags | // raylib Config Flags | ||||||
| #define FLAG_FULLSCREEN_MODE    1 | #define FLAG_SHOW_LOGO              1       // Set to show raylib logo at startup | ||||||
| #define FLAG_RESIZABLE_WINDOW   2 | #define FLAG_FULLSCREEN_MODE        2       // Set to run program in fullscreen | ||||||
| #define FLAG_SHOW_LOGO          4 | #define FLAG_WINDOW_RESIZABLE       4       // Set to allow resizable window | ||||||
| #define FLAG_SHOW_MOUSE_CURSOR  8 | #define FLAG_WINDOW_DECORATED       8       // Set to show window decoration (frame and buttons) | ||||||
| #define FLAG_CENTERED_MODE     16 | #define FLAG_WINDOW_TRANSPARENT    16       // Set to allow transparent window | ||||||
| #define FLAG_MSAA_4X_HINT      32 | #define FLAG_MSAA_4X_HINT          32       // Set to try enabling MSAA 4X | ||||||
| #define FLAG_VSYNC_HINT        64 | #define FLAG_VSYNC_HINT            64       // Set to try enabling V-Sync on GPU | ||||||
|  |  | ||||||
| // Keyboard Function Keys | // Keyboard Function Keys | ||||||
| #define KEY_SPACE            32 | #define KEY_SPACE            32 | ||||||
| @@ -293,17 +292,13 @@ | |||||||
| #define RAYWHITE   CLITERAL{ 245, 245, 245, 255 }   // My own White (raylib logo) | #define RAYWHITE   CLITERAL{ 245, 245, 245, 255 }   // My own White (raylib logo) | ||||||
|  |  | ||||||
| //---------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------- | ||||||
| // Types and Structures Definition | // Structures Definition | ||||||
| //---------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------- | ||||||
| #ifndef __cplusplus | #ifndef __cplusplus | ||||||
| // Boolean type | // Boolean type | ||||||
|     #ifndef __APPLE__ |     #if !defined(_STDBOOL_H) | ||||||
|         #if !defined(_STDBOOL_H) |         typedef enum { false, true } bool; | ||||||
|             typedef enum { false, true } bool; |         #define _STDBOOL_H | ||||||
|             #define _STDBOOL_H |  | ||||||
|         #endif |  | ||||||
|     #else |  | ||||||
|         #include <stdbool.h> |  | ||||||
|     #endif |     #endif | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| @@ -351,35 +346,41 @@ typedef struct Image { | |||||||
|     int width;              // Image base width |     int width;              // Image base width | ||||||
|     int height;             // Image base height |     int height;             // Image base height | ||||||
|     int mipmaps;            // Mipmap levels, 1 by default |     int mipmaps;            // Mipmap levels, 1 by default | ||||||
|     int format;             // Data format (TextureFormat) |     int format;             // Data format (TextureFormat type) | ||||||
| } Image; | } Image; | ||||||
|  |  | ||||||
| // Texture2D type, bpp always RGBA (32bit) | // Texture2D type | ||||||
| // NOTE: Data stored in GPU memory | // NOTE: Data stored in GPU memory | ||||||
| typedef struct Texture2D { | typedef struct Texture2D { | ||||||
|     unsigned int id;        // OpenGL texture id |     unsigned int id;        // OpenGL texture id | ||||||
|     int width;              // Texture base width |     int width;              // Texture base width | ||||||
|     int height;             // Texture base height |     int height;             // Texture base height | ||||||
|     int mipmaps;            // Mipmap levels, 1 by default |     int mipmaps;            // Mipmap levels, 1 by default | ||||||
|     int format;             // Data format (TextureFormat) |     int format;             // Data format (TextureFormat type) | ||||||
| } Texture2D; | } Texture2D; | ||||||
|  |  | ||||||
| // RenderTexture2D type, for texture rendering | // RenderTexture2D type, for texture rendering | ||||||
| typedef struct RenderTexture2D { | typedef struct RenderTexture2D { | ||||||
|     unsigned int id;        // Render texture (fbo) id |     unsigned int id;        // OpenGL Framebuffer Object (FBO) id | ||||||
|     Texture2D texture;      // Color buffer attachment texture |     Texture2D texture;      // Color buffer attachment texture | ||||||
|     Texture2D depth;        // Depth buffer attachment texture |     Texture2D depth;        // Depth buffer attachment texture | ||||||
| } RenderTexture2D; | } RenderTexture2D; | ||||||
|  |  | ||||||
|  | // SpriteFont character info | ||||||
|  | typedef struct CharInfo { | ||||||
|  |     int value;              // Character value (Unicode) | ||||||
|  |     Rectangle rec;          // Character rectangle in sprite font | ||||||
|  |     int offsetX;            // Character offset X when drawing | ||||||
|  |     int offsetY;            // Character offset Y when drawing | ||||||
|  |     int advanceX;           // Character advance position X | ||||||
|  | } CharInfo; | ||||||
|  |  | ||||||
| // SpriteFont type, includes texture and charSet array data | // SpriteFont type, includes texture and charSet array data | ||||||
| typedef struct SpriteFont { | typedef struct SpriteFont { | ||||||
|     Texture2D texture;      // Font texture |     Texture2D texture;      // Font texture | ||||||
|     int size;               // Base size (default chars height) |     int baseSize;           // Base size (default chars height) | ||||||
|     int numChars;           // Number of characters |     int charsCount;         // Number of characters | ||||||
|     int *charValues;        // Characters values array |     CharInfo *chars;        // Characters info data | ||||||
|     Rectangle *charRecs;    // Characters rectangles within the texture |  | ||||||
|     Vector2 *charOffsets;   // Characters offsets (on drawing) |  | ||||||
|     int *charAdvanceX;      // Characters x advance (on drawing) |  | ||||||
| } SpriteFont; | } SpriteFont; | ||||||
|  |  | ||||||
| // Camera type, defines a camera position/orientation in 3d space | // Camera type, defines a camera position/orientation in 3d space | ||||||
| @@ -466,31 +467,20 @@ typedef struct Model { | |||||||
|     Material material;      // Shader and textures data |     Material material;      // Shader and textures data | ||||||
| } Model; | } Model; | ||||||
|  |  | ||||||
| // Light type |  | ||||||
| typedef struct LightData { |  | ||||||
|     unsigned int id;        // Light unique id |  | ||||||
|     bool enabled;           // Light enabled |  | ||||||
|     int type;               // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT |  | ||||||
|  |  | ||||||
|     Vector3 position;       // Light position |  | ||||||
|     Vector3 target;         // Light direction: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) |  | ||||||
|     float radius;           // Light attenuation radius light intensity reduced with distance (world distance) |  | ||||||
|  |  | ||||||
|     Color diffuse;          // Light diffuse color |  | ||||||
|     float intensity;        // Light intensity level |  | ||||||
|  |  | ||||||
|     float coneAngle;        // Light cone max angle: LIGHT_SPOT |  | ||||||
| } LightData, *Light; |  | ||||||
|  |  | ||||||
| // Light types |  | ||||||
| typedef enum { LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT } LightType; |  | ||||||
|  |  | ||||||
| // Ray type (useful for raycast) | // Ray type (useful for raycast) | ||||||
| typedef struct Ray { | typedef struct Ray { | ||||||
|     Vector3 position;       // Ray position (origin) |     Vector3 position;       // Ray position (origin) | ||||||
|     Vector3 direction;      // Ray direction |     Vector3 direction;      // Ray direction | ||||||
| } Ray; | } Ray; | ||||||
|  |  | ||||||
|  | // Information returned from a raycast | ||||||
|  | typedef struct RayHitInfo { | ||||||
|  |     bool hit;               // Did the ray hit something? | ||||||
|  |     float distance;         // Distance to nearest hit | ||||||
|  |     Vector3 position;       // Position of nearest hit | ||||||
|  |     Vector3 normal;         // Surface normal of hit | ||||||
|  | } RayHitInfo; | ||||||
|  |  | ||||||
| // Wave type, defines audio wave data | // Wave type, defines audio wave data | ||||||
| typedef struct Wave { | typedef struct Wave { | ||||||
|     unsigned int sampleCount;   // Number of samples |     unsigned int sampleCount;   // Number of samples | ||||||
| @@ -523,6 +513,34 @@ typedef struct AudioStream { | |||||||
|     unsigned int buffers[2];    // OpenAL audio buffers (double buffering) |     unsigned int buffers[2];    // OpenAL audio buffers (double buffering) | ||||||
| } AudioStream; | } AudioStream; | ||||||
|  |  | ||||||
|  | // rRES data returned when reading a resource,  | ||||||
|  | // it contains all required data for user (24 byte) | ||||||
|  | typedef struct RRESData { | ||||||
|  |     unsigned int type;          // Resource type (4 byte) | ||||||
|  |  | ||||||
|  |     unsigned int param1;        // Resouce parameter 1 (4 byte) | ||||||
|  |     unsigned int param2;        // Resouce parameter 2 (4 byte) | ||||||
|  |     unsigned int param3;        // Resouce parameter 3 (4 byte) | ||||||
|  |     unsigned int param4;        // Resouce parameter 4 (4 byte) | ||||||
|  |  | ||||||
|  |     void *data;                 // Resource data pointer (4 byte) | ||||||
|  | } RRESData; | ||||||
|  |  | ||||||
|  | // RRES type (pointer to RRESData array) | ||||||
|  | typedef struct RRESData *RRES; | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------------------------------- | ||||||
|  | // Enumerators Definition | ||||||
|  | //---------------------------------------------------------------------------------- | ||||||
|  | // Trace log type | ||||||
|  | typedef enum {  | ||||||
|  |     INFO = 0, | ||||||
|  |     WARNING,  | ||||||
|  |     ERROR,  | ||||||
|  |     DEBUG,  | ||||||
|  |     OTHER  | ||||||
|  | } LogType; | ||||||
|  |  | ||||||
| // Texture formats | // Texture formats | ||||||
| // NOTE: Support depends on OpenGL version and platform | // NOTE: Support depends on OpenGL version and platform | ||||||
| typedef enum { | typedef enum { | ||||||
| @@ -533,6 +551,7 @@ typedef enum { | |||||||
|     UNCOMPRESSED_R5G5B5A1,          // 16 bpp (1 bit alpha) |     UNCOMPRESSED_R5G5B5A1,          // 16 bpp (1 bit alpha) | ||||||
|     UNCOMPRESSED_R4G4B4A4,          // 16 bpp (4 bit alpha) |     UNCOMPRESSED_R4G4B4A4,          // 16 bpp (4 bit alpha) | ||||||
|     UNCOMPRESSED_R8G8B8A8,          // 32 bpp |     UNCOMPRESSED_R8G8B8A8,          // 32 bpp | ||||||
|  |     UNCOMPRESSED_R32G32B32,         // 32 bit per channel (float) - HDR | ||||||
|     COMPRESSED_DXT1_RGB,            // 4 bpp (no alpha) |     COMPRESSED_DXT1_RGB,            // 4 bpp (no alpha) | ||||||
|     COMPRESSED_DXT1_RGBA,           // 4 bpp (1 bit alpha) |     COMPRESSED_DXT1_RGBA,           // 4 bpp (1 bit alpha) | ||||||
|     COMPRESSED_DXT3_RGBA,           // 8 bpp |     COMPRESSED_DXT3_RGBA,           // 8 bpp | ||||||
| @@ -549,7 +568,7 @@ typedef enum { | |||||||
| // Texture parameters: filter mode | // Texture parameters: filter mode | ||||||
| // NOTE 1: Filtering considers mipmaps if available in the texture | // NOTE 1: Filtering considers mipmaps if available in the texture | ||||||
| // NOTE 2: Filter is accordingly set for minification and magnification | // NOTE 2: Filter is accordingly set for minification and magnification | ||||||
| typedef enum {  | typedef enum { | ||||||
|     FILTER_POINT = 0,               // No filter, just pixel aproximation |     FILTER_POINT = 0,               // No filter, just pixel aproximation | ||||||
|     FILTER_BILINEAR,                // Linear filtering |     FILTER_BILINEAR,                // Linear filtering | ||||||
|     FILTER_TRILINEAR,               // Trilinear filtering (linear with mipmaps) |     FILTER_TRILINEAR,               // Trilinear filtering (linear with mipmaps) | ||||||
| @@ -559,10 +578,18 @@ typedef enum { | |||||||
| } TextureFilterMode; | } TextureFilterMode; | ||||||
|  |  | ||||||
| // Texture parameters: wrap mode | // Texture parameters: wrap mode | ||||||
| typedef enum { WRAP_REPEAT = 0, WRAP_CLAMP, WRAP_MIRROR } TextureWrapMode; | typedef enum {  | ||||||
|  |     WRAP_REPEAT = 0,  | ||||||
|  |     WRAP_CLAMP,  | ||||||
|  |     WRAP_MIRROR  | ||||||
|  | } TextureWrapMode; | ||||||
|  |  | ||||||
| // Color blending modes (pre-defined) | // Color blending modes (pre-defined) | ||||||
| typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode; | typedef enum {  | ||||||
|  |     BLEND_ALPHA = 0,  | ||||||
|  |     BLEND_ADDITIVE,  | ||||||
|  |     BLEND_MULTIPLIED | ||||||
|  | } BlendMode; | ||||||
|  |  | ||||||
| // Gestures type | // Gestures type | ||||||
| // NOTE: It could be used as flags to enable only some gestures | // NOTE: It could be used as flags to enable only some gestures | ||||||
| @@ -581,12 +608,12 @@ typedef enum { | |||||||
| } Gestures; | } Gestures; | ||||||
|  |  | ||||||
| // Camera system modes | // Camera system modes | ||||||
| typedef enum {  | typedef enum { | ||||||
|     CAMERA_CUSTOM = 0,  |     CAMERA_CUSTOM = 0, | ||||||
|     CAMERA_FREE,  |     CAMERA_FREE, | ||||||
|     CAMERA_ORBITAL,  |     CAMERA_ORBITAL, | ||||||
|     CAMERA_FIRST_PERSON,  |     CAMERA_FIRST_PERSON, | ||||||
|     CAMERA_THIRD_PERSON  |     CAMERA_THIRD_PERSON | ||||||
| } CameraMode; | } CameraMode; | ||||||
|  |  | ||||||
| // Head Mounted Display devices | // Head Mounted Display devices | ||||||
| @@ -602,6 +629,18 @@ typedef enum { | |||||||
|     HMD_FOVE_VR, |     HMD_FOVE_VR, | ||||||
| } VrDevice; | } VrDevice; | ||||||
|  |  | ||||||
|  | // RRESData type | ||||||
|  | typedef enum {  | ||||||
|  |     RRES_TYPE_RAW = 0,  | ||||||
|  |     RRES_TYPE_IMAGE,  | ||||||
|  |     RRES_TYPE_WAVE,  | ||||||
|  |     RRES_TYPE_VERTEX,  | ||||||
|  |     RRES_TYPE_TEXT, | ||||||
|  |     RRES_TYPE_FONT_IMAGE, | ||||||
|  |     RRES_TYPE_FONT_CHARDATA,    // CharInfo data array | ||||||
|  |     RRES_TYPE_DIRECTORY | ||||||
|  | } RRESDataType; | ||||||
|  |  | ||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| extern "C" {            // Prevents name mangling of functions | extern "C" {            // Prevents name mangling of functions | ||||||
| #endif | #endif | ||||||
| @@ -615,44 +654,48 @@ extern "C" {            // Prevents name mangling of functions | |||||||
| // Window and Graphics Device Functions (Module: core) | // Window and Graphics Device Functions (Module: core) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| #if defined(PLATFORM_ANDROID) | #if defined(PLATFORM_ANDROID) | ||||||
| RLAPI void InitWindow(int width, int height, void *state);        // Init Android Activity and OpenGL Graphics (struct android_app) | RLAPI void InitWindow(int width, int height, void *state);        // Initialize Android activity | ||||||
| #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) | #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) | ||||||
| RLAPI void InitWindow(int width, int height, const char *title);  // Initialize Window and OpenGL Graphics | RLAPI void InitWindow(int width, int height, const char *title);  // Initialize window and OpenGL context | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| RLAPI void CloseWindow(void);                                     // Close Window and Terminate Context | RLAPI void CloseWindow(void);                                     // Close window and unload OpenGL context | ||||||
| RLAPI bool WindowShouldClose(void);                               // Detect if KEY_ESCAPE pressed or Close icon pressed | RLAPI bool WindowShouldClose(void);                               // Check if KEY_ESCAPE pressed or Close icon pressed | ||||||
| RLAPI bool IsWindowMinimized(void);                               // Detect if window has been minimized (or lost focus) | RLAPI bool IsWindowMinimized(void);                               // Check if window has been minimized (or lost focus) | ||||||
| RLAPI void ToggleFullscreen(void);                                // Fullscreen toggle (only PLATFORM_DESKTOP) | RLAPI void ToggleFullscreen(void);                                // Toggle fullscreen mode (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowIcon(Image image);                            // Set icon for window (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowPosition(int x, int y);                       // Set window position on screen (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowMonitor(int monitor);                         // Set monitor for the current window (fullscreen mode) | ||||||
|  | RLAPI void SetWindowMinSize(int width, int height);               // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) | ||||||
| RLAPI int GetScreenWidth(void);                                   // Get current screen width | RLAPI int GetScreenWidth(void);                                   // Get current screen width | ||||||
| RLAPI int GetScreenHeight(void);                                  // Get current screen height | RLAPI int GetScreenHeight(void);                                  // Get current screen height | ||||||
|  |  | ||||||
| #if !defined(PLATFORM_ANDROID) | #if !defined(PLATFORM_ANDROID) | ||||||
| RLAPI void ShowCursor(void);                                      // Shows cursor | RLAPI void ShowCursor(void);                                      // Shows cursor | ||||||
| RLAPI void HideCursor(void);                                      // Hides cursor | RLAPI void HideCursor(void);                                      // Hides cursor | ||||||
| RLAPI bool IsCursorHidden(void);                                  // Returns true if cursor is not visible | RLAPI bool IsCursorHidden(void);                                  // Check if cursor is not visible | ||||||
| RLAPI void EnableCursor(void);                                    // Enables cursor | RLAPI void EnableCursor(void);                                    // Enables cursor (unlock cursor) | ||||||
| RLAPI void DisableCursor(void);                                   // Disables cursor | RLAPI void DisableCursor(void);                                   // Disables cursor (lock cursor) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| RLAPI void ClearBackground(Color color);                          // Sets Background Color | RLAPI void ClearBackground(Color color);                          // Set background color (framebuffer clear color) | ||||||
| RLAPI void BeginDrawing(void);                                    // Setup drawing canvas to start drawing | RLAPI void BeginDrawing(void);                                    // Setup canvas (framebuffer) to start drawing | ||||||
| RLAPI void EndDrawing(void);                                      // End canvas drawing and Swap Buffers (Double Buffering) | RLAPI void EndDrawing(void);                                      // End canvas drawing and swap buffers (double buffering) | ||||||
|  |  | ||||||
| RLAPI void Begin2dMode(Camera2D camera);                          // Initialize 2D mode with custom camera | RLAPI void Begin2dMode(Camera2D camera);                          // Initialize 2D mode with custom camera (2D) | ||||||
| RLAPI void End2dMode(void);                                       // Ends 2D mode custom camera usage | RLAPI void End2dMode(void);                                       // Ends 2D mode with custom camera | ||||||
| RLAPI void Begin3dMode(Camera camera);                            // Initializes 3D mode for drawing (Camera setup) | RLAPI void Begin3dMode(Camera camera);                            // Initializes 3D mode with custom camera (3D) | ||||||
| RLAPI void End3dMode(void);                                       // Ends 3D mode and returns to default 2D orthographic mode | RLAPI void End3dMode(void);                                       // Ends 3D mode and returns to default 2D orthographic mode | ||||||
| RLAPI void BeginTextureMode(RenderTexture2D target);              // Initializes render texture for drawing | RLAPI void BeginTextureMode(RenderTexture2D target);              // Initializes render texture for drawing | ||||||
| RLAPI void EndTextureMode(void);                                  // Ends drawing to render texture | RLAPI void EndTextureMode(void);                                  // Ends drawing to render texture | ||||||
|  |  | ||||||
| RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera);      // Returns a ray trace from mouse position | RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera);      // Returns a ray trace from mouse position | ||||||
| RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera);  // Returns the screen space position from a 3d world space position | RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera);  // Returns the screen space position for a 3d world space position | ||||||
| RLAPI Matrix GetCameraMatrix(Camera camera);                      // Returns camera transform matrix (view matrix) | RLAPI Matrix GetCameraMatrix(Camera camera);                      // Returns camera transform matrix (view matrix) | ||||||
|  |  | ||||||
| RLAPI void SetTargetFPS(int fps);                                 // Set target FPS (maximum) | RLAPI void SetTargetFPS(int fps);                                 // Set target FPS (maximum) | ||||||
| RLAPI float GetFPS(void);                                         // Returns current FPS | RLAPI int GetFPS(void);                                           // Returns current FPS | ||||||
| RLAPI float GetFrameTime(void);                                   // Returns time in seconds for one frame | RLAPI float GetFrameTime(void);                                   // Returns time in seconds for last frame drawn | ||||||
|  |  | ||||||
| RLAPI Color GetColor(int hexValue);                               // Returns a Color struct from hexadecimal value | RLAPI Color GetColor(int hexValue);                               // Returns a Color struct from hexadecimal value | ||||||
| RLAPI int GetHexValue(Color color);                               // Returns hexadecimal value for a Color | RLAPI int GetHexValue(Color color);                               // Returns hexadecimal value for a Color | ||||||
| @@ -663,15 +706,21 @@ RLAPI float *MatrixToFloat(Matrix mat);                           // Converts Ma | |||||||
| RLAPI int GetRandomValue(int min, int max);                       // Returns a random value between min and max (both included) | RLAPI int GetRandomValue(int min, int max);                       // Returns a random value between min and max (both included) | ||||||
| RLAPI Color Fade(Color color, float alpha);                       // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f | RLAPI Color Fade(Color color, float alpha);                       // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f | ||||||
|  |  | ||||||
| RLAPI void SetConfigFlags(char flags);                            // Setup some window configuration flags | RLAPI void ShowLogo(void);                                        // Activate raylib logo at startup (can be done with flags) | ||||||
| RLAPI void ShowLogo(void);                                        // Activates raylib logo at startup (can be done with flags) | RLAPI void SetConfigFlags(char flags);                            // Setup window configuration flags (view FLAGS) | ||||||
|  | RLAPI void TraceLog(int logType, const char *text, ...);          // Show trace log messages (INFO, WARNING, ERROR, DEBUG) | ||||||
|  | RLAPI void TakeScreenshot(const char *fileName);                  // Takes a screenshot of current screen (saved a .png) | ||||||
|  |  | ||||||
| RLAPI bool IsFileDropped(void);                                   // Check if a file have been dropped into window | RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension | ||||||
| RLAPI char **GetDroppedFiles(int *count);                         // Retrieve dropped files into window | RLAPI const char *GetDirectoryPath(const char *fileName);         // Get directory for a given fileName (with path) | ||||||
|  | RLAPI const char *GetWorkingDirectory(void);                      // Get current working directory | ||||||
|  | RLAPI bool ChangeDirectory(const char *dir);                      // Change working directory, returns true if success | ||||||
|  | RLAPI bool IsFileDropped(void);                                   // Check if a file has been dropped into window | ||||||
|  | RLAPI char **GetDroppedFiles(int *count);                         // Get dropped files names | ||||||
| RLAPI void ClearDroppedFiles(void);                               // Clear dropped files paths buffer | RLAPI void ClearDroppedFiles(void);                               // Clear dropped files paths buffer | ||||||
|  |  | ||||||
| RLAPI void StorageSaveValue(int position, int value);             // Storage save integer value (to defined position) | RLAPI void StorageSaveValue(int position, int value);             // Save integer value to storage file (to defined position) | ||||||
| RLAPI int StorageLoadValue(int position);                         // Storage load integer value (from defined position) | RLAPI int StorageLoadValue(int position);                         // Load integer value from storage file (from defined position) | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Input Handling Functions (Module: core) | // Input Handling Functions (Module: core) | ||||||
| @@ -741,12 +790,15 @@ RLAPI void DrawPixel(int posX, int posY, Color color); | |||||||
| RLAPI void DrawPixelV(Vector2 position, Color color);                                                    // Draw a pixel (Vector version) | RLAPI void DrawPixelV(Vector2 position, Color color);                                                    // Draw a pixel (Vector version) | ||||||
| RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);                // Draw a line | RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);                // Draw a line | ||||||
| RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);                                     // Draw a line (Vector version) | RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);                                     // Draw a line (Vector version) | ||||||
|  | RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color);                       // Draw a line defining thickness | ||||||
|  | RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color);                   // Draw a line using cubic-bezier curves in-out | ||||||
| RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color);                              // Draw a color-filled circle | RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color);                              // Draw a color-filled circle | ||||||
| RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);       // Draw a gradient-filled circle | RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);       // Draw a gradient-filled circle | ||||||
| RLAPI void DrawCircleV(Vector2 center, float radius, Color color);                                       // Draw a color-filled circle (Vector version) | RLAPI void DrawCircleV(Vector2 center, float radius, Color color);                                       // Draw a color-filled circle (Vector version) | ||||||
| RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color);                         // Draw circle outline | RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color);                         // Draw circle outline | ||||||
| RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color);                        // Draw a color-filled rectangle | RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color);                        // Draw a color-filled rectangle | ||||||
| RLAPI void DrawRectangleRec(Rectangle rec, Color color);                                                 // Draw a color-filled rectangle | RLAPI void DrawRectangleRec(Rectangle rec, Color color);                                                 // Draw a color-filled rectangle | ||||||
|  | RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color);                 // Draw a color-filled rectangle with pro parameters | ||||||
| RLAPI void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle | RLAPI void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle | ||||||
| RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color);                                  // Draw a color-filled rectangle (Vector version) | RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color);                                  // Draw a color-filled rectangle (Vector version) | ||||||
| RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color);                   // Draw rectangle outline | RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color);                   // Draw rectangle outline | ||||||
| @@ -767,21 +819,19 @@ RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Ve | |||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Texture Loading and Drawing Functions (Module: textures) | // Texture Loading and Drawing Functions (Module: textures) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI Image LoadImage(const char *fileName);                                                             // Load an image into CPU memory (RAM) | RLAPI Image LoadImage(const char *fileName);                                                             // Load image from file into CPU memory (RAM) | ||||||
| RLAPI Image LoadImageEx(Color *pixels, int width, int height);                                           // Load image data from Color array data (RGBA - 32bit) | RLAPI Image LoadImageEx(Color *pixels, int width, int height);                                           // Load image from Color array data (RGBA - 32bit) | ||||||
| RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize);       // Load image data from RAW file | RLAPI Image LoadImagePro(void *data, int width, int height, int format);                                 // Load image from raw data with parameters | ||||||
| RLAPI Image LoadImageFromRES(const char *rresName, int resId);                                           // Load an image from rRES file (raylib Resource) | RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize);       // Load image from RAW file data | ||||||
| RLAPI Texture2D LoadTexture(const char *fileName);                                                       // Load an image as texture into GPU memory | RLAPI Texture2D LoadTexture(const char *fileName);                                                       // Load texture from file into GPU memory (VRAM) | ||||||
| RLAPI Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat);                     // Load a texture from raw data into GPU memory | RLAPI Texture2D LoadTextureFromImage(Image image);                                                       // Load texture from image data | ||||||
| RLAPI Texture2D LoadTextureFromRES(const char *rresName, int resId);                                     // Load an image as texture from rRES file (raylib Resource) | RLAPI RenderTexture2D LoadRenderTexture(int width, int height);                                          // Load texture for rendering (framebuffer) | ||||||
| RLAPI Texture2D LoadTextureFromImage(Image image);                                                       // Load a texture from image data |  | ||||||
| RLAPI RenderTexture2D LoadRenderTexture(int width, int height);                                          // Load a texture to be used for rendering |  | ||||||
| RLAPI void UnloadImage(Image image);                                                                     // Unload image from CPU memory (RAM) | RLAPI void UnloadImage(Image image);                                                                     // Unload image from CPU memory (RAM) | ||||||
| RLAPI void UnloadTexture(Texture2D texture);                                                             // Unload texture from GPU memory | RLAPI void UnloadTexture(Texture2D texture);                                                             // Unload texture from GPU memory (VRAM) | ||||||
| RLAPI void UnloadRenderTexture(RenderTexture2D target);                                                  // Unload render texture from GPU memory | RLAPI void UnloadRenderTexture(RenderTexture2D target);                                                  // Unload render texture from GPU memory (VRAM) | ||||||
| RLAPI Color *GetImageData(Image image);                                                                  // Get pixel data from image as a Color struct array | RLAPI Color *GetImageData(Image image);                                                                  // Get pixel data from image as a Color struct array | ||||||
| RLAPI Image GetTextureData(Texture2D texture);                                                           // Get pixel data from GPU texture and return an Image | RLAPI Image GetTextureData(Texture2D texture);                                                           // Get pixel data from GPU texture and return an Image | ||||||
| RLAPI void UpdateTexture(Texture2D texture, void *pixels);                                               // Update GPU texture with new data | RLAPI void UpdateTexture(Texture2D texture, const void *pixels);                                         // Update GPU texture with new data | ||||||
| RLAPI void ImageToPOT(Image *image, Color fillColor);                                                    // Convert image to POT (power-of-two) | RLAPI void ImageToPOT(Image *image, Color fillColor);                                                    // Convert image to POT (power-of-two) | ||||||
| RLAPI void ImageFormat(Image *image, int newFormat);                                                     // Convert image data to desired format | RLAPI void ImageFormat(Image *image, int newFormat);                                                     // Convert image data to desired format | ||||||
| RLAPI void ImageAlphaMask(Image *image, Image alphaMask);                                                // Apply alpha mask to image | RLAPI void ImageAlphaMask(Image *image, Image alphaMask);                                                // Apply alpha mask to image | ||||||
| @@ -794,7 +844,8 @@ RLAPI Image ImageText(const char *text, int fontSize, Color color); | |||||||
| RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint);     // Create an image from text (custom sprite font) | RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint);     // Create an image from text (custom sprite font) | ||||||
| RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);                         // Draw a source image within a destination image | RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);                         // Draw a source image within a destination image | ||||||
| RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color);     // Draw text (default font) within an image (destination) | RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color);     // Draw text (default font) within an image (destination) | ||||||
| RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, float fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) | RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, | ||||||
|  |                            float fontSize, int spacing, Color color);                                    // Draw text (custom sprite font) within an image (destination) | ||||||
| RLAPI void ImageFlipVertical(Image *image);                                                              // Flip image vertically | RLAPI void ImageFlipVertical(Image *image);                                                              // Flip image vertically | ||||||
| RLAPI void ImageFlipHorizontal(Image *image);                                                            // Flip image horizontally | RLAPI void ImageFlipHorizontal(Image *image);                                                            // Flip image horizontally | ||||||
| RLAPI void ImageColorTint(Image *image, Color color);                                                    // Modify image color: tint | RLAPI void ImageColorTint(Image *image, Color color);                                                    // Modify image color: tint | ||||||
| @@ -817,9 +868,9 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle dest | |||||||
| // Font Loading and Text Drawing Functions (Module: text) | // Font Loading and Text Drawing Functions (Module: text) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont | RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont | ||||||
| RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load a SpriteFont image into GPU memory | RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load SpriteFont from file into GPU memory (VRAM) | ||||||
| RLAPI SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars);    // Load a SpriteFont from TTF font with parameters | RLAPI SpriteFont LoadSpriteFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars);   // Load SpriteFont from file with extended parameters | ||||||
| RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory | RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory (VRAM) | ||||||
|  |  | ||||||
| RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color);                    // Draw text (using default font) | RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color);                    // Draw text (using default font) | ||||||
| RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position,                         // Draw text using SpriteFont and additional parameters | RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position,                         // Draw text using SpriteFont and additional parameters | ||||||
| @@ -827,7 +878,7 @@ RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, | |||||||
| RLAPI int MeasureText(const char *text, int fontSize);                                                   // Measure string width for default font | RLAPI int MeasureText(const char *text, int fontSize);                                                   // Measure string width for default font | ||||||
| RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing);       // Measure string size for SpriteFont | RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing);       // Measure string size for SpriteFont | ||||||
|  |  | ||||||
| RLAPI void DrawFPS(int posX, int posY);                                                                  // Shows current FPS on top-left corner | RLAPI void DrawFPS(int posX, int posY);                                                                  // Shows current FPS | ||||||
| RLAPI const char *FormatText(const char *text, ...);                                                     // Formatting of text with variables to 'embed' | RLAPI const char *FormatText(const char *text, ...);                                                     // Formatting of text with variables to 'embed' | ||||||
| RLAPI const char *SubText(const char *text, int position, int length);                                   // Get a piece of a text string | RLAPI const char *SubText(const char *text, int position, int length);                                   // Get a piece of a text string | ||||||
|  |  | ||||||
| @@ -849,50 +900,57 @@ RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); | |||||||
| RLAPI void DrawRay(Ray ray, Color color);                                                                // Draw a ray line | RLAPI void DrawRay(Ray ray, Color color);                                                                // Draw a ray line | ||||||
| RLAPI void DrawGrid(int slices, float spacing);                                                          // Draw a grid (centered at (0, 0, 0)) | RLAPI void DrawGrid(int slices, float spacing);                                                          // Draw a grid (centered at (0, 0, 0)) | ||||||
| RLAPI void DrawGizmo(Vector3 position);                                                                  // Draw simple gizmo | RLAPI void DrawGizmo(Vector3 position);                                                                  // Draw simple gizmo | ||||||
| RLAPI void DrawLight(Light light);                                                                       // Draw light in 3D world |  | ||||||
| //DrawTorus(), DrawTeapot() could be useful? | //DrawTorus(), DrawTeapot() could be useful? | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Model 3d Loading and Drawing Functions (Module: models) | // Model 3d Loading and Drawing Functions (Module: models) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI Model LoadModel(const char *fileName);                          // Load a 3d model (.OBJ) | RLAPI Mesh LoadMesh(const char *fileName);                                                              // Load mesh from file | ||||||
| RLAPI Model LoadModelEx(Mesh data, bool dynamic);                     // Load a 3d model (from mesh data) | RLAPI Mesh LoadMeshEx(int numVertex, float *vData, float *vtData, float *vnData, Color *cData);         // Load mesh from vertex data | ||||||
| RLAPI Model LoadModelFromRES(const char *rresName, int resId);        // Load a 3d model from rRES file (raylib Resource) | RLAPI Model LoadModel(const char *fileName);                                                            // Load model from file | ||||||
| RLAPI Model LoadHeightmap(Image heightmap, Vector3 size);             // Load a heightmap image as a 3d model | RLAPI Model LoadModelFromMesh(Mesh data, bool dynamic);                                                 // Load model from mesh data | ||||||
| RLAPI Model LoadCubicmap(Image cubicmap);                             // Load a map image as a 3d model (cubes based) | RLAPI Model LoadHeightmap(Image heightmap, Vector3 size);                                               // Load heightmap model from image data | ||||||
| RLAPI void UnloadModel(Model model);                                  // Unload 3d model from memory | RLAPI Model LoadCubicmap(Image cubicmap);                                                               // Load cubes-based map model from image data | ||||||
|  | RLAPI void UnloadMesh(Mesh *mesh);                                                                      // Unload mesh from memory (RAM and/or VRAM) | ||||||
|  | RLAPI void UnloadModel(Model model);                                                                    // Unload model from memory (RAM and/or VRAM) | ||||||
|  |  | ||||||
| RLAPI Material LoadMaterial(const char *fileName);                    // Load material data (.MTL) | RLAPI Material LoadMaterial(const char *fileName);                                                      // Load material from file | ||||||
| RLAPI Material LoadDefaultMaterial(void);                             // Load default material (uses default models shader) | RLAPI Material LoadDefaultMaterial(void);                                                               // Load default material (uses default models shader) | ||||||
| RLAPI Material LoadStandardMaterial(void);                            // Load standard material (uses material attributes and lighting shader) | RLAPI void UnloadMaterial(Material material);                                                           // Unload material from GPU memory (VRAM) | ||||||
| RLAPI void UnloadMaterial(Material material);                         // Unload material textures from VRAM |  | ||||||
|  |  | ||||||
| RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint);                            // Draw a model (with texture if set) | RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint);                           // Draw a model (with texture if set) | ||||||
| RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);      // Draw a model with extended parameters | RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, | ||||||
|  |                        float rotationAngle, Vector3 scale, Color tint);                                 // Draw a model with extended parameters | ||||||
| RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint);                      // Draw a model wires (with texture if set) | RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint);                      // Draw a model wires (with texture if set) | ||||||
| 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 | RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, | ||||||
| RLAPI void DrawBoundingBox(BoundingBox box, Color color);                                                // Draw bounding box (wires) |                             float rotationAngle, Vector3 scale, Color tint);                            // Draw a model wires (with texture if set) with extended parameters | ||||||
|  | RLAPI void DrawBoundingBox(BoundingBox box, Color color);                                               // Draw bounding box (wires) | ||||||
|  |  | ||||||
| RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);                         // Draw a billboard texture | RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);     // Draw a billboard texture | ||||||
| RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec | RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, | ||||||
|  |                             Vector3 center, float size, Color tint);                                    // Draw a billboard texture defined by sourceRec | ||||||
|  |  | ||||||
| RLAPI BoundingBox CalculateBoundingBox(Mesh mesh);                                                                    // Calculate mesh bounding box limits | RLAPI BoundingBox CalculateBoundingBox(Mesh mesh);                                                      // Calculate mesh bounding box limits | ||||||
| RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);                     // Detect collision between two spheres | RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);       // Detect collision between two spheres | ||||||
| RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);                                                   // Detect collision between two bounding boxes | RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);                                     // Detect collision between two bounding boxes | ||||||
| RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere);                        // Detect collision between box and sphere | RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere);          // Detect collision between box and sphere | ||||||
| RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius);                              // Detect collision between ray and sphere | RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius);                // Detect collision between ray and sphere | ||||||
| RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint);   // Detect collision between ray and sphere with extended parameters and collision point detection | RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, | ||||||
| RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box);                                                            // Detect collision between ray and box |                                      Vector3 *collisionPoint);                                          // Detect collision between ray and sphere, returns collision point | ||||||
|  | RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box);                                              // Detect collision between ray and box | ||||||
|  | RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh);                                              // Get collision info between ray and mesh | ||||||
|  | RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3);                  // Get collision info between ray and triangle | ||||||
|  | RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight);                                    // Get collision info between ray and ground plane (Y-normal plane) | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Shaders System Functions (Module: rlgl) | // Shaders System Functions (Module: rlgl) | ||||||
| // NOTE: This functions are useless when using OpenGL 1.1 | // NOTE: This functions are useless when using OpenGL 1.1 | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI Shader LoadShader(char *vsFileName, char *fsFileName);              // Load a custom shader and bind default locations | RLAPI char *LoadText(const char *fileName);                               // Load chars array from text file | ||||||
| RLAPI void UnloadShader(Shader shader);                                   // Unload a custom shader from memory | RLAPI Shader LoadShader(char *vsFileName, char *fsFileName);              // Load shader from files and bind default locations | ||||||
|  | RLAPI void UnloadShader(Shader shader);                                   // Unload shader from GPU memory (VRAM) | ||||||
|  |  | ||||||
| RLAPI Shader GetDefaultShader(void);                                      // Get default shader | RLAPI Shader GetDefaultShader(void);                                      // Get default shader | ||||||
| RLAPI Shader GetStandardShader(void);                                     // Get standard shader |  | ||||||
| RLAPI Texture2D GetDefaultTexture(void);                                  // Get default texture | RLAPI Texture2D GetDefaultTexture(void);                                  // Get default texture | ||||||
|  |  | ||||||
| RLAPI int GetShaderLocation(Shader shader, const char *uniformName);              // Get shader uniform location | RLAPI int GetShaderLocation(Shader shader, const char *uniformName);              // Get shader uniform location | ||||||
| @@ -908,19 +966,17 @@ RLAPI void EndShaderMode(void);                                           // End | |||||||
| RLAPI void BeginBlendMode(int mode);                                      // Begin blending mode (alpha, additive, multiplied) | RLAPI void BeginBlendMode(int mode);                                      // Begin blending mode (alpha, additive, multiplied) | ||||||
| RLAPI void EndBlendMode(void);                                            // End blending mode (reset to default: alpha blending) | RLAPI void EndBlendMode(void);                                            // End blending mode (reset to default: alpha blending) | ||||||
|  |  | ||||||
| RLAPI Light CreateLight(int type, Vector3 position, Color diffuse);       // Create a new light, initialize it and add to pool |  | ||||||
| RLAPI void DestroyLight(Light light);                                     // Destroy a light and take it out of the list |  | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // VR experience Functions (Module: rlgl) | // VR experience Functions (Module: rlgl) | ||||||
| // NOTE: This functions are useless when using OpenGL 1.1 | // NOTE: This functions are useless when using OpenGL 1.1 | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI void InitVrDevice(int vdDevice);            // Init VR device | RLAPI void InitVrSimulator(int vrDevice);           // Init VR simulator for selected device | ||||||
| RLAPI void CloseVrDevice(void);                   // Close VR device | RLAPI void CloseVrSimulator(void);                  // Close VR simulator for current device | ||||||
| RLAPI bool IsVrDeviceReady(void);                 // Detect if VR device is ready | RLAPI bool IsVrSimulatorReady(void);                // Detect if VR device is ready | ||||||
| RLAPI bool IsVrSimulator(void);                   // Detect if VR simulator is running | RLAPI void UpdateVrTracking(Camera *camera);        // Update VR tracking (position and orientation) and camera | ||||||
| RLAPI void UpdateVrTracking(Camera *camera);      // Update VR tracking (position and orientation) and camera | RLAPI void ToggleVrMode(void);                      // Enable/Disable VR experience (device or simulator) | ||||||
| RLAPI void ToggleVrMode(void);                    // Enable/Disable VR experience (device or simulator) | RLAPI void BeginVrDrawing(void);                    // Begin VR simulator stereo rendering | ||||||
|  | RLAPI void EndVrDrawing(void);                      // End VR simulator stereo rendering | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Audio Loading and Playing Functions (Module: audio) | // Audio Loading and Playing Functions (Module: audio) | ||||||
| @@ -928,13 +984,13 @@ RLAPI void ToggleVrMode(void);                    // Enable/Disable VR experienc | |||||||
| RLAPI void InitAudioDevice(void);                                     // Initialize audio device and context | RLAPI void InitAudioDevice(void);                                     // Initialize audio device and context | ||||||
| RLAPI void CloseAudioDevice(void);                                    // Close the audio device and context | RLAPI void CloseAudioDevice(void);                                    // Close the audio device and context | ||||||
| RLAPI bool IsAudioDeviceReady(void);                                  // Check if audio device has been initialized successfully | RLAPI bool IsAudioDeviceReady(void);                                  // Check if audio device has been initialized successfully | ||||||
|  | RLAPI void SetMasterVolume(float volume);                             // Set master volume (listener) | ||||||
|  |  | ||||||
| RLAPI Wave LoadWave(const char *fileName);                            // Load wave data from file into RAM | RLAPI Wave LoadWave(const char *fileName);                            // Load wave data from file | ||||||
| RLAPI Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from float array data (32bit) | RLAPI Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data | ||||||
| RLAPI Sound LoadSound(const char *fileName);                          // Load sound to memory | RLAPI Sound LoadSound(const char *fileName);                          // Load sound from file | ||||||
| RLAPI Sound LoadSoundFromWave(Wave wave);                             // Load sound to memory from wave data | RLAPI Sound LoadSoundFromWave(Wave wave);                             // Load sound from wave data | ||||||
| RLAPI Sound LoadSoundFromRES(const char *rresName, int resId);        // Load sound to memory from rRES file (raylib Resource) | RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data | ||||||
| RLAPI void UpdateSound(Sound sound, void *data, int numSamples);      // Update sound buffer with new data |  | ||||||
| RLAPI void UnloadWave(Wave wave);                                     // Unload wave data | RLAPI void UnloadWave(Wave wave);                                     // Unload wave data | ||||||
| RLAPI void UnloadSound(Sound sound);                                  // Unload sound | RLAPI void UnloadSound(Sound sound);                                  // Unload sound | ||||||
| RLAPI void PlaySound(Sound sound);                                    // Play a sound | RLAPI void PlaySound(Sound sound);                                    // Play a sound | ||||||
| @@ -958,13 +1014,14 @@ RLAPI void ResumeMusicStream(Music music);                            // Resume | |||||||
| RLAPI bool IsMusicPlaying(Music music);                               // Check if music is playing | RLAPI bool IsMusicPlaying(Music music);                               // Check if music is playing | ||||||
| RLAPI void SetMusicVolume(Music music, float volume);                 // Set volume for music (1.0 is max level) | RLAPI void SetMusicVolume(Music music, float volume);                 // Set volume for music (1.0 is max level) | ||||||
| RLAPI void SetMusicPitch(Music music, float pitch);                   // Set pitch for a music (1.0 is base level) | RLAPI void SetMusicPitch(Music music, float pitch);                   // Set pitch for a music (1.0 is base level) | ||||||
|  | RLAPI void SetMusicLoopCount(Music music, float count);               // Set music loop count (loop repeats) | ||||||
| RLAPI float GetMusicTimeLength(Music music);                          // Get music time length (in seconds) | RLAPI float GetMusicTimeLength(Music music);                          // Get music time length (in seconds) | ||||||
| RLAPI float GetMusicTimePlayed(Music music);                          // Get current music time played (in seconds) | RLAPI float GetMusicTimePlayed(Music music);                          // Get current music time played (in seconds) | ||||||
|  |  | ||||||
| RLAPI AudioStream InitAudioStream(unsigned int sampleRate, | RLAPI AudioStream InitAudioStream(unsigned int sampleRate, | ||||||
|                                   unsigned int sampleSize, |                                   unsigned int sampleSize, | ||||||
|                                   unsigned int channels);             // Init audio stream (to stream raw audio pcm data) |                                   unsigned int channels);             // Init audio stream (to stream raw audio pcm data) | ||||||
| RLAPI void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data | RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data | ||||||
| RLAPI void CloseAudioStream(AudioStream stream);                      // Close audio stream and free memory | RLAPI void CloseAudioStream(AudioStream stream);                      // Close audio stream and free memory | ||||||
| RLAPI bool IsAudioBufferProcessed(AudioStream stream);                // Check if any audio stream buffers requires refill | RLAPI bool IsAudioBufferProcessed(AudioStream stream);                // Check if any audio stream buffers requires refill | ||||||
| RLAPI void PlayAudioStream(AudioStream stream);                       // Play audio stream | RLAPI void PlayAudioStream(AudioStream stream);                       // Play audio stream | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -1,51 +1,51 @@ | |||||||
| /********************************************************************************************** | /********************************************************************************************** | ||||||
| * | * | ||||||
| *   raylib 1.6.0 (www.raylib.com) | *   raylib v1.7.0  | ||||||
| * | * | ||||||
| *   A simple and easy-to-use library to learn videogames programming | *   A simple and easy-to-use library to learn videogames programming (www.raylib.com) | ||||||
| * | * | ||||||
| *   Features: | *   FEATURES: | ||||||
| *     Library written in plain C code (C99) | *       - Library written in plain C code (C99) | ||||||
| *     Uses PascalCase/camelCase notation | *       - Multiple platforms supported: Windows, Linux, Mac, Android, Raspberry Pi, HTML5. | ||||||
| *     Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) | *       - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) | ||||||
| *     Unique OpenGL abstraction layer (usable as standalone module): [rlgl] | *       - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] | ||||||
| *     Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) | *       - Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) | ||||||
| *     Multiple textures support, including compressed formats and mipmaps generation | *       - Multiple textures support, including compressed formats and mipmaps generation | ||||||
| *     Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps | *       - Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps | ||||||
| *     Materials (diffuse, normal, specular) and Lighting (point, directional, spot) support | *       - Powerful math module for Vector2, Vector3, Matrix and Quaternion operations: [raymath] | ||||||
| *     Powerful math module for Vector, Matrix and Quaternion operations: [raymath] | *       - Audio loading and playing with streaming support and mixing channels: [audio] | ||||||
| *     Audio loading and playing with streaming support and mixing channels [audio] | *       - VR stereo rendering support with configurable HMD device parameters | ||||||
| *     VR stereo rendering support with configurable HMD device parameters | *       - Minimal external dependencies (GLFW3, OpenGL, OpenAL) | ||||||
| *     Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi, HTML5 and Oculus Rift CV1 | *       - Complete bindings for Lua, Go and Pascal | ||||||
| *     Custom color palette for fancy visuals on raywhite background |  | ||||||
| *     Minimal external dependencies (GLFW3, OpenGL, OpenAL) |  | ||||||
| *     Complete binding for Lua [rlua] |  | ||||||
| * | * | ||||||
| *   External libs: | *   NOTES: | ||||||
| *     GLFW3 (www.glfw.org) for window/context management and input [core] | *       32bit Colors - Any defined Color is always RGBA (4 byte) | ||||||
| *     GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] | *       One custom font is loaded by default when InitWindow() [core] | ||||||
| *     stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] | *       If using OpenGL 3.3 or ES2, one default shader is loaded automatically (internally defined) [rlgl] | ||||||
| *     stb_image_write (Sean Barret) for image writting (PNG) [utils] | *       If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads | ||||||
| *     stb_truetype (Sean Barret) for ttf fonts loading [text] |  | ||||||
| *     stb_vorbis (Sean Barret) for ogg audio loading [audio] |  | ||||||
| *     jar_xm (Joshua Reisenauer) for XM audio module loading [audio] |  | ||||||
| *     jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] |  | ||||||
| *     dr_flac (David Reid) for FLAC audio file loading [audio] |  | ||||||
| *     OpenAL Soft for audio device/context management [audio] |  | ||||||
| *     tinfl for data decompression (DEFLATE algorithm) [utils] |  | ||||||
| * | * | ||||||
| *   Some design decisions: | *   DEPENDENCIES: | ||||||
| *     32bit Colors - All defined color are always RGBA (struct Color is 4 byte) | *       GLFW3 (www.glfw.org) for window/context management and input [core] | ||||||
| *     One custom default font could be loaded automatically when InitWindow() [core] | *       GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] | ||||||
| *     If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads | *       OpenAL Soft for audio device/context management [audio] | ||||||
| *     If using OpenGL 3.3 or ES2, two default shaders could be loaded automatically (internally defined) |  | ||||||
| * | * | ||||||
| *   -- LICENSE -- | *   OPTIONAL DEPENDENCIES: | ||||||
|  | *       stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] | ||||||
|  | *       stb_image_write (Sean Barret) for image writting (PNG) [utils] | ||||||
|  | *       stb_truetype (Sean Barret) for ttf fonts loading [text] | ||||||
|  | *       stb_vorbis (Sean Barret) for ogg audio loading [audio] | ||||||
|  | *       jar_xm (Joshua Reisenauer) for XM audio module loading [audio] | ||||||
|  | *       jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] | ||||||
|  | *       dr_flac (David Reid) for FLAC audio file loading [audio] | ||||||
|  | *       tinfl for data decompression (DEFLATE algorithm) [rres] | ||||||
|  | * | ||||||
|  | * | ||||||
|  | *   LICENSE: zlib/libpng | ||||||
| * | * | ||||||
| *   raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, | *   raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, | ||||||
| *   BSD-like license that allows static linking with closed source software: | *   BSD-like license that allows static linking with closed source software: | ||||||
| * | * | ||||||
| *   Copyright (c) 2013-2016 Ramon Santamaria (@raysan5) | *   Copyright (c) 2013-2017 Ramon Santamaria (@raysan5) | ||||||
| * | * | ||||||
| *   This software is provided "as-is", without any express or implied warranty. In no event | *   This software is provided "as-is", without any express or implied warranty. In no event | ||||||
| *   will the authors be held liable for any damages arising from the use of this software. | *   will the authors be held liable for any damages arising from the use of this software. | ||||||
| @@ -72,7 +72,6 @@ | |||||||
| //#define PLATFORM_ANDROID      // Android device | //#define PLATFORM_ANDROID      // Android device | ||||||
| //#define PLATFORM_RPI          // Raspberry Pi | //#define PLATFORM_RPI          // Raspberry Pi | ||||||
| //#define PLATFORM_WEB          // HTML5 (emscripten, asm.js) | //#define PLATFORM_WEB          // HTML5 (emscripten, asm.js) | ||||||
| //#define RLGL_OCULUS_SUPPORT   // Oculus Rift CV1 (complementary to PLATFORM_DESKTOP) |  | ||||||
|  |  | ||||||
| // Security check in case no PLATFORM_* defined | // Security check in case no PLATFORM_* defined | ||||||
| #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) | #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) | ||||||
| @@ -98,13 +97,13 @@ | |||||||
| #define RAD2DEG (180.0f/PI) | #define RAD2DEG (180.0f/PI) | ||||||
|  |  | ||||||
| // raylib Config Flags | // raylib Config Flags | ||||||
| #define FLAG_FULLSCREEN_MODE    1 | #define FLAG_SHOW_LOGO              1       // Set to show raylib logo at startup | ||||||
| #define FLAG_RESIZABLE_WINDOW   2 | #define FLAG_FULLSCREEN_MODE        2       // Set to run program in fullscreen | ||||||
| #define FLAG_SHOW_LOGO          4 | #define FLAG_WINDOW_RESIZABLE       4       // Set to allow resizable window | ||||||
| #define FLAG_SHOW_MOUSE_CURSOR  8 | #define FLAG_WINDOW_DECORATED       8       // Set to show window decoration (frame and buttons) | ||||||
| #define FLAG_CENTERED_MODE     16 | #define FLAG_WINDOW_TRANSPARENT    16       // Set to allow transparent window | ||||||
| #define FLAG_MSAA_4X_HINT      32 | #define FLAG_MSAA_4X_HINT          32       // Set to try enabling MSAA 4X | ||||||
| #define FLAG_VSYNC_HINT        64 | #define FLAG_VSYNC_HINT            64       // Set to try enabling V-Sync on GPU | ||||||
|  |  | ||||||
| // Keyboard Function Keys | // Keyboard Function Keys | ||||||
| #define KEY_SPACE            32 | #define KEY_SPACE            32 | ||||||
| @@ -293,17 +292,13 @@ | |||||||
| #define RAYWHITE   CLITERAL{ 245, 245, 245, 255 }   // My own White (raylib logo) | #define RAYWHITE   CLITERAL{ 245, 245, 245, 255 }   // My own White (raylib logo) | ||||||
|  |  | ||||||
| //---------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------- | ||||||
| // Types and Structures Definition | // Structures Definition | ||||||
| //---------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------- | ||||||
| #ifndef __cplusplus | #ifndef __cplusplus | ||||||
| // Boolean type | // Boolean type | ||||||
|     #ifndef __APPLE__ |     #if !defined(_STDBOOL_H) | ||||||
|         #if !defined(_STDBOOL_H) |         typedef enum { false, true } bool; | ||||||
|             typedef enum { false, true } bool; |         #define _STDBOOL_H | ||||||
|             #define _STDBOOL_H |  | ||||||
|         #endif |  | ||||||
|     #else |  | ||||||
|         #include <stdbool.h> |  | ||||||
|     #endif |     #endif | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| @@ -354,7 +349,7 @@ typedef struct Image { | |||||||
|     int format;             // Data format (TextureFormat type) |     int format;             // Data format (TextureFormat type) | ||||||
| } Image; | } Image; | ||||||
|  |  | ||||||
| // Texture2D type, bpp always RGBA (32bit) | // Texture2D type | ||||||
| // NOTE: Data stored in GPU memory | // NOTE: Data stored in GPU memory | ||||||
| typedef struct Texture2D { | typedef struct Texture2D { | ||||||
|     unsigned int id;        // OpenGL texture id |     unsigned int id;        // OpenGL texture id | ||||||
| @@ -371,15 +366,21 @@ typedef struct RenderTexture2D { | |||||||
|     Texture2D depth;        // Depth buffer attachment texture |     Texture2D depth;        // Depth buffer attachment texture | ||||||
| } RenderTexture2D; | } RenderTexture2D; | ||||||
|  |  | ||||||
|  | // SpriteFont character info | ||||||
|  | typedef struct CharInfo { | ||||||
|  |     int value;              // Character value (Unicode) | ||||||
|  |     Rectangle rec;          // Character rectangle in sprite font | ||||||
|  |     int offsetX;            // Character offset X when drawing | ||||||
|  |     int offsetY;            // Character offset Y when drawing | ||||||
|  |     int advanceX;           // Character advance position X | ||||||
|  | } CharInfo; | ||||||
|  |  | ||||||
| // SpriteFont type, includes texture and charSet array data | // SpriteFont type, includes texture and charSet array data | ||||||
| typedef struct SpriteFont { | typedef struct SpriteFont { | ||||||
|     Texture2D texture;      // Font texture |     Texture2D texture;      // Font texture | ||||||
|     int size;               // Base size (default chars height) |     int baseSize;           // Base size (default chars height) | ||||||
|     int numChars;           // Number of characters |     int charsCount;         // Number of characters | ||||||
|     int *charValues;        // Characters values array |     CharInfo *chars;        // Characters info data | ||||||
|     Rectangle *charRecs;    // Characters rectangles within the texture |  | ||||||
|     Vector2 *charOffsets;   // Characters offsets (on drawing) |  | ||||||
|     int *charAdvanceX;      // Characters x advance (on drawing) |  | ||||||
| } SpriteFont; | } SpriteFont; | ||||||
|  |  | ||||||
| // Camera type, defines a camera position/orientation in 3d space | // Camera type, defines a camera position/orientation in 3d space | ||||||
| @@ -466,25 +467,6 @@ typedef struct Model { | |||||||
|     Material material;      // Shader and textures data |     Material material;      // Shader and textures data | ||||||
| } Model; | } Model; | ||||||
|  |  | ||||||
| // Light type |  | ||||||
| typedef struct LightData { |  | ||||||
|     unsigned int id;        // Light unique id |  | ||||||
|     bool enabled;           // Light enabled |  | ||||||
|     int type;               // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT |  | ||||||
|  |  | ||||||
|     Vector3 position;       // Light position |  | ||||||
|     Vector3 target;         // Light direction: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) |  | ||||||
|     float radius;           // Light attenuation radius light intensity reduced with distance (world distance) |  | ||||||
|  |  | ||||||
|     Color diffuse;          // Light diffuse color |  | ||||||
|     float intensity;        // Light intensity level |  | ||||||
|  |  | ||||||
|     float coneAngle;        // Light cone max angle: LIGHT_SPOT |  | ||||||
| } LightData, *Light; |  | ||||||
|  |  | ||||||
| // Light types |  | ||||||
| typedef enum { LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT } LightType; |  | ||||||
|  |  | ||||||
| // Ray type (useful for raycast) | // Ray type (useful for raycast) | ||||||
| typedef struct Ray { | typedef struct Ray { | ||||||
|     Vector3 position;       // Ray position (origin) |     Vector3 position;       // Ray position (origin) | ||||||
| @@ -495,8 +477,8 @@ typedef struct Ray { | |||||||
| typedef struct RayHitInfo { | typedef struct RayHitInfo { | ||||||
|     bool hit;               // Did the ray hit something? |     bool hit;               // Did the ray hit something? | ||||||
|     float distance;         // Distance to nearest hit |     float distance;         // Distance to nearest hit | ||||||
|     Vector3 hitPosition;    // Position of nearest hit |     Vector3 position;       // Position of nearest hit | ||||||
|     Vector3 hitNormal;      // Surface normal of hit |     Vector3 normal;         // Surface normal of hit | ||||||
| } RayHitInfo; | } RayHitInfo; | ||||||
|  |  | ||||||
| // Wave type, defines audio wave data | // Wave type, defines audio wave data | ||||||
| @@ -531,6 +513,34 @@ typedef struct AudioStream { | |||||||
|     unsigned int buffers[2];    // OpenAL audio buffers (double buffering) |     unsigned int buffers[2];    // OpenAL audio buffers (double buffering) | ||||||
| } AudioStream; | } AudioStream; | ||||||
|  |  | ||||||
|  | // rRES data returned when reading a resource,  | ||||||
|  | // it contains all required data for user (24 byte) | ||||||
|  | typedef struct RRESData { | ||||||
|  |     unsigned int type;          // Resource type (4 byte) | ||||||
|  |  | ||||||
|  |     unsigned int param1;        // Resouce parameter 1 (4 byte) | ||||||
|  |     unsigned int param2;        // Resouce parameter 2 (4 byte) | ||||||
|  |     unsigned int param3;        // Resouce parameter 3 (4 byte) | ||||||
|  |     unsigned int param4;        // Resouce parameter 4 (4 byte) | ||||||
|  |  | ||||||
|  |     void *data;                 // Resource data pointer (4 byte) | ||||||
|  | } RRESData; | ||||||
|  |  | ||||||
|  | // RRES type (pointer to RRESData array) | ||||||
|  | typedef struct RRESData *RRES; | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------------------------------- | ||||||
|  | // Enumerators Definition | ||||||
|  | //---------------------------------------------------------------------------------- | ||||||
|  | // Trace log type | ||||||
|  | typedef enum {  | ||||||
|  |     INFO = 0, | ||||||
|  |     WARNING,  | ||||||
|  |     ERROR,  | ||||||
|  |     DEBUG,  | ||||||
|  |     OTHER  | ||||||
|  | } LogType; | ||||||
|  |  | ||||||
| // Texture formats | // Texture formats | ||||||
| // NOTE: Support depends on OpenGL version and platform | // NOTE: Support depends on OpenGL version and platform | ||||||
| typedef enum { | typedef enum { | ||||||
| @@ -541,6 +551,7 @@ typedef enum { | |||||||
|     UNCOMPRESSED_R5G5B5A1,          // 16 bpp (1 bit alpha) |     UNCOMPRESSED_R5G5B5A1,          // 16 bpp (1 bit alpha) | ||||||
|     UNCOMPRESSED_R4G4B4A4,          // 16 bpp (4 bit alpha) |     UNCOMPRESSED_R4G4B4A4,          // 16 bpp (4 bit alpha) | ||||||
|     UNCOMPRESSED_R8G8B8A8,          // 32 bpp |     UNCOMPRESSED_R8G8B8A8,          // 32 bpp | ||||||
|  |     UNCOMPRESSED_R32G32B32,         // 32 bit per channel (float) - HDR | ||||||
|     COMPRESSED_DXT1_RGB,            // 4 bpp (no alpha) |     COMPRESSED_DXT1_RGB,            // 4 bpp (no alpha) | ||||||
|     COMPRESSED_DXT1_RGBA,           // 4 bpp (1 bit alpha) |     COMPRESSED_DXT1_RGBA,           // 4 bpp (1 bit alpha) | ||||||
|     COMPRESSED_DXT3_RGBA,           // 8 bpp |     COMPRESSED_DXT3_RGBA,           // 8 bpp | ||||||
| @@ -567,10 +578,18 @@ typedef enum { | |||||||
| } TextureFilterMode; | } TextureFilterMode; | ||||||
|  |  | ||||||
| // Texture parameters: wrap mode | // Texture parameters: wrap mode | ||||||
| typedef enum { WRAP_REPEAT = 0, WRAP_CLAMP, WRAP_MIRROR } TextureWrapMode; | typedef enum {  | ||||||
|  |     WRAP_REPEAT = 0,  | ||||||
|  |     WRAP_CLAMP,  | ||||||
|  |     WRAP_MIRROR  | ||||||
|  | } TextureWrapMode; | ||||||
|  |  | ||||||
| // Color blending modes (pre-defined) | // Color blending modes (pre-defined) | ||||||
| typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode; | typedef enum {  | ||||||
|  |     BLEND_ALPHA = 0,  | ||||||
|  |     BLEND_ADDITIVE,  | ||||||
|  |     BLEND_MULTIPLIED | ||||||
|  | } BlendMode; | ||||||
|  |  | ||||||
| // Gestures type | // Gestures type | ||||||
| // NOTE: It could be used as flags to enable only some gestures | // NOTE: It could be used as flags to enable only some gestures | ||||||
| @@ -610,24 +629,16 @@ typedef enum { | |||||||
|     HMD_FOVE_VR, |     HMD_FOVE_VR, | ||||||
| } VrDevice; | } VrDevice; | ||||||
|  |  | ||||||
| // rRES data returned when reading a resource, it contains all required data for user (24 byte) | // RRESData type | ||||||
| typedef struct { |  | ||||||
|     unsigned int type;          // Resource type (4 byte) |  | ||||||
|      |  | ||||||
|     unsigned int param1;        // Resouce parameter 1 (4 byte) |  | ||||||
|     unsigned int param2;        // Resouce parameter 2 (4 byte) |  | ||||||
|     unsigned int param3;        // Resouce parameter 3 (4 byte) |  | ||||||
|     unsigned int param4;        // Resouce parameter 4 (4 byte) |  | ||||||
|      |  | ||||||
|     void *data;                 // Resource data pointer (4 byte) |  | ||||||
| } RRESData; |  | ||||||
|  |  | ||||||
| typedef enum {  | typedef enum {  | ||||||
|     RRES_RAW = 0,  |     RRES_TYPE_RAW = 0,  | ||||||
|     RRES_IMAGE,  |     RRES_TYPE_IMAGE,  | ||||||
|     RRES_WAVE,  |     RRES_TYPE_WAVE,  | ||||||
|     RRES_VERTEX,  |     RRES_TYPE_VERTEX,  | ||||||
|     RRES_TEXT  |     RRES_TYPE_TEXT, | ||||||
|  |     RRES_TYPE_FONT_IMAGE, | ||||||
|  |     RRES_TYPE_FONT_CHARDATA,    // CharInfo data array | ||||||
|  |     RRES_TYPE_DIRECTORY | ||||||
| } RRESDataType; | } RRESDataType; | ||||||
|  |  | ||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| @@ -643,44 +654,48 @@ extern "C" {            // Prevents name mangling of functions | |||||||
| // Window and Graphics Device Functions (Module: core) | // Window and Graphics Device Functions (Module: core) | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| #if defined(PLATFORM_ANDROID) | #if defined(PLATFORM_ANDROID) | ||||||
| RLAPI void InitWindow(int width, int height, void *state);        // Init Android Activity and OpenGL Graphics (struct android_app) | RLAPI void InitWindow(int width, int height, void *state);        // Initialize Android activity | ||||||
| #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) | #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) | ||||||
| RLAPI void InitWindow(int width, int height, const char *title);  // Initialize Window and OpenGL Graphics | RLAPI void InitWindow(int width, int height, const char *title);  // Initialize window and OpenGL context | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| RLAPI void CloseWindow(void);                                     // Close Window and Terminate Context | RLAPI void CloseWindow(void);                                     // Close window and unload OpenGL context | ||||||
| RLAPI bool WindowShouldClose(void);                               // Detect if KEY_ESCAPE pressed or Close icon pressed | RLAPI bool WindowShouldClose(void);                               // Check if KEY_ESCAPE pressed or Close icon pressed | ||||||
| RLAPI bool IsWindowMinimized(void);                               // Detect if window has been minimized (or lost focus) | RLAPI bool IsWindowMinimized(void);                               // Check if window has been minimized (or lost focus) | ||||||
| RLAPI void ToggleFullscreen(void);                                // Fullscreen toggle (only PLATFORM_DESKTOP) | RLAPI void ToggleFullscreen(void);                                // Toggle fullscreen mode (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowIcon(Image image);                            // Set icon for window (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowPosition(int x, int y);                       // Set window position on screen (only PLATFORM_DESKTOP) | ||||||
|  | RLAPI void SetWindowMonitor(int monitor);                         // Set monitor for the current window (fullscreen mode) | ||||||
|  | RLAPI void SetWindowMinSize(int width, int height);               // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) | ||||||
| RLAPI int GetScreenWidth(void);                                   // Get current screen width | RLAPI int GetScreenWidth(void);                                   // Get current screen width | ||||||
| RLAPI int GetScreenHeight(void);                                  // Get current screen height | RLAPI int GetScreenHeight(void);                                  // Get current screen height | ||||||
|  |  | ||||||
| #if !defined(PLATFORM_ANDROID) | #if !defined(PLATFORM_ANDROID) | ||||||
| RLAPI void ShowCursor(void);                                      // Shows cursor | RLAPI void ShowCursor(void);                                      // Shows cursor | ||||||
| RLAPI void HideCursor(void);                                      // Hides cursor | RLAPI void HideCursor(void);                                      // Hides cursor | ||||||
| RLAPI bool IsCursorHidden(void);                                  // Returns true if cursor is not visible | RLAPI bool IsCursorHidden(void);                                  // Check if cursor is not visible | ||||||
| RLAPI void EnableCursor(void);                                    // Enables cursor | RLAPI void EnableCursor(void);                                    // Enables cursor (unlock cursor) | ||||||
| RLAPI void DisableCursor(void);                                   // Disables cursor | RLAPI void DisableCursor(void);                                   // Disables cursor (lock cursor) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| RLAPI void ClearBackground(Color color);                          // Sets Background Color | RLAPI void ClearBackground(Color color);                          // Set background color (framebuffer clear color) | ||||||
| RLAPI void BeginDrawing(void);                                    // Setup drawing canvas to start drawing | RLAPI void BeginDrawing(void);                                    // Setup canvas (framebuffer) to start drawing | ||||||
| RLAPI void EndDrawing(void);                                      // End canvas drawing and Swap Buffers (Double Buffering) | RLAPI void EndDrawing(void);                                      // End canvas drawing and swap buffers (double buffering) | ||||||
|  |  | ||||||
| RLAPI void Begin2dMode(Camera2D camera);                          // Initialize 2D mode with custom camera | RLAPI void Begin2dMode(Camera2D camera);                          // Initialize 2D mode with custom camera (2D) | ||||||
| RLAPI void End2dMode(void);                                       // Ends 2D mode custom camera usage | RLAPI void End2dMode(void);                                       // Ends 2D mode with custom camera | ||||||
| RLAPI void Begin3dMode(Camera camera);                            // Initializes 3D mode for drawing (Camera setup) | RLAPI void Begin3dMode(Camera camera);                            // Initializes 3D mode with custom camera (3D) | ||||||
| RLAPI void End3dMode(void);                                       // Ends 3D mode and returns to default 2D orthographic mode | RLAPI void End3dMode(void);                                       // Ends 3D mode and returns to default 2D orthographic mode | ||||||
| RLAPI void BeginTextureMode(RenderTexture2D target);              // Initializes render texture for drawing | RLAPI void BeginTextureMode(RenderTexture2D target);              // Initializes render texture for drawing | ||||||
| RLAPI void EndTextureMode(void);                                  // Ends drawing to render texture | RLAPI void EndTextureMode(void);                                  // Ends drawing to render texture | ||||||
|  |  | ||||||
| RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera);      // Returns a ray trace from mouse position | RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera);      // Returns a ray trace from mouse position | ||||||
| RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera);  // Returns the screen space position from a 3d world space position | RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera);  // Returns the screen space position for a 3d world space position | ||||||
| RLAPI Matrix GetCameraMatrix(Camera camera);                      // Returns camera transform matrix (view matrix) | RLAPI Matrix GetCameraMatrix(Camera camera);                      // Returns camera transform matrix (view matrix) | ||||||
|  |  | ||||||
| RLAPI void SetTargetFPS(int fps);                                 // Set target FPS (maximum) | RLAPI void SetTargetFPS(int fps);                                 // Set target FPS (maximum) | ||||||
| RLAPI float GetFPS(void);                                         // Returns current FPS | RLAPI int GetFPS(void);                                           // Returns current FPS | ||||||
| RLAPI float GetFrameTime(void);                                   // Returns time in seconds for one frame | RLAPI float GetFrameTime(void);                                   // Returns time in seconds for last frame drawn | ||||||
|  |  | ||||||
| RLAPI Color GetColor(int hexValue);                               // Returns a Color struct from hexadecimal value | RLAPI Color GetColor(int hexValue);                               // Returns a Color struct from hexadecimal value | ||||||
| RLAPI int GetHexValue(Color color);                               // Returns hexadecimal value for a Color | RLAPI int GetHexValue(Color color);                               // Returns hexadecimal value for a Color | ||||||
| @@ -691,15 +706,21 @@ RLAPI float *MatrixToFloat(Matrix mat);                           // Converts Ma | |||||||
| RLAPI int GetRandomValue(int min, int max);                       // Returns a random value between min and max (both included) | RLAPI int GetRandomValue(int min, int max);                       // Returns a random value between min and max (both included) | ||||||
| RLAPI Color Fade(Color color, float alpha);                       // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f | RLAPI Color Fade(Color color, float alpha);                       // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f | ||||||
|  |  | ||||||
| RLAPI void SetConfigFlags(char flags);                            // Setup some window configuration flags | RLAPI void ShowLogo(void);                                        // Activate raylib logo at startup (can be done with flags) | ||||||
| RLAPI void ShowLogo(void);                                        // Activates raylib logo at startup (can be done with flags) | RLAPI void SetConfigFlags(char flags);                            // Setup window configuration flags (view FLAGS) | ||||||
|  | RLAPI void TraceLog(int logType, const char *text, ...);          // Show trace log messages (INFO, WARNING, ERROR, DEBUG) | ||||||
|  | RLAPI void TakeScreenshot(const char *fileName);                  // Takes a screenshot of current screen (saved a .png) | ||||||
|  |  | ||||||
| RLAPI bool IsFileDropped(void);                                   // Check if a file have been dropped into window | RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension | ||||||
| RLAPI char **GetDroppedFiles(int *count);                         // Retrieve dropped files into window | RLAPI const char *GetDirectoryPath(const char *fileName);         // Get directory for a given fileName (with path) | ||||||
|  | RLAPI const char *GetWorkingDirectory(void);                      // Get current working directory | ||||||
|  | RLAPI bool ChangeDirectory(const char *dir);                      // Change working directory, returns true if success | ||||||
|  | RLAPI bool IsFileDropped(void);                                   // Check if a file has been dropped into window | ||||||
|  | RLAPI char **GetDroppedFiles(int *count);                         // Get dropped files names | ||||||
| RLAPI void ClearDroppedFiles(void);                               // Clear dropped files paths buffer | RLAPI void ClearDroppedFiles(void);                               // Clear dropped files paths buffer | ||||||
|  |  | ||||||
| RLAPI void StorageSaveValue(int position, int value);             // Storage save integer value (to defined position) | RLAPI void StorageSaveValue(int position, int value);             // Save integer value to storage file (to defined position) | ||||||
| RLAPI int StorageLoadValue(int position);                         // Storage load integer value (from defined position) | RLAPI int StorageLoadValue(int position);                         // Load integer value from storage file (from defined position) | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Input Handling Functions (Module: core) | // Input Handling Functions (Module: core) | ||||||
| @@ -769,12 +790,15 @@ RLAPI void DrawPixel(int posX, int posY, Color color); | |||||||
| RLAPI void DrawPixelV(Vector2 position, Color color);                                                    // Draw a pixel (Vector version) | RLAPI void DrawPixelV(Vector2 position, Color color);                                                    // Draw a pixel (Vector version) | ||||||
| RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);                // Draw a line | RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);                // Draw a line | ||||||
| RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);                                     // Draw a line (Vector version) | RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);                                     // Draw a line (Vector version) | ||||||
|  | RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color);                       // Draw a line defining thickness | ||||||
|  | RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color);                   // Draw a line using cubic-bezier curves in-out | ||||||
| RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color);                              // Draw a color-filled circle | RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color);                              // Draw a color-filled circle | ||||||
| RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);       // Draw a gradient-filled circle | RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);       // Draw a gradient-filled circle | ||||||
| RLAPI void DrawCircleV(Vector2 center, float radius, Color color);                                       // Draw a color-filled circle (Vector version) | RLAPI void DrawCircleV(Vector2 center, float radius, Color color);                                       // Draw a color-filled circle (Vector version) | ||||||
| RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color);                         // Draw circle outline | RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color);                         // Draw circle outline | ||||||
| RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color);                        // Draw a color-filled rectangle | RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color);                        // Draw a color-filled rectangle | ||||||
| RLAPI void DrawRectangleRec(Rectangle rec, Color color);                                                 // Draw a color-filled rectangle | RLAPI void DrawRectangleRec(Rectangle rec, Color color);                                                 // Draw a color-filled rectangle | ||||||
|  | RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color);                 // Draw a color-filled rectangle with pro parameters | ||||||
| RLAPI void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle | RLAPI void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle | ||||||
| RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color);                                  // Draw a color-filled rectangle (Vector version) | RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color);                                  // Draw a color-filled rectangle (Vector version) | ||||||
| RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color);                   // Draw rectangle outline | RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color);                   // Draw rectangle outline | ||||||
| @@ -820,7 +844,7 @@ RLAPI Image ImageText(const char *text, int fontSize, Color color); | |||||||
| RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint);     // Create an image from text (custom sprite font) | RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint);     // Create an image from text (custom sprite font) | ||||||
| RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);                         // Draw a source image within a destination image | RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);                         // Draw a source image within a destination image | ||||||
| RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color);     // Draw text (default font) within an image (destination) | RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color);     // Draw text (default font) within an image (destination) | ||||||
| RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text,  | RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, | ||||||
|                            float fontSize, int spacing, Color color);                                    // Draw text (custom sprite font) within an image (destination) |                            float fontSize, int spacing, Color color);                                    // Draw text (custom sprite font) within an image (destination) | ||||||
| RLAPI void ImageFlipVertical(Image *image);                                                              // Flip image vertically | RLAPI void ImageFlipVertical(Image *image);                                                              // Flip image vertically | ||||||
| RLAPI void ImageFlipHorizontal(Image *image);                                                            // Flip image horizontally | RLAPI void ImageFlipHorizontal(Image *image);                                                            // Flip image horizontally | ||||||
| @@ -845,7 +869,7 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle dest | |||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont | RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont | ||||||
| RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load SpriteFont from file into GPU memory (VRAM) | RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load SpriteFont from file into GPU memory (VRAM) | ||||||
| RLAPI SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars);    // Load SpriteFont from TTF font file with generation parameters | RLAPI SpriteFont LoadSpriteFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars);   // Load SpriteFont from file with extended parameters | ||||||
| RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory (VRAM) | RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory (VRAM) | ||||||
|  |  | ||||||
| RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color);                    // Draw text (using default font) | RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color);                    // Draw text (using default font) | ||||||
| @@ -854,7 +878,7 @@ RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, | |||||||
| RLAPI int MeasureText(const char *text, int fontSize);                                                   // Measure string width for default font | RLAPI int MeasureText(const char *text, int fontSize);                                                   // Measure string width for default font | ||||||
| RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing);       // Measure string size for SpriteFont | RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing);       // Measure string size for SpriteFont | ||||||
|  |  | ||||||
| RLAPI void DrawFPS(int posX, int posY);                                                                  // Shows current FPS on top-left corner | RLAPI void DrawFPS(int posX, int posY);                                                                  // Shows current FPS | ||||||
| RLAPI const char *FormatText(const char *text, ...);                                                     // Formatting of text with variables to 'embed' | RLAPI const char *FormatText(const char *text, ...);                                                     // Formatting of text with variables to 'embed' | ||||||
| RLAPI const char *SubText(const char *text, int position, int length);                                   // Get a piece of a text string | RLAPI const char *SubText(const char *text, int position, int length);                                   // Get a piece of a text string | ||||||
|  |  | ||||||
| @@ -876,7 +900,6 @@ RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); | |||||||
| RLAPI void DrawRay(Ray ray, Color color);                                                                // Draw a ray line | RLAPI void DrawRay(Ray ray, Color color);                                                                // Draw a ray line | ||||||
| RLAPI void DrawGrid(int slices, float spacing);                                                          // Draw a grid (centered at (0, 0, 0)) | RLAPI void DrawGrid(int slices, float spacing);                                                          // Draw a grid (centered at (0, 0, 0)) | ||||||
| RLAPI void DrawGizmo(Vector3 position);                                                                  // Draw simple gizmo | RLAPI void DrawGizmo(Vector3 position);                                                                  // Draw simple gizmo | ||||||
| RLAPI void DrawLight(Light light);                                                                       // Draw light in 3D world |  | ||||||
| //DrawTorus(), DrawTeapot() could be useful? | //DrawTorus(), DrawTeapot() could be useful? | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| @@ -892,21 +915,19 @@ RLAPI void UnloadMesh(Mesh *mesh); | |||||||
| RLAPI void UnloadModel(Model model);                                                                    // Unload model from memory (RAM and/or VRAM) | RLAPI void UnloadModel(Model model);                                                                    // Unload model from memory (RAM and/or VRAM) | ||||||
|  |  | ||||||
| RLAPI Material LoadMaterial(const char *fileName);                                                      // Load material from file | RLAPI Material LoadMaterial(const char *fileName);                                                      // Load material from file | ||||||
| RLAPI Material LoadMaterialEx(Shader shader, Texture2D diffuse, Color color);                           // Load material from basic shading data |  | ||||||
| RLAPI Material LoadDefaultMaterial(void);                                                               // Load default material (uses default models shader) | RLAPI Material LoadDefaultMaterial(void);                                                               // Load default material (uses default models shader) | ||||||
| RLAPI Material LoadStandardMaterial(void);                                                              // Load standard material (uses material attributes and lighting shader) |  | ||||||
| RLAPI void UnloadMaterial(Material material);                                                           // Unload material from GPU memory (VRAM) | RLAPI void UnloadMaterial(Material material);                                                           // Unload material from GPU memory (VRAM) | ||||||
|  |  | ||||||
| RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint);                           // Draw a model (with texture if set) | RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint);                           // Draw a model (with texture if set) | ||||||
| RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis,  | RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, | ||||||
|                        float rotationAngle, Vector3 scale, Color tint);                                 // Draw a model with extended parameters |                        float rotationAngle, Vector3 scale, Color tint);                                 // Draw a model with extended parameters | ||||||
| RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint);                      // Draw a model wires (with texture if set) | RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint);                      // Draw a model wires (with texture if set) | ||||||
| RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis,  | 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 |                             float rotationAngle, Vector3 scale, Color tint);                            // Draw a model wires (with texture if set) with extended parameters | ||||||
| RLAPI void DrawBoundingBox(BoundingBox box, Color color);                                               // Draw bounding box (wires) | RLAPI void DrawBoundingBox(BoundingBox box, Color color);                                               // Draw bounding box (wires) | ||||||
|  |  | ||||||
| RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);     // Draw a billboard texture | RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);     // Draw a billboard texture | ||||||
| RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec,  | RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, | ||||||
|                             Vector3 center, float size, Color tint);                                    // Draw a billboard texture defined by sourceRec |                             Vector3 center, float size, Color tint);                                    // Draw a billboard texture defined by sourceRec | ||||||
|  |  | ||||||
| RLAPI BoundingBox CalculateBoundingBox(Mesh mesh);                                                      // Calculate mesh bounding box limits | RLAPI BoundingBox CalculateBoundingBox(Mesh mesh);                                                      // Calculate mesh bounding box limits | ||||||
| @@ -914,7 +935,7 @@ RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB | |||||||
| RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);                                     // Detect collision between two bounding boxes | RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);                                     // Detect collision between two bounding boxes | ||||||
| RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere);          // Detect collision between box and sphere | RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere);          // Detect collision between box and sphere | ||||||
| RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius);                // Detect collision between ray and sphere | RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius);                // Detect collision between ray and sphere | ||||||
| RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius,  | RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, | ||||||
|                                      Vector3 *collisionPoint);                                          // Detect collision between ray and sphere, returns collision point |                                      Vector3 *collisionPoint);                                          // Detect collision between ray and sphere, returns collision point | ||||||
| RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box);                                              // Detect collision between ray and box | RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box);                                              // Detect collision between ray and box | ||||||
| RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh);                                              // Get collision info between ray and mesh | RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh);                                              // Get collision info between ray and mesh | ||||||
| @@ -930,7 +951,6 @@ RLAPI Shader LoadShader(char *vsFileName, char *fsFileName);              // Loa | |||||||
| RLAPI void UnloadShader(Shader shader);                                   // Unload shader from GPU memory (VRAM) | RLAPI void UnloadShader(Shader shader);                                   // Unload shader from GPU memory (VRAM) | ||||||
|  |  | ||||||
| RLAPI Shader GetDefaultShader(void);                                      // Get default shader | RLAPI Shader GetDefaultShader(void);                                      // Get default shader | ||||||
| RLAPI Shader GetStandardShader(void);                                     // Get standard shader |  | ||||||
| RLAPI Texture2D GetDefaultTexture(void);                                  // Get default texture | RLAPI Texture2D GetDefaultTexture(void);                                  // Get default texture | ||||||
|  |  | ||||||
| RLAPI int GetShaderLocation(Shader shader, const char *uniformName);              // Get shader uniform location | RLAPI int GetShaderLocation(Shader shader, const char *uniformName);              // Get shader uniform location | ||||||
| @@ -946,19 +966,17 @@ RLAPI void EndShaderMode(void);                                           // End | |||||||
| RLAPI void BeginBlendMode(int mode);                                      // Begin blending mode (alpha, additive, multiplied) | RLAPI void BeginBlendMode(int mode);                                      // Begin blending mode (alpha, additive, multiplied) | ||||||
| RLAPI void EndBlendMode(void);                                            // End blending mode (reset to default: alpha blending) | RLAPI void EndBlendMode(void);                                            // End blending mode (reset to default: alpha blending) | ||||||
|  |  | ||||||
| RLAPI Light CreateLight(int type, Vector3 position, Color diffuse);       // Create a new light, initialize it and add to pool |  | ||||||
| RLAPI void DestroyLight(Light light);                                     // Destroy a light and take it out of the list |  | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // VR experience Functions (Module: rlgl) | // VR experience Functions (Module: rlgl) | ||||||
| // NOTE: This functions are useless when using OpenGL 1.1 | // NOTE: This functions are useless when using OpenGL 1.1 | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| RLAPI void InitVrDevice(int vdDevice);            // Init VR device | RLAPI void InitVrSimulator(int vrDevice);           // Init VR simulator for selected device | ||||||
| RLAPI void CloseVrDevice(void);                   // Close VR device | RLAPI void CloseVrSimulator(void);                  // Close VR simulator for current device | ||||||
| RLAPI bool IsVrDeviceReady(void);                 // Detect if VR device is ready | RLAPI bool IsVrSimulatorReady(void);                // Detect if VR device is ready | ||||||
| RLAPI bool IsVrSimulator(void);                   // Detect if VR simulator is running | RLAPI void UpdateVrTracking(Camera *camera);        // Update VR tracking (position and orientation) and camera | ||||||
| RLAPI void UpdateVrTracking(Camera *camera);      // Update VR tracking (position and orientation) and camera | RLAPI void ToggleVrMode(void);                      // Enable/Disable VR experience (device or simulator) | ||||||
| RLAPI void ToggleVrMode(void);                    // Enable/Disable VR experience (device or simulator) | RLAPI void BeginVrDrawing(void);                    // Begin VR simulator stereo rendering | ||||||
|  | RLAPI void EndVrDrawing(void);                      // End VR simulator stereo rendering | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||||
| // Audio Loading and Playing Functions (Module: audio) | // Audio Loading and Playing Functions (Module: audio) | ||||||
| @@ -966,12 +984,13 @@ RLAPI void ToggleVrMode(void);                    // Enable/Disable VR experienc | |||||||
| RLAPI void InitAudioDevice(void);                                     // Initialize audio device and context | RLAPI void InitAudioDevice(void);                                     // Initialize audio device and context | ||||||
| RLAPI void CloseAudioDevice(void);                                    // Close the audio device and context | RLAPI void CloseAudioDevice(void);                                    // Close the audio device and context | ||||||
| RLAPI bool IsAudioDeviceReady(void);                                  // Check if audio device has been initialized successfully | RLAPI bool IsAudioDeviceReady(void);                                  // Check if audio device has been initialized successfully | ||||||
|  | RLAPI void SetMasterVolume(float volume);                             // Set master volume (listener) | ||||||
|  |  | ||||||
| RLAPI Wave LoadWave(const char *fileName);                            // Load wave data from file | RLAPI Wave LoadWave(const char *fileName);                            // Load wave data from file | ||||||
| RLAPI Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data | RLAPI Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data | ||||||
| RLAPI Sound LoadSound(const char *fileName);                          // Load sound from file | RLAPI Sound LoadSound(const char *fileName);                          // Load sound from file | ||||||
| RLAPI Sound LoadSoundFromWave(Wave wave);                             // Load sound from wave data | RLAPI Sound LoadSoundFromWave(Wave wave);                             // Load sound from wave data | ||||||
| RLAPI void UpdateSound(Sound sound, const void *data, int numSamples);// Update sound buffer with new data | RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data | ||||||
| RLAPI void UnloadWave(Wave wave);                                     // Unload wave data | RLAPI void UnloadWave(Wave wave);                                     // Unload wave data | ||||||
| RLAPI void UnloadSound(Sound sound);                                  // Unload sound | RLAPI void UnloadSound(Sound sound);                                  // Unload sound | ||||||
| RLAPI void PlaySound(Sound sound);                                    // Play a sound | RLAPI void PlaySound(Sound sound);                                    // Play a sound | ||||||
| @@ -995,13 +1014,14 @@ RLAPI void ResumeMusicStream(Music music);                            // Resume | |||||||
| RLAPI bool IsMusicPlaying(Music music);                               // Check if music is playing | RLAPI bool IsMusicPlaying(Music music);                               // Check if music is playing | ||||||
| RLAPI void SetMusicVolume(Music music, float volume);                 // Set volume for music (1.0 is max level) | RLAPI void SetMusicVolume(Music music, float volume);                 // Set volume for music (1.0 is max level) | ||||||
| RLAPI void SetMusicPitch(Music music, float pitch);                   // Set pitch for a music (1.0 is base level) | RLAPI void SetMusicPitch(Music music, float pitch);                   // Set pitch for a music (1.0 is base level) | ||||||
|  | RLAPI void SetMusicLoopCount(Music music, float count);               // Set music loop count (loop repeats) | ||||||
| RLAPI float GetMusicTimeLength(Music music);                          // Get music time length (in seconds) | RLAPI float GetMusicTimeLength(Music music);                          // Get music time length (in seconds) | ||||||
| RLAPI float GetMusicTimePlayed(Music music);                          // Get current music time played (in seconds) | RLAPI float GetMusicTimePlayed(Music music);                          // Get current music time played (in seconds) | ||||||
|  |  | ||||||
| RLAPI AudioStream InitAudioStream(unsigned int sampleRate, | RLAPI AudioStream InitAudioStream(unsigned int sampleRate, | ||||||
|                                   unsigned int sampleSize, |                                   unsigned int sampleSize, | ||||||
|                                   unsigned int channels);             // Init audio stream (to stream raw audio pcm data) |                                   unsigned int channels);             // Init audio stream (to stream raw audio pcm data) | ||||||
| RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int numSamples); // Update audio stream buffers with data | RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data | ||||||
| RLAPI void CloseAudioStream(AudioStream stream);                      // Close audio stream and free memory | RLAPI void CloseAudioStream(AudioStream stream);                      // Close audio stream and free memory | ||||||
| RLAPI bool IsAudioBufferProcessed(AudioStream stream);                // Check if any audio stream buffers requires refill | RLAPI bool IsAudioBufferProcessed(AudioStream stream);                // Check if any audio stream buffers requires refill | ||||||
| RLAPI void PlayAudioStream(AudioStream stream);                       // Play audio stream | RLAPI void PlayAudioStream(AudioStream stream);                       // Play audio stream | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Ray
					Ray