Update C sources, add new functions and rename package to
This commit is contained in:
parent
391c25482d
commit
08aa518a46
156 changed files with 34542 additions and 19573 deletions
180
raylib/raylib.h
180
raylib/raylib.h
|
@ -1,8 +1,10 @@
|
|||
/**********************************************************************************************
|
||||
*
|
||||
* raylib - A simple and easy-to-use library to learn videogames programming (www.raylib.com)
|
||||
* raylib - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com)
|
||||
*
|
||||
* FEATURES:
|
||||
* - NO external dependencies, all required libraries included with raylib
|
||||
* - Multiple platforms support: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, MacOS, UWP, Android, Raspberry Pi, HTML5.
|
||||
* - Written in plain C code (C99) in PascalCase/camelCase notation
|
||||
* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2 - choose at compile)
|
||||
* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl]
|
||||
|
@ -12,10 +14,8 @@
|
|||
* - Flexible Materials system, supporting classic maps and PBR maps
|
||||
* - Shaders support, including Model shaders and Postprocessing shaders
|
||||
* - Powerful math module for Vector, Matrix and Quaternion operations: [raymath]
|
||||
* - Audio loading and playing with streaming support (WAV, OGG, FLAC, XM, MOD)
|
||||
* - Multiple platforms support: Windows, Linux, FreeBSD, MacOS, UWP, Android, Raspberry Pi, HTML5.
|
||||
* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD)
|
||||
* - VR stereo rendering with configurable HMD device parameters
|
||||
* - NO external dependencies, all required libraries included with raylib
|
||||
* - Complete bindings to LUA (raylib-lua) and Go (raylib-go)
|
||||
*
|
||||
* NOTES:
|
||||
|
@ -33,14 +33,15 @@
|
|||
* stb_image_resize (Sean Barret) for image resizing algorythms [textures]
|
||||
* stb_image_write (Sean Barret) for image writting (PNG) [utils]
|
||||
* stb_truetype (Sean Barret) for ttf fonts loading [text]
|
||||
* stb_rect_pack (Sean Barret) for rectangles packing [text]
|
||||
* stb_vorbis (Sean Barret) for OGG audio loading [audio]
|
||||
* stb_perlin (Sean Barret) for Perlin noise image generation [textures]
|
||||
* par_shapes (Philip Rideout) for parametric 3d shapes generation [models]
|
||||
* 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]
|
||||
* dr_mp3 (David Reid) for MP3 audio file loading [audio]
|
||||
* rgif (Charlie Tangora, Ramon Santamaria) for GIF recording [core]
|
||||
* tinfl for data decompression (DEFLATE algorithm) [rres]
|
||||
*
|
||||
*
|
||||
* LICENSE: zlib/libpng
|
||||
|
@ -70,6 +71,8 @@
|
|||
#ifndef RAYLIB_H
|
||||
#define RAYLIB_H
|
||||
|
||||
#include <stdarg.h> // Required for: va_list - Only used by TraceLogCallback
|
||||
|
||||
#if defined(_WIN32) && defined(BUILD_LIBTYPE_SHARED)
|
||||
#define RLAPI __declspec(dllexport) // We are building raylib as a Win32 shared library (.dll)
|
||||
#elif defined(_WIN32) && defined(USE_LIBTYPE_SHARED)
|
||||
|
@ -92,7 +95,7 @@
|
|||
#define FLAG_SHOW_LOGO 1 // Set to show raylib logo at startup
|
||||
#define FLAG_FULLSCREEN_MODE 2 // Set to run program in fullscreen
|
||||
#define FLAG_WINDOW_RESIZABLE 4 // Set to allow resizable window
|
||||
#define FLAG_WINDOW_DECORATED 8 // Set to show window decoration (frame and buttons)
|
||||
#define FLAG_WINDOW_UNDECORATED 8 // Set to disable window decoration (frame and buttons)
|
||||
#define FLAG_WINDOW_TRANSPARENT 16 // Set to allow transparent window
|
||||
#define FLAG_MSAA_4X_HINT 32 // Set to try enabling MSAA 4X
|
||||
#define FLAG_VSYNC_HINT 64 // Set to try enabling V-Sync on GPU
|
||||
|
@ -270,6 +273,24 @@
|
|||
#define GAMEPAD_XBOX_BUTTON_LEFT 13
|
||||
#define GAMEPAD_XBOX_BUTTON_HOME 8
|
||||
|
||||
// Android Gamepad Controller (SNES CLASSIC)
|
||||
#define GAMEPAD_ANDROID_DPAD_UP 19
|
||||
#define GAMEPAD_ANDROID_DPAD_DOWN 20
|
||||
#define GAMEPAD_ANDROID_DPAD_LEFT 21
|
||||
#define GAMEPAD_ANDROID_DPAD_RIGHT 22
|
||||
#define GAMEPAD_ANDROID_DPAD_CENTER 23
|
||||
|
||||
#define GAMEPAD_ANDROID_BUTTON_A 96
|
||||
#define GAMEPAD_ANDROID_BUTTON_B 97
|
||||
#define GAMEPAD_ANDROID_BUTTON_C 98
|
||||
#define GAMEPAD_ANDROID_BUTTON_X 99
|
||||
#define GAMEPAD_ANDROID_BUTTON_Y 100
|
||||
#define GAMEPAD_ANDROID_BUTTON_Z 101
|
||||
#define GAMEPAD_ANDROID_BUTTON_L1 102
|
||||
#define GAMEPAD_ANDROID_BUTTON_R1 103
|
||||
#define GAMEPAD_ANDROID_BUTTON_L2 104
|
||||
#define GAMEPAD_ANDROID_BUTTON_R2 105
|
||||
|
||||
// Xbox360 USB Controller Axis
|
||||
// NOTE: For Raspberry Pi, axis must be reconfigured
|
||||
#if defined(PLATFORM_RPI)
|
||||
|
@ -333,11 +354,9 @@
|
|||
//----------------------------------------------------------------------------------
|
||||
// Structures Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
#ifndef __cplusplus
|
||||
// Boolean type
|
||||
#ifndef bool
|
||||
typedef enum { false, true } bool;
|
||||
#endif
|
||||
#if !defined(__cplusplus) && !defined(bool)
|
||||
typedef enum { false, true } bool;
|
||||
#endif
|
||||
|
||||
// Vector2 type
|
||||
|
@ -361,6 +380,9 @@ typedef struct Vector4 {
|
|||
float w;
|
||||
} Vector4;
|
||||
|
||||
// Quaternion type, same as Vector4
|
||||
typedef Vector4 Quaternion;
|
||||
|
||||
// Matrix type (OpenGL style 4x4 - right handed, column major)
|
||||
typedef struct Matrix {
|
||||
float m0, m4, m8, m12;
|
||||
|
@ -405,6 +427,9 @@ typedef struct Texture2D {
|
|||
int format; // Data format (PixelFormat type)
|
||||
} Texture2D;
|
||||
|
||||
// Texture type, same as Texture2D
|
||||
typedef Texture2D Texture;
|
||||
|
||||
// RenderTexture2D type, for texture rendering
|
||||
typedef struct RenderTexture2D {
|
||||
unsigned int id; // OpenGL Framebuffer Object (FBO) id
|
||||
|
@ -412,6 +437,19 @@ typedef struct RenderTexture2D {
|
|||
Texture2D depth; // Depth buffer attachment texture
|
||||
} RenderTexture2D;
|
||||
|
||||
// RenderTexture type, same as RenderTexture2D
|
||||
typedef RenderTexture2D RenderTexture;
|
||||
|
||||
// N-Patch layout info
|
||||
typedef struct NPatchInfo {
|
||||
Rectangle sourceRec; // Region in the texture
|
||||
int left; // left border offset
|
||||
int top; // top border offset
|
||||
int right; // right border offset
|
||||
int bottom; // bottom border offset
|
||||
int type; // layout of the n-patch: 3x3, 1x3 or 3x1
|
||||
} NPatchInfo;
|
||||
|
||||
// Font character info
|
||||
typedef struct CharInfo {
|
||||
int value; // Character value (Unicode)
|
||||
|
@ -419,6 +457,7 @@ typedef struct CharInfo {
|
|||
int offsetX; // Character offset X when drawing
|
||||
int offsetY; // Character offset Y when drawing
|
||||
int advanceX; // Character advance position X
|
||||
unsigned char *data; // Character pixel data (grayscale)
|
||||
} CharInfo;
|
||||
|
||||
// Font type, includes texture and charSet array data
|
||||
|
@ -429,7 +468,7 @@ typedef struct Font {
|
|||
CharInfo *chars; // Characters info data
|
||||
} Font;
|
||||
|
||||
#define SpriteFont Font // SpriteFont type fallback, defaults to Font
|
||||
#define SpriteFont Font // SpriteFont type fallback, defaults to Font
|
||||
|
||||
// Camera type, defines a camera position/orientation in 3d space
|
||||
typedef struct Camera3D {
|
||||
|
@ -440,7 +479,7 @@ typedef struct Camera3D {
|
|||
int type; // Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
|
||||
} Camera3D;
|
||||
|
||||
#define Camera Camera3D // Camera type fallback, defaults to Camera3D
|
||||
#define Camera Camera3D // Camera type fallback, defaults to Camera3D
|
||||
|
||||
// Camera2D type, defines a 2d camera
|
||||
typedef struct Camera2D {
|
||||
|
@ -462,6 +501,7 @@ typedef struct Mesh {
|
|||
int vertexCount; // Number of vertices stored in arrays
|
||||
int triangleCount; // Number of triangles stored (indexed or not)
|
||||
|
||||
// Default vertex data
|
||||
float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
|
||||
float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
|
||||
float *texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)
|
||||
|
@ -469,9 +509,16 @@ typedef struct Mesh {
|
|||
float *tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
|
||||
unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
|
||||
unsigned short *indices;// Vertex indices (in case vertex data comes indexed)
|
||||
|
||||
// Animation vertex data
|
||||
float *baseVertices; // Vertex base position (required to apply bones transformations)
|
||||
float *baseNormals; // Vertex base normals (required to apply bones transformations)
|
||||
float *weightBias; // Vertex weight bias
|
||||
int *weightId; // Vertex weight id
|
||||
|
||||
// OpenGL identifiers
|
||||
unsigned int vaoId; // OpenGL Vertex Array Object id
|
||||
unsigned int vboId[7]; // OpenGL Vertex Buffer Objects id (7 types of vertex data)
|
||||
unsigned int vboId[7]; // OpenGL Vertex Buffer Objects id (default vertex data)
|
||||
} Mesh;
|
||||
|
||||
// Shader type (generic)
|
||||
|
@ -569,12 +616,12 @@ typedef struct VrDeviceInfo {
|
|||
// Enumerators Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
// Trace log type
|
||||
typedef enum {
|
||||
typedef enum {
|
||||
LOG_INFO = 1,
|
||||
LOG_WARNING = 2,
|
||||
LOG_ERROR = 4,
|
||||
LOG_DEBUG = 8,
|
||||
LOG_OTHER = 16
|
||||
LOG_WARNING = 2,
|
||||
LOG_ERROR = 4,
|
||||
LOG_DEBUG = 8,
|
||||
LOG_OTHER = 16
|
||||
} LogType;
|
||||
|
||||
// Shader location point type
|
||||
|
@ -666,16 +713,23 @@ typedef enum {
|
|||
} TextureFilterMode;
|
||||
|
||||
// Texture parameters: wrap mode
|
||||
typedef enum {
|
||||
WRAP_REPEAT = 0,
|
||||
WRAP_CLAMP,
|
||||
WRAP_MIRROR
|
||||
typedef enum {
|
||||
WRAP_REPEAT = 0,
|
||||
WRAP_CLAMP,
|
||||
WRAP_MIRROR
|
||||
} TextureWrapMode;
|
||||
|
||||
// Font type, defines generation method
|
||||
typedef enum {
|
||||
FONT_DEFAULT = 0, // Default font generation, anti-aliased
|
||||
FONT_BITMAP, // Bitmap font generation, no anti-aliasing
|
||||
FONT_SDF // SDF font generation, requires external shader
|
||||
} FontType;
|
||||
|
||||
// Color blending modes (pre-defined)
|
||||
typedef enum {
|
||||
BLEND_ALPHA = 0,
|
||||
BLEND_ADDITIVE,
|
||||
typedef enum {
|
||||
BLEND_ALPHA = 0,
|
||||
BLEND_ADDITIVE,
|
||||
BLEND_MULTIPLIED
|
||||
} BlendMode;
|
||||
|
||||
|
@ -720,6 +774,16 @@ typedef enum {
|
|||
HMD_SONY_PSVR
|
||||
} VrDeviceType;
|
||||
|
||||
// Type of n-patch
|
||||
typedef enum {
|
||||
NPT_9PATCH = 0, // 3x3
|
||||
NPT_3PATCH_VERTICAL, // 1x3
|
||||
NPT_3PATCH_HORIZONTAL // 3x1
|
||||
} NPatchType;
|
||||
|
||||
// Callbacks to be implemented by users
|
||||
typedef void (*TraceLogCallback)(int msgType, const char *text, va_list args);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" { // Prevents name mangling of functions
|
||||
#endif
|
||||
|
@ -748,6 +812,13 @@ RLAPI void SetWindowMinSize(int width, int height); // Set window
|
|||
RLAPI void SetWindowSize(int width, int height); // Set window dimensions
|
||||
RLAPI int GetScreenWidth(void); // Get current screen width
|
||||
RLAPI int GetScreenHeight(void); // Get current screen height
|
||||
RLAPI void *GetWindowHandle(void); // Get native window handle
|
||||
RLAPI int GetMonitorCount(void); // Get number of connected monitors
|
||||
RLAPI int GetMonitorWidth(int monitor); // Get primary monitor width
|
||||
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 const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
|
||||
|
||||
// Cursor-related functions
|
||||
RLAPI void ShowCursor(void); // Shows cursor
|
||||
|
@ -772,7 +843,7 @@ RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a r
|
|||
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)
|
||||
|
||||
// Timming-related functions
|
||||
// timing-related functions
|
||||
RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum)
|
||||
RLAPI int GetFPS(void); // Returns current FPS
|
||||
RLAPI float GetFrameTime(void); // Returns time in seconds for last frame drawn
|
||||
|
@ -789,6 +860,7 @@ RLAPI Color Fade(Color color, float alpha); // Color fade-
|
|||
RLAPI void ShowLogo(void); // Activate raylib logo at startup (can be done with flags)
|
||||
RLAPI void SetConfigFlags(unsigned char flags); // Setup window configuration flags (view FLAGS)
|
||||
RLAPI void SetTraceLog(unsigned char types); // Enable trace log message types (bit flags based)
|
||||
RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging bypassing raylib's one
|
||||
RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_DEBUG)
|
||||
RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png)
|
||||
RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included)
|
||||
|
@ -799,10 +871,12 @@ RLAPI const char *GetExtension(const char *fileName); // Get pointer
|
|||
RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string
|
||||
RLAPI const char *GetDirectoryPath(const char *fileName); // Get full path for a given fileName (uses static string)
|
||||
RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string)
|
||||
RLAPI char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory should be freed)
|
||||
RLAPI void ClearDirectoryFiles(void); // Clear directory files paths buffers (free memory)
|
||||
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 char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed)
|
||||
RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory)
|
||||
|
||||
// Persistent storage management
|
||||
RLAPI void StorageSaveValue(int position, int value); // Save integer value to storage file (to defined position)
|
||||
|
@ -921,7 +995,7 @@ RLAPI Image LoadImage(const char *fileName);
|
|||
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 void ExportImage(const char *fileName, Image image); // Export image as a PNG file
|
||||
RLAPI void ExportImage(Image image, const char *fileName); // Export image data to file
|
||||
RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM)
|
||||
RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data
|
||||
RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer)
|
||||
|
@ -929,6 +1003,7 @@ RLAPI void UnloadImage(Image image);
|
|||
RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM)
|
||||
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 Vector4 *GetImageDataNormalized(Image image); // Get pixel data from image as Vector4 array (float normalized)
|
||||
RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture)
|
||||
RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image
|
||||
RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data
|
||||
|
@ -942,23 +1017,27 @@ RLAPI void ImageAlphaClear(Image *image, Color color, float threshold);
|
|||
RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value
|
||||
RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
|
||||
RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle
|
||||
RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering)
|
||||
RLAPI void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm)
|
||||
RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (bilinear filtering)
|
||||
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 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 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 Image ImageTextEx(Font font, const char *text, float fontSize, float 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 ImageDrawRectangle(Image *dst, Vector2 position, Rectangle rec, Color color); // Draw rectangle within an 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 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 ImageFlipVertical(Image *image); // Flip image vertically
|
||||
RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally
|
||||
RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg
|
||||
RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg
|
||||
RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint
|
||||
RLAPI void ImageColorInvert(Image *image); // Modify image color: invert
|
||||
RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale
|
||||
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
|
||||
|
||||
// Image generation functions
|
||||
RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color
|
||||
|
@ -981,29 +1060,31 @@ 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 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.
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Font Loading and Text Drawing Functions (Module: text)
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
// Font loading/unloading functions
|
||||
RLAPI Font GetDefaultFont(void); // Get the default Font
|
||||
RLAPI Font LoadFont(const char *fileName); // Load Font from file into GPU memory (VRAM)
|
||||
RLAPI Font LoadFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load Font from file with extended parameters
|
||||
RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM)
|
||||
RLAPI Font GetFontDefault(void); // Get the default Font
|
||||
RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
|
||||
RLAPI Font LoadFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load font from file with extended parameters
|
||||
RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, int type); // Load font data for further use
|
||||
RLAPI Image GenImageFontAtlas(CharInfo *chars, int fontSize, int charsCount, int padding, int packMethod); // Generate image font atlas using chars info
|
||||
RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM)
|
||||
|
||||
// Text drawing functions
|
||||
RLAPI void DrawFPS(int posX, int posY); // Shows current FPS
|
||||
RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
|
||||
RLAPI void DrawTextEx(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using Font and additional parameters
|
||||
RLAPI void DrawFPS(int posX, int posY); // Shows current FPS
|
||||
RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
|
||||
RLAPI void DrawTextEx(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters
|
||||
|
||||
// Text misc. functions
|
||||
RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font
|
||||
RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
|
||||
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 int GetGlyphIndex(Font font, int character); // Returns index position for a unicode character on sprite font
|
||||
RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font
|
||||
RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
|
||||
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 int GetGlyphIndex(Font font, int character); // Get index position for a unicode character on font
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Basic 3d Shapes Drawing Functions (Module: models)
|
||||
|
@ -1039,11 +1120,11 @@ RLAPI void UnloadModel(Model model);
|
|||
// Mesh loading/unloading functions
|
||||
RLAPI Mesh LoadMesh(const char *fileName); // Load mesh from file
|
||||
RLAPI void UnloadMesh(Mesh *mesh); // Unload mesh from memory (RAM and/or VRAM)
|
||||
RLAPI void ExportMesh(const char *fileName, Mesh mesh); // Export mesh as an OBJ file
|
||||
RLAPI void ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file
|
||||
|
||||
// Mesh manipulation functions
|
||||
RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits
|
||||
RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents
|
||||
RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents
|
||||
RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals
|
||||
|
||||
// Mesh generation functions
|
||||
|
@ -1147,6 +1228,7 @@ RLAPI Sound LoadSoundFromWave(Wave wave); // Load so
|
|||
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 UnloadSound(Sound sound); // Unload sound
|
||||
RLAPI void ExportWave(Wave wave, const char *fileName); // Export wave data to file
|
||||
|
||||
// Wave/Sound management functions
|
||||
RLAPI void PlaySound(Sound sound); // Play a sound
|
||||
|
@ -1189,10 +1271,6 @@ RLAPI void StopAudioStream(AudioStream stream); // Stop au
|
|||
RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level)
|
||||
RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level)
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
RLAPI struct android_app *GetAndroidApp(void);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue