synced with master

This commit is contained in:
TheLastBilly 2023-05-30 11:46:05 -04:00
commit 5eaa1d99ac
27 changed files with 3074 additions and 2028 deletions

View file

@ -31,6 +31,7 @@ Some people ported raylib to other languages in form of bindings or wrappers to
| h-raylib | **4.5** | [Haskell](https://haskell.org/) | Apache-2.0 | https://github.com/Anut-py/h-raylib |
| raylib-hx | 4.2 | [Haxe](https://haxe.org/) | Zlib | https://github.com/foreignsasquatch/raylib-hx |
| hb-raylib | 3.5 | [Harbour](https://harbour.github.io) | MIT | https://github.com/MarcosLeonardoMendezGerencir/hb-raylib |
| jaylib | 4.5 | [Janet](https://janet-lang.org/) | MIT | https://github.com/janet-lang/jaylib |
| jaylib | 4.2 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | https://github.com/electronstudio/jaylib/ |
| raylib-j | 4.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib | https://github.com/CreedVI/Raylib-J |
| raylib.jl | 4.2 | [Julia](https://julialang.org/) | Zlib | https://github.com/irishgreencitrus/raylib.jl |
@ -133,7 +134,6 @@ These are older raylib bindings that are more than 2 versions old or have not be
| raylib-jai | 3.1-dev | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | https://github.com/kujukuju/raylib-jai |
| ray.zig | 2.5 | [Zig](https://ziglang.org/) | https://github.com/BitPuffin/zig-raylib-experiments |
| raylib-Ada | 3.0 | [Ada](https://www.adacore.com/about-ada) | https://github.com/mimo/raylib-Ada |
| jaylib | 3.0 | [Janet](https://janet-lang.org/) | https://github.com/janet-lang/jaylib |
| raykit | ? | [Kit](https://www.kitlang.org/) | https://github.com/Gamerfiend/raykit |
| ray.mod | 3.0 | [BlitzMax](https://blitzmax.org/) | https://github.com/bmx-ng/ray.mod |
| raylib-mosaic | 3.0 | [Mosaic](https://github.com/sal55/langs/tree/master/Mosaic) | https://github.com/pluckyporcupine/raylib-mosaic |

6
FAQ.md
View file

@ -14,7 +14,7 @@
- [What does raylib provide that other engines or libraries don't?](#what-does-raylib-provide-that-other-engines-or-libraries-dont)
- [How does raylib compare to Unity/Unreal/Godot?](#how-does-raylib-compare-to-unityunrealgodot)
- [What development tools are required for raylib?](#what-development-tools-are-required-for-raylib)
- [Which are raylib external dependencies?](#which-are-raylib-external-dependencies)
- [What are raylib's external dependencies?](#what-are-raylibs-external-dependencies)
- [Can I use raylib with other technologies or libraries?](#can-i-use-raylib-with-other-technologies-or-libraries)
- [What file formats are supported by raylib?](#what-file-formats-are-supported-by-raylib)
- [Does raylib support the Vulkan API?](#does-raylib-support-the-vulkan-api)
@ -119,8 +119,8 @@ raylib can load data from multiple standard file formats:
- Image/Textures: PNG, BMP, TGA, JPG, GIF, QOI, PSD, DDS, HDR, KTX, ASTC, PKM, PVR
- Fonts: FNT (sprite font), TTF, OTF
- Models/Meshes: OBJ, IQM, GLTF, VOX
- Audio: WAV, OGG, MP3, FLAC, XM, MOD
- Models/Meshes: OBJ, IQM, GLTF, VOX, M3D
- Audio: WAV, OGG, MP3, FLAC, XM, MOD, QOA
### Does raylib support the Vulkan API?

View file

@ -1,4 +1,4 @@
<img align="left" src="https://github.com/raysan5/raylib/blob/master/logo/raylib_logo_animation.gif" width="288px">
<img align="left" style="width:260px" src="https://github.com/raysan5/raylib/blob/master/logo/raylib_logo_animation.gif" width="288px">
**raylib is a simple and easy-to-use library to enjoy videogames programming.**

View file

@ -1,6 +1,7 @@
const std = @import("std");
const raylib = @import("src/build.zig");
pub fn build(b: *std.build.Builder) void {
// This has been tested to work with zig master branch as of commit 87de821 or May 14 2023
pub fn build(b: *std.Build) void {
raylib.build(b);
}

View file

@ -25,7 +25,7 @@ if (${PLATFORM} MATCHES "Desktop")
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
find_package(OpenGL QUIET)
set(LIBS_PRIVATE ${OPENGL_LIBRARIES} winmm)
else ()
elseif (UNIX)
find_library(pthread NAMES pthread)
find_package(OpenGL QUIET)
if ("${OPENGL_LIBRARIES}" STREQUAL "")
@ -36,9 +36,22 @@ if (${PLATFORM} MATCHES "Desktop")
find_library(OSS_LIBRARY ossaudio)
endif ()
set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
else ()
find_library(pthread NAMES pthread)
find_package(OpenGL QUIET)
if ("${OPENGL_LIBRARIES}" STREQUAL "")
set(OPENGL_LIBRARIES "GL")
endif ()
set(LIBS_PRIVATE m atomic pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
if (USE_AUDIO)
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD")
find_library(OSS_LIBRARY ossaudio)
set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
endif ()
if (NOT "${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD" AND USE_AUDIO)
set(LIBS_PRIVATE ${LIBS_PRIVATE} dl)
endif ()
endif ()

View file

@ -453,6 +453,7 @@ TEXTURES = \
textures/textures_image_generation \
textures/textures_image_loading \
textures/textures_image_processing \
textures/textures_image_rotate \
textures/textures_image_text \
textures/textures_to_image \
textures/textures_raw_data \

View file

@ -1,6 +1,7 @@
const std = @import("std");
const builtin = @import("builtin");
// This has been tested to work with zig master branch as of commit 87de821 or May 14 2023
fn add_module(comptime module: []const u8, b: *std.Build, target: std.zig.CrossTarget, optimize: std.builtin.OptimizeMode) !*std.Build.Step {
if (target.getOsTag() == .emscripten) {
@panic("Emscripten building via Zig unsupported");

View file

@ -13,7 +13,7 @@
#include "raylib.h"
#define NUM_TEXTURES 6 // Currently we have 7 generation algorithms
#define NUM_TEXTURES 9 // Currently we have 8 generation algorithms but some are have multiple purposes (Linear and Square Gradients)
//------------------------------------------------------------------------------------
// Program main entry point
@ -27,28 +27,37 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [textures] example - procedural images generation");
Image verticalGradient = GenImageGradientV(screenWidth, screenHeight, RED, BLUE);
Image horizontalGradient = GenImageGradientH(screenWidth, screenHeight, RED, BLUE);
Image verticalGradient = GenImageGradientLinear(screenWidth, screenHeight, 0, RED, BLUE);
Image horizontalGradient = GenImageGradientLinear(screenWidth, screenHeight, 90, RED, BLUE);
Image diagonalGradient = GenImageGradientLinear(screenWidth, screenHeight, 45, RED, BLUE);
Image radialGradient = GenImageGradientRadial(screenWidth, screenHeight, 0.0f, WHITE, BLACK);
Image squareGradient = GenImageGradientSquare(screenWidth, screenHeight, 0.0f, WHITE, BLACK);
Image checked = GenImageChecked(screenWidth, screenHeight, 32, 32, RED, BLUE);
Image whiteNoise = GenImageWhiteNoise(screenWidth, screenHeight, 0.5f);
Image perlinNoise = GenImagePerlinNoise(screenWidth, screenHeight, 50, 50, 4.0f);
Image cellular = GenImageCellular(screenWidth, screenHeight, 32);
Texture2D textures[NUM_TEXTURES] = { 0 };
textures[0] = LoadTextureFromImage(verticalGradient);
textures[1] = LoadTextureFromImage(horizontalGradient);
textures[2] = LoadTextureFromImage(radialGradient);
textures[3] = LoadTextureFromImage(checked);
textures[4] = LoadTextureFromImage(whiteNoise);
textures[5] = LoadTextureFromImage(cellular);
textures[2] = LoadTextureFromImage(diagonalGradient);
textures[3] = LoadTextureFromImage(radialGradient);
textures[4] = LoadTextureFromImage(squareGradient);
textures[5] = LoadTextureFromImage(checked);
textures[6] = LoadTextureFromImage(whiteNoise);
textures[7] = LoadTextureFromImage(perlinNoise);
textures[8] = LoadTextureFromImage(cellular);
// Unload image data (CPU RAM)
UnloadImage(verticalGradient);
UnloadImage(horizontalGradient);
UnloadImage(diagonalGradient);
UnloadImage(radialGradient);
UnloadImage(squareGradient);
UnloadImage(checked);
UnloadImage(whiteNoise);
UnloadImage(perlinNoise);
UnloadImage(cellular);
int currentTexture = 0;
@ -83,10 +92,13 @@ int main(void)
{
case 0: DrawText("VERTICAL GRADIENT", 560, 10, 20, RAYWHITE); break;
case 1: DrawText("HORIZONTAL GRADIENT", 540, 10, 20, RAYWHITE); break;
case 2: DrawText("RADIAL GRADIENT", 580, 10, 20, LIGHTGRAY); break;
case 3: DrawText("CHECKED", 680, 10, 20, RAYWHITE); break;
case 4: DrawText("WHITE NOISE", 640, 10, 20, RED); break;
case 5: DrawText("CELLULAR", 670, 10, 20, RAYWHITE); break;
case 2: DrawText("DIAGONAL GRADIENT", 540, 10, 20, RAYWHITE); break;
case 3: DrawText("RADIAL GRADIENT", 580, 10, 20, LIGHTGRAY); break;
case 4: DrawText("SQUARE GRADIENT", 580, 10, 20, LIGHTGRAY); break;
case 5: DrawText("CHECKED", 680, 10, 20, RAYWHITE); break;
case 6: DrawText("WHITE NOISE", 640, 10, 20, RED); break;
case 7: DrawText("PERLIN NOISE", 640, 10, 20, RED); break;
case 8: DrawText("CELLULAR", 670, 10, 20, RAYWHITE); break;
default: break;
}

View file

@ -0,0 +1,79 @@
/*******************************************************************************************
*
* raylib [textures] example - Image Rotation
*
* Example originally created with raylib 1.0, last time updated with raylib 1.0
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#define NUM_TEXTURES 3
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [textures] example - texture rotation");
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
Image image45 = LoadImage("resources/raylib_logo.png");
Image image90 = LoadImage("resources/raylib_logo.png");
Image imageNeg90 = LoadImage("resources/raylib_logo.png");
ImageRotate(&image45, 45);
ImageRotate(&image90, 90);
ImageRotate(&imageNeg90, -90);
Texture2D textures[NUM_TEXTURES] = { 0 };
textures[0] = LoadTextureFromImage(image45);
textures[1] = LoadTextureFromImage(image90);
textures[2] = LoadTextureFromImage(imageNeg90);
int currentTexture = 0;
//---------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT) || IsKeyPressed(KEY_RIGHT))
{
currentTexture = (currentTexture + 1)%NUM_TEXTURES; // Cycle between the textures
}
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawTexture(textures[currentTexture], screenWidth/2 - textures[currentTexture].width/2, screenHeight/2 - textures[currentTexture].height/2, WHITE);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
for (int i = 0; i < NUM_TEXTURES; i++) UnloadTexture(textures[i]);
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -15,7 +15,7 @@
{
"name": "RAYLIB_VERSION_MINOR",
"type": "INT",
"value": 5,
"value": 6,
"description": ""
},
{
@ -27,7 +27,7 @@
{
"name": "RAYLIB_VERSION",
"type": "STRING",
"value": "4.5",
"value": "4.6-dev",
"description": ""
},
{
@ -1032,6 +1032,11 @@
"type": "Transform **",
"name": "framePoses",
"description": "Poses array by frame"
},
{
"type": "char[32]",
"name": "name",
"description": "Animation name"
}
]
},
@ -6236,8 +6241,8 @@
]
},
{
"name": "GenImageGradientV",
"description": "Generate image: vertical gradient",
"name": "GenImageGradientLinear",
"description": "Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient",
"returnType": "Image",
"params": [
{
@ -6248,36 +6253,17 @@
"type": "int",
"name": "height"
},
{
"type": "Color",
"name": "top"
},
{
"type": "Color",
"name": "bottom"
}
]
},
{
"name": "GenImageGradientH",
"description": "Generate image: horizontal gradient",
"returnType": "Image",
"params": [
{
"type": "int",
"name": "width"
},
{
"type": "int",
"name": "height"
"name": "direction"
},
{
"type": "Color",
"name": "left"
"name": "start"
},
{
"type": "Color",
"name": "right"
"name": "end"
}
]
},
@ -6308,6 +6294,33 @@
}
]
},
{
"name": "GenImageGradientSquare",
"description": "Generate image: square gradient",
"returnType": "Image",
"params": [
{
"type": "int",
"name": "width"
},
{
"type": "int",
"name": "height"
},
{
"type": "float",
"name": "density"
},
{
"type": "Color",
"name": "inner"
},
{
"type": "Color",
"name": "outer"
}
]
},
{
"name": "GenImageChecked",
"description": "Generate image: checked",
@ -6744,6 +6757,21 @@
}
]
},
{
"name": "ImageRotate",
"description": "Rotate image by input angle in degrees (-359 to 359) ",
"returnType": "void",
"params": [
{
"type": "Image *",
"name": "image"
},
{
"type": "int",
"name": "degrees"
}
]
},
{
"name": "ImageRotateCW",
"description": "Rotate image clockwise 90deg",

View file

@ -15,7 +15,7 @@ return {
{
name = "RAYLIB_VERSION_MINOR",
type = "INT",
value = 5,
value = 6,
description = ""
},
{
@ -27,7 +27,7 @@ return {
{
name = "RAYLIB_VERSION",
type = "STRING",
value = "4.5",
value = "4.6-dev",
description = ""
},
{
@ -1032,6 +1032,11 @@ return {
type = "Transform **",
name = "framePoses",
description = "Poses array by frame"
},
{
type = "char[32]",
name = "name",
description = "Animation name"
}
}
},
@ -4991,25 +4996,15 @@ return {
}
},
{
name = "GenImageGradientV",
description = "Generate image: vertical gradient",
name = "GenImageGradientLinear",
description = "Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient",
returnType = "Image",
params = {
{type = "int", name = "width"},
{type = "int", name = "height"},
{type = "Color", name = "top"},
{type = "Color", name = "bottom"}
}
},
{
name = "GenImageGradientH",
description = "Generate image: horizontal gradient",
returnType = "Image",
params = {
{type = "int", name = "width"},
{type = "int", name = "height"},
{type = "Color", name = "left"},
{type = "Color", name = "right"}
{type = "int", name = "direction"},
{type = "Color", name = "start"},
{type = "Color", name = "end"}
}
},
{
@ -5024,6 +5019,18 @@ return {
{type = "Color", name = "outer"}
}
},
{
name = "GenImageGradientSquare",
description = "Generate image: square gradient",
returnType = "Image",
params = {
{type = "int", name = "width"},
{type = "int", name = "height"},
{type = "float", name = "density"},
{type = "Color", name = "inner"},
{type = "Color", name = "outer"}
}
},
{
name = "GenImageChecked",
description = "Generate image: checked",
@ -5259,6 +5266,15 @@ return {
{type = "Image *", name = "image"}
}
},
{
name = "ImageRotate",
description = "Rotate image by input angle in degrees (-359 to 359) ",
returnType = "void",
params = {
{type = "Image *", name = "image"},
{type = "int", name = "degrees"}
}
},
{
name = "ImageRotateCW",
description = "Rotate image clockwise 90deg",

File diff suppressed because it is too large Load diff

View file

@ -3,9 +3,9 @@
<Defines count="56">
<Define name="RAYLIB_H" type="GUARD" value="" desc="" />
<Define name="RAYLIB_VERSION_MAJOR" type="INT" value="4" desc="" />
<Define name="RAYLIB_VERSION_MINOR" type="INT" value="5" desc="" />
<Define name="RAYLIB_VERSION_MINOR" type="INT" value="6" desc="" />
<Define name="RAYLIB_VERSION_PATCH" type="INT" value="0" desc="" />
<Define name="RAYLIB_VERSION" type="STRING" value="4.5" desc="" />
<Define name="RAYLIB_VERSION" type="STRING" value="4.6-dev" desc="" />
<Define name="__declspec(x)" type="MACRO" value="__attribute__((x))" desc="" />
<Define name="RLAPI" type="UNKNOWN" value="__declspec(dllexport)" desc="We are building the library as a Win32 shared library (.dll)" />
<Define name="PI" type="FLOAT" value="3.14159265358979323846" desc="" />
@ -210,11 +210,12 @@
<Field type="BoneInfo *" name="bones" desc="Bones information (skeleton)" />
<Field type="Transform *" name="bindPose" desc="Bones base transformation (pose)" />
</Struct>
<Struct name="ModelAnimation" fieldCount="4" desc="ModelAnimation">
<Struct name="ModelAnimation" fieldCount="5" desc="ModelAnimation">
<Field type="int" name="boneCount" desc="Number of bones" />
<Field type="int" name="frameCount" desc="Number of animation frames" />
<Field type="BoneInfo *" name="bones" desc="Bones information (skeleton)" />
<Field type="Transform **" name="framePoses" desc="Poses array by frame" />
<Field type="char[32]" name="name" desc="Animation name" />
</Struct>
<Struct name="Ray" fieldCount="2" desc="Ray, ray for raycasting">
<Field type="Vector3" name="position" desc="Ray position (origin)" />
@ -655,7 +656,7 @@
<Param type="unsigned int" name="frames" desc="" />
</Callback>
</Callbacks>
<Functions count="517">
<Functions count="518">
<Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context">
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
@ -1548,17 +1549,12 @@
<Param type="int" name="height" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="GenImageGradientV" retType="Image" paramCount="4" desc="Generate image: vertical gradient">
<Function name="GenImageGradientLinear" retType="Image" paramCount="5" desc="Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient">
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
<Param type="Color" name="top" desc="" />
<Param type="Color" name="bottom" desc="" />
</Function>
<Function name="GenImageGradientH" retType="Image" paramCount="4" desc="Generate image: horizontal gradient">
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
<Param type="Color" name="left" desc="" />
<Param type="Color" name="right" desc="" />
<Param type="int" name="direction" desc="" />
<Param type="Color" name="start" desc="" />
<Param type="Color" name="end" desc="" />
</Function>
<Function name="GenImageGradientRadial" retType="Image" paramCount="5" desc="Generate image: radial gradient">
<Param type="int" name="width" desc="" />
@ -1567,6 +1563,13 @@
<Param type="Color" name="inner" desc="" />
<Param type="Color" name="outer" desc="" />
</Function>
<Function name="GenImageGradientSquare" retType="Image" paramCount="5" desc="Generate image: square gradient">
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
<Param type="float" name="density" desc="" />
<Param type="Color" name="inner" desc="" />
<Param type="Color" name="outer" desc="" />
</Function>
<Function name="GenImageChecked" retType="Image" paramCount="6" desc="Generate image: checked">
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
@ -1682,6 +1685,10 @@
<Function name="ImageFlipHorizontal" retType="void" paramCount="1" desc="Flip image horizontally">
<Param type="Image *" name="image" desc="" />
</Function>
<Function name="ImageRotate" retType="void" paramCount="2" desc="Rotate image by input angle in degrees (-359 to 359) ">
<Param type="Image *" name="image" desc="" />
<Param type="int" name="degrees" desc="" />
</Function>
<Function name="ImageRotateCW" retType="void" paramCount="1" desc="Rotate image clockwise 90deg">
<Param type="Image *" name="image" desc="" />
</Function>

View file

@ -5,12 +5,13 @@ project(example)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Dependencies
set(RAYLIB_VERSION 4.2.0)
set(RAYLIB_VERSION 4.5.0)
find_package(raylib ${RAYLIB_VERSION} QUIET) # QUIET or REQUIRED
if (NOT raylib_FOUND) # If there's none, fetch and build raylib
include(FetchContent)
FetchContent_Declare(
raylib
DOWNLOAD_EXTRACT_TIMESTAMP OFF
URL https://github.com/raysan5/raylib/archive/refs/tags/${RAYLIB_VERSION}.tar.gz
)
FetchContent_GetProperties(raylib)

View file

@ -202,6 +202,7 @@ ImageDrawText|void|(Image *dst, Vector2 position, const char *text, int fontSize
ImageDrawTextEx|void|(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color);|
ImageFlipVertical|void|(Image *image);|
ImageFlipHorizontal|void|(Image *image);|
ImageRotate|void|(Image *image, int degrees);|
ImageRotateCW|void|(Image *image);|
ImageRotateCCW|void|(Image *image);|
ImageColorTint|void|(Image *image, Color color);|
@ -211,9 +212,9 @@ ImageColorContrast|void|(Image *image, float contrast);|
ImageColorBrightness|void|(Image *image, int brightness);|
ImageColorReplace|void|(Image *image, Color color, Color replace);|
GenImageColor|Image|(int width, int height, Color color);|
GenImageGradientV|Image|(int width, int height, Color top, Color bottom);|
GenImageGradientH|Image|(int width, int height, Color left, Color right);|
GenImageGradientLinear|Image|(int width, int height, int direction, Color start, Color end);|
GenImageGradientRadial|Image|(int width, int height, float density, Color inner, Color outer);|
GenImageGradientSquare|Image|(int width, int height, float density, Color inner, Color outer);|
GenImageChecked|Image|(int width, int height, int checksX, int checksY, Color col1, Color col2);|
GenImageWhiteNoise|Image|(int width, int height, float factor);|
GenImagePerlinNoise|Image|(int width, int height, int offsetX, int offsetY, float scale);|

View file

@ -1378,20 +1378,13 @@
<Param name="Color color" />
</Overload>
</KeyWord>
<KeyWord name="GenImageGradientV" func="yes">
<Overload retVal="Image" descr="Generate image: vertical gradient">
<KeyWord name="GenImageGradientLinear" func="yes">
<Overload retVal="Image" descr="Generate image: linear gradient">
<Param name="int width" />
<Param name="int height" />
<Param name="Color top" />
<Param name="Color bottom" />
</Overload>
</KeyWord>
<KeyWord name="GenImageGradientH" func="yes">
<Overload retVal="Image" descr="Generate image: horizontal gradient">
<Param name="int width" />
<Param name="int height" />
<Param name="Color left" />
<Param name="Color right" />
<Param name="int direction" />
<Param name="Color start" />
<Param name="Color end" />
</Overload>
</KeyWord>
<KeyWord name="GenImageGradientRadial" func="yes">
@ -1403,6 +1396,15 @@
<Param name="Color outer" />
</Overload>
</KeyWord>
<KeyWord name="GenImageGradientSquare" func="yes">
<Overload retVal="Image" descr="Generate image: square gradient">
<Param name="int width" />
<Param name="int height" />
<Param name="float density" />
<Param name="Color inner" />
<Param name="Color outer" />
</Overload>
</KeyWord>
<KeyWord name="GenImageChecked" func="yes">
<Overload retVal="Image" descr="Generate image: checked">
<Param name="int width" />
@ -1568,6 +1570,12 @@
<Param name="Image *image" />
</Overload>
</KeyWord>
<KeyWord name="ImageRotate" func="yes">
<Overload retVal="void" descr="Rotate image by input angle in degrees (-359 to 359)">
<Param name="Image *image" />
<Param name="int degrees" />
</Overload>
</KeyWord>
<KeyWord name="ImageRotateCW" func="yes">
<Overload retVal="void" descr="Rotate image clockwise 90deg">
<Param name="Image *image" />

View file

@ -317,9 +317,9 @@ RLAPI bool ExportImageAsCode(Image image, const char *fileName);
// Image generation functions
RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color
RLAPI Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient
RLAPI Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient
RLAPI Image GenImageGradientLinear(int width, int height, int direction, Color start, Color end); // Generate image: linear gradient
RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient
RLAPI Image GenImageGradientSquare(int width, int height, float density, Color inner, Color outer); // Generate image: square gradient
RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked
RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise
RLAPI Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); // Generate image: perlin noise
@ -346,6 +346,7 @@ RLAPI void ImageMipmaps(Image *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
RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally
RLAPI void ImageRotate(Image *image, int degrees); // Rotate image by input angle in degrees (-359 to 359)
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

View file

@ -1,6 +1,7 @@
const std = @import("std");
pub fn addRaylib(b: *std.build.Builder, target: std.zig.CrossTarget) *std.build.LibExeObjStep {
// This has been tested to work with zig master branch as of commit 87de821 or May 14 2023
pub fn addRaylib(b: *std.Build, target: std.zig.CrossTarget, optimize: std.builtin.OptimizeMode) *std.Build.CompileStep {
const raylib_flags = &[_][]const u8{
"-std=gnu99",
"-D_GNU_SOURCE",
@ -8,7 +9,11 @@ pub fn addRaylib(b: *std.build.Builder, target: std.zig.CrossTarget) *std.build.
"-fno-sanitize=undefined", // https://github.com/raysan5/raylib/issues/1891
};
const raylib = b.addStaticLibrary("raylib", null);
const raylib = b.addStaticLibrary(.{
.name = "raylib",
.target = target,
.optimize = optimize,
});
raylib.linkLibC();
raylib.addIncludePath(srcdir ++ "/external/glfw/include");
@ -99,7 +104,7 @@ pub fn addRaylib(b: *std.build.Builder, target: std.zig.CrossTarget) *std.build.
return raylib;
}
pub fn build(b: *std.build.Builder) void {
pub fn build(b: *std.Build) void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
@ -108,10 +113,10 @@ pub fn build(b: *std.build.Builder) void {
// Standard optimization options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
// set a preferred release mode, allowing the user to decide how to optimize.
// const optimize = b.standardReleaseOptions();
const optimize = b.standardOptimizeOption(.{});
const lib = addRaylib(b, target);
b.installFile("src/raylib.h", "raylib.h");
const lib = addRaylib(b, target, optimize);
lib.installHeader("src/raylib.h", "raylib.h");
b.installArtifact(lib);
}

3964
src/external/miniaudio.h vendored

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more