update raylib and deps
This commit is contained in:
parent
fd64d4172a
commit
3fcffd9168
31 changed files with 43817 additions and 12586 deletions
|
@ -99,8 +99,6 @@
|
|||
#define DEG2RAD (PI/180.0f)
|
||||
#define RAD2DEG (180.0f/PI)
|
||||
|
||||
#define MAX_TOUCH_POINTS 10 // Maximum number of touch points supported
|
||||
|
||||
// Allow custom memory allocators
|
||||
#ifndef RL_MALLOC
|
||||
#define RL_MALLOC(sz) malloc(sz)
|
||||
|
@ -159,6 +157,7 @@
|
|||
#define SubText TextSubtext
|
||||
#define ShowWindow UnhideWindow
|
||||
#define LoadText LoadFileText
|
||||
//#define Fade(c, a) ColorAlpha(c, a)
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Structures Definition
|
||||
|
@ -442,8 +441,8 @@ typedef struct Music {
|
|||
int ctxType; // Type of music context (audio filetype)
|
||||
void *ctxData; // Audio context data, depends on type
|
||||
|
||||
bool looping; // Music looping enable
|
||||
unsigned int sampleCount; // Total number of samples
|
||||
unsigned int loopCount; // Loops count (times music will play), 0 means infinite loop
|
||||
|
||||
AudioStream stream; // Audio stream
|
||||
} Music;
|
||||
|
@ -665,20 +664,17 @@ typedef enum {
|
|||
} GamepadButton;
|
||||
|
||||
typedef enum {
|
||||
// This is here just for error checking
|
||||
GAMEPAD_AXIS_UNKNOWN = 0,
|
||||
|
||||
// Left stick
|
||||
GAMEPAD_AXIS_LEFT_X,
|
||||
GAMEPAD_AXIS_LEFT_Y,
|
||||
GAMEPAD_AXIS_LEFT_X = 0,
|
||||
GAMEPAD_AXIS_LEFT_Y = 1,
|
||||
|
||||
// Right stick
|
||||
GAMEPAD_AXIS_RIGHT_X,
|
||||
GAMEPAD_AXIS_RIGHT_Y,
|
||||
GAMEPAD_AXIS_RIGHT_X = 2,
|
||||
GAMEPAD_AXIS_RIGHT_Y = 3,
|
||||
|
||||
// Pressure levels for the back triggers
|
||||
GAMEPAD_AXIS_LEFT_TRIGGER, // [1..-1] (pressure-level)
|
||||
GAMEPAD_AXIS_RIGHT_TRIGGER // [1..-1] (pressure-level)
|
||||
GAMEPAD_AXIS_LEFT_TRIGGER = 4, // [1..-1] (pressure-level)
|
||||
GAMEPAD_AXIS_RIGHT_TRIGGER = 5 // [1..-1] (pressure-level)
|
||||
} GamepadAxis;
|
||||
|
||||
// Shader location point type
|
||||
|
@ -811,7 +807,10 @@ typedef enum {
|
|||
typedef enum {
|
||||
BLEND_ALPHA = 0, // Blend textures considering alpha (default)
|
||||
BLEND_ADDITIVE, // Blend textures adding colors
|
||||
BLEND_MULTIPLIED // Blend textures multiplying colors
|
||||
BLEND_MULTIPLIED, // Blend textures multiplying colors
|
||||
BLEND_ADD_COLORS, // Blend textures adding colors (alternative)
|
||||
BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative)
|
||||
BLEND_CUSTOM // Belnd textures using custom src/dst factors (use SetBlendModeCustom())
|
||||
} BlendMode;
|
||||
|
||||
// Gestures type
|
||||
|
@ -873,13 +872,19 @@ RLAPI void InitWindow(int width, int height, const char *title); // Initialize
|
|||
RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed
|
||||
RLAPI void CloseWindow(void); // Close window and unload OpenGL context
|
||||
RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully
|
||||
RLAPI bool IsWindowMinimized(void); // Check if window has been minimized (or lost focus)
|
||||
RLAPI bool IsWindowMinimized(void); // Check if window has been minimized
|
||||
RLAPI bool IsWindowMaximized(void); // Check if window has been maximized (only PLATFORM_DESKTOP)
|
||||
RLAPI bool IsWindowFocused(void); // Check if window has been focused
|
||||
RLAPI bool IsWindowResized(void); // Check if window has been resized
|
||||
RLAPI bool IsWindowHidden(void); // Check if window is currently hidden
|
||||
RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen
|
||||
RLAPI void ToggleFullscreen(void); // Toggle fullscreen mode (only PLATFORM_DESKTOP)
|
||||
RLAPI void UnhideWindow(void); // Show the window
|
||||
RLAPI void HideWindow(void); // Hide the window
|
||||
RLAPI void DecorateWindow(void); // Decorate the window (only PLATFORM_DESKTOP)
|
||||
RLAPI void UndecorateWindow(void); // Undecorate the window (only PLATFORM_DESKTOP)
|
||||
RLAPI void MaximizeWindow(void); // Maximize the window, if resizable (only PLATFORM_DESKTOP)
|
||||
RLAPI void RestoreWindow(void); // Restore the window, if resizable (only PLATFORM_DESKTOP)
|
||||
RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP)
|
||||
RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP)
|
||||
RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP)
|
||||
|
@ -894,7 +899,9 @@ RLAPI int GetMonitorWidth(int monitor); // Get primary
|
|||
RLAPI int GetMonitorHeight(int monitor); // Get primary monitor height
|
||||
RLAPI int GetMonitorPhysicalWidth(int monitor); // Get primary monitor physical width in millimetres
|
||||
RLAPI int GetMonitorPhysicalHeight(int monitor); // Get primary monitor physical height in millimetres
|
||||
RLAPI int GetMonitorRefreshRate(int monitor); // Get primary monitor refresh rate
|
||||
RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor
|
||||
RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor
|
||||
RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
|
||||
RLAPI const char *GetClipboardText(void); // Get clipboard text content
|
||||
RLAPI void SetClipboardText(const char *text); // Set clipboard text content
|
||||
|
@ -905,6 +912,7 @@ RLAPI void HideCursor(void); // Hides curso
|
|||
RLAPI bool IsCursorHidden(void); // Check if cursor is not visible
|
||||
RLAPI void EnableCursor(void); // Enables cursor (unlock cursor)
|
||||
RLAPI void DisableCursor(void); // Disables cursor (lock cursor)
|
||||
RLAPI bool IsCursorOnScreen(void); // Check if cursor is on the current screen.
|
||||
|
||||
// Drawing-related functions
|
||||
RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color)
|
||||
|
@ -934,15 +942,6 @@ RLAPI int GetFPS(void); // Returns cur
|
|||
RLAPI float GetFrameTime(void); // Returns time in seconds for last frame drawn
|
||||
RLAPI double GetTime(void); // Returns elapsed time in seconds since InitWindow()
|
||||
|
||||
// Color-related functions
|
||||
RLAPI int ColorToInt(Color color); // Returns hexadecimal value for a Color
|
||||
RLAPI Vector4 ColorNormalize(Color color); // Returns color normalized as float [0..1]
|
||||
RLAPI Color ColorFromNormalized(Vector4 normalized); // Returns color from normalized values [0..1]
|
||||
RLAPI Vector3 ColorToHSV(Color color); // Returns HSV values for a Color
|
||||
RLAPI Color ColorFromHSV(Vector3 hsv); // Returns a Color from HSV values
|
||||
RLAPI Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value
|
||||
RLAPI Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f
|
||||
|
||||
// Misc. functions
|
||||
RLAPI void SetConfigFlags(unsigned int flags); // Setup window configuration flags (view FLAGS)
|
||||
RLAPI void SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level
|
||||
|
@ -1105,14 +1104,11 @@ RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Ve
|
|||
// Image loading functions
|
||||
// NOTE: This functions do not require GPU access
|
||||
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 from Color array data (RGBA - 32bit)
|
||||
RLAPI Image LoadImagePro(void *data, int width, int height, int format); // Load image from raw data with parameters
|
||||
RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data
|
||||
RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data)
|
||||
RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM)
|
||||
RLAPI void ExportImage(Image image, const char *fileName); // Export image data to file
|
||||
RLAPI void ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes
|
||||
RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array
|
||||
RLAPI Vector4 *GetImageDataNormalized(Image image); // Get pixel data from image as Vector4 array (float normalized)
|
||||
|
||||
// Image generation functions
|
||||
RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color
|
||||
|
@ -1129,16 +1125,16 @@ RLAPI Image ImageCopy(Image image);
|
|||
RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece
|
||||
RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font)
|
||||
RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font)
|
||||
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 ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image
|
||||
RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color
|
||||
RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value
|
||||
RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
|
||||
RLAPI void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two)
|
||||
RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle
|
||||
RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value
|
||||
RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color
|
||||
RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image
|
||||
RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
|
||||
RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm)
|
||||
RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
|
||||
RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color); // Resize canvas and fill with color
|
||||
RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color
|
||||
RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image
|
||||
RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
|
||||
RLAPI void ImageFlipVertical(Image *image); // Flip image vertically
|
||||
|
@ -1151,7 +1147,10 @@ RLAPI void ImageColorGrayscale(Image *image);
|
|||
RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100)
|
||||
RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255)
|
||||
RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color
|
||||
RLAPI Color *ImageExtractPalette(Image image, int maxPaletteSize, int *extractCount); // Extract color palette from image to maximum size (memory should be freed)
|
||||
|
||||
RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array
|
||||
RLAPI Color *GetImagePalette(Image image, int maxPaletteSize, int *extractCount); // Get color palette from image to maximum size (memory should be freed)
|
||||
RLAPI Vector4 *GetImageDataNormalized(Image image); // Get pixel data from image as Vector4 array (float normalized)
|
||||
RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle
|
||||
|
||||
// Image drawing functions
|
||||
|
@ -1168,8 +1167,8 @@ RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color
|
|||
RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image
|
||||
RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image
|
||||
RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source)
|
||||
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, Font font, const char *text, float fontSize, float spacing, Color color); // Draw text (custom sprite font) within an image (destination)
|
||||
RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination)
|
||||
RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination)
|
||||
|
||||
// Texture loading functions
|
||||
// NOTE: These functions require GPU access
|
||||
|
@ -1180,6 +1179,7 @@ RLAPI RenderTexture2D LoadRenderTexture(int width, int height);
|
|||
RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM)
|
||||
RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM)
|
||||
RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data
|
||||
RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data
|
||||
RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image
|
||||
RLAPI Image GetScreenData(void); // Get pixel data from screen buffer and return an Image (screenshot)
|
||||
|
||||
|
@ -1194,11 +1194,23 @@ RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint);
|
|||
RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
|
||||
RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
|
||||
RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters
|
||||
RLAPI void DrawTextureTiled(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into destRec.
|
||||
RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters
|
||||
RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely
|
||||
|
||||
// Image/Texture misc functions
|
||||
RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture)
|
||||
// Color/pixel related functions
|
||||
RLAPI Color Fade(Color color, float alpha); // Returns color with alpha applied, alpha goes from 0.0f to 1.0f
|
||||
RLAPI int ColorToInt(Color color); // Returns hexadecimal value for a Color
|
||||
RLAPI Vector4 ColorNormalize(Color color); // Returns Color normalized as float [0..1]
|
||||
RLAPI Color ColorFromNormalized(Vector4 normalized); // Returns Color from normalized values [0..1]
|
||||
RLAPI Vector3 ColorToHSV(Color color); // Returns HSV values for a Color
|
||||
RLAPI Color ColorFromHSV(Vector3 hsv); // Returns a Color from HSV values
|
||||
RLAPI Color ColorAlpha(Color color, float alpha); // Returns color with alpha applied, alpha goes from 0.0f to 1.0f
|
||||
RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Returns src alpha-blended into dst color with tint
|
||||
RLAPI Color GetColor(int hexValue); // Get Color structure from hexadecimal value
|
||||
RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format
|
||||
RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer
|
||||
RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Font Loading and Text Drawing Functions (Module: text)
|
||||
|
@ -1260,6 +1272,8 @@ RLAPI const char *CodepointToUtf8(int codepoint, int *byteLength); // Encode
|
|||
RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space
|
||||
RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line
|
||||
RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space
|
||||
RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!)
|
||||
RLAPI void DrawTriangleStrip3D(Vector3 *points, int pointsCount, Color color); // Draw a triangle strip defined by points
|
||||
RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube
|
||||
RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version)
|
||||
RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires
|
||||
|
@ -1274,7 +1288,6 @@ RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color);
|
|||
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 DrawGizmo(Vector3 position); // Draw simple gizmo
|
||||
//DrawTorus(), DrawTeapot() could be useful?
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Model 3d Loading and Drawing Functions (Module: models)
|
||||
|
@ -1319,6 +1332,7 @@ RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize);
|
|||
RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits
|
||||
RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents
|
||||
RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals
|
||||
RLAPI void MeshNormalsSmooth(Mesh *mesh); // Smooth (average) vertex normals
|
||||
|
||||
// Model drawing functions
|
||||
RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set)
|
||||
|
@ -1437,7 +1451,6 @@ RLAPI void ResumeMusicStream(Music music); // Resume
|
|||
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 SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
|
||||
RLAPI void SetMusicLoopCount(Music music, int count); // Set music loop count (loop repeats)
|
||||
RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds)
|
||||
RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue