diff options
| author | bXi <[email protected]> | 2023-09-02 07:00:18 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-09-02 13:00:18 +0200 |
| commit | c03ab03627232047c63b11c27567ef3d0a74ca3c (patch) | |
| tree | fe6510daa26e00a6702812a1cd5890cb68130227 /src/raylib.h | |
| parent | 75e5cd86d7d1c4c6e0f266f3ae68f3af34fa78ac (diff) | |
| download | raylib-c03ab03627232047c63b11c27567ef3d0a74ca3c.tar.gz raylib-c03ab03627232047c63b11c27567ef3d0a74ca3c.zip | |
Added rudimentary SVG support. (#2738)
* Added rudimentary SVG support. Added 2 functions ImageLoadSvg and ImageLoadSvgWithSize.
* Added an example on how to use ImageLoadSvgWithSize and adjusted Makefiles accordingly.
* Added actual correct example file.
* Reviewed the code to keep the raylib coding conventions in mind.
Moved the LoadImageSvg() code into LoadImage() guarded by SUPPORT_FILEFORMAT_SVG.
Renamed LoadImageSvgWithSize() to LoadImageSvg().
Added a LoadImageSvgFromString() function to parse the loaded SVG into an actual image. This does the bulk of the work.
* Fixed typo.
---------
Co-authored-by: Ray <[email protected]>
Diffstat (limited to 'src/raylib.h')
| -rw-r--r-- | src/raylib.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/raylib.h b/src/raylib.h index 6f67d839..198c6c49 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1245,6 +1245,8 @@ RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // NOTE: These functions do not require GPU access RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data +RLAPI Image LoadImageSvg(const char *fileName, int width, int height); // Load image from SVG file data with specified size +RLAPI Image LoadImageSvgFromString(const char *string, int width, int height); // Load an image from a SVG string with custom size RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' RLAPI Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data |
