Skip to content

Commit 9c8b349

Browse files
committed
update raylib, r3d, raygui, raymedia and binary
1 parent 27754c3 commit 9c8b349

File tree

17 files changed

+54
-58
lines changed

17 files changed

+54
-58
lines changed

headers/extras/r3d.h

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
* Copyright (c) 2025 Le Juez Victor
33
*
44
* This software is provided "as-is", without any express or implied warranty. In no event
@@ -57,14 +57,15 @@
5757
*
5858
* These flags control various aspects of the rendering pipeline.
5959
*/
60-
typedef enum {
61-
R3D_FLAG_NONE = 0, ///< No special rendering flags.
62-
R3D_FLAG_FXAA = 1 << 0, ///< Enables Fast Approximate Anti-Aliasing (FXAA).
63-
R3D_FLAG_BLIT_LINEAR = 1 << 1, ///< Uses linear filtering when blitting the final image.
64-
R3D_FLAG_ASPECT_KEEP = 1 << 2, ///< Maintains the aspect ratio when rendering.
65-
R3D_FLAG_STENCIL_TEST = 1 << 3, ///< Performs a stencil test on each rendering pass affecting geometry, useful for outdoor scenes where the sky is dominant.
66-
R3D_FLAG_DEPTH_PREPASS = 1 << 4, ///< Performs a depth pre-pass before forward rendering, improving desktop GPU performance but unnecessary on mobile.
67-
} R3D_Flags;
60+
typedef unsigned int R3D_Flags;
61+
62+
#define R3D_FLAG_NONE 0 /*< No special rendering flags */
63+
#define R3D_FLAG_FXAA (1 << 0) /*< Enables Fast Approximate Anti-Aliasing (FXAA) */
64+
#define R3D_FLAG_BLIT_LINEAR (1 << 1) /*< Uses linear filtering when blitting the final image */
65+
#define R3D_FLAG_ASPECT_KEEP (1 << 2) /*< Maintains the aspect ratio of the internal resolution when blitting the final image */
66+
#define R3D_FLAG_STENCIL_TEST (1 << 3) /*< Performs a stencil test on each rendering pass affecting geometry */
67+
#define R3D_FLAG_DEPTH_PREPASS (1 << 4) /*< Performs a depth pre-pass before forward rendering, improving desktop GPU performance but unnecessary on mobile */
68+
#define R3D_FLAG_8_BIT_NORMALS (1 << 5) /*< Use 8-bit precision for the normals buffer (deferred); default is 16-bit float */
6869

6970
/**
7071
* @brief Defines the rendering mode used in the pipeline.

headers/extras/raygui.h

+27-25
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149
* ADDED: GuiLoadIconsFromMemory()
150150
* ADDED: Multiple new icons
151151
* REMOVED: GuiSpinner() from controls list, using BUTTON + VALUEBOX properties
152+
* REMOVED: GuiSliderPro(), functionality was redundant
152153
* REVIEWED: Controls using text labels to use LABEL properties
153154
* REVIEWED: Replaced sprintf() by snprintf() for more safety
154155
* REVIEWED: GuiTabBar(), close tab with mouse middle button
@@ -754,7 +755,6 @@ RAYGUIAPI int GuiValueBoxFloat(Rectangle bounds, const char *text, char *textVal
754755
RAYGUIAPI int GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control, updates input text
755756

756757
RAYGUIAPI int GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue); // Slider control
757-
RAYGUIAPI int GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue, int sliderWidth); // Slider control with extended parameters
758758
RAYGUIAPI int GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue); // Slider Bar control
759759
RAYGUIAPI int GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue); // Progress Bar control
760760
RAYGUIAPI int GuiStatusBar(Rectangle bounds, const char *text); // Status Bar control, shows info text
@@ -1010,11 +1010,11 @@ typedef enum {
10101010
ICON_MLAYERS = 226,
10111011
ICON_MAPS = 227,
10121012
ICON_HOT = 228,
1013-
ICON_229 = 229,
1014-
ICON_230 = 230,
1015-
ICON_231 = 231,
1016-
ICON_232 = 232,
1017-
ICON_233 = 233,
1013+
ICON_LABEL = 229,
1014+
ICON_NAME_ID = 230,
1015+
ICON_SLICING = 231,
1016+
ICON_MANUAL_CONTROL = 232,
1017+
ICON_COLLISION = 233,
10181018
ICON_234 = 234,
10191019
ICON_235 = 235,
10201020
ICON_236 = 236,
@@ -1329,11 +1329,11 @@ static unsigned int guiIcons[RAYGUI_ICON_MAX_ICONS*RAYGUI_ICON_DATA_ELEMENTS] =
13291329
0x0ffe0000, 0x3ffa0802, 0x7fea200a, 0x402a402a, 0x422a422a, 0x422e422a, 0x40384e28, 0x00007fe0, // ICON_MLAYERS
13301330
0x0ffe0000, 0x3ffa0802, 0x7fea200a, 0x402a402a, 0x5b2a512a, 0x512e552a, 0x40385128, 0x00007fe0, // ICON_MAPS
13311331
0x04200000, 0x1cf00c60, 0x11f019f0, 0x0f3807b8, 0x1e3c0f3c, 0x1c1c1e1c, 0x1e3c1c1c, 0x00000f70, // ICON_HOT
1332-
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_229
1333-
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_230
1334-
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_231
1335-
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_232
1336-
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_233
1332+
0x00000000, 0x20803f00, 0x2a202e40, 0x20082e10, 0x08021004, 0x02040402, 0x00900108, 0x00000060, // ICON_LABEL
1333+
0x00000000, 0x042007e0, 0x47e27c3e, 0x4ffa4002, 0x47fa4002, 0x4ffa4002, 0x7ffe4002, 0x00000000, // ICON_NAME_ID
1334+
0x7fe00000, 0x402e4020, 0x43ce5e0a, 0x40504078, 0x438e4078, 0x402e5e0a, 0x7fe04020, 0x00000000, // ICON_SLICING
1335+
0x00000000, 0x40027ffe, 0x47c24002, 0x55425d42, 0x55725542, 0x50125552, 0x10105016, 0x00001ff0, // ICON_MANUAL_CONTROL
1336+
0x7ffe0000, 0x43c24002, 0x48124422, 0x500a500a, 0x500a500a, 0x44224812, 0x400243c2, 0x00007ffe, // ICON_COLLISION
13371337
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_234
13381338
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_235
13391339
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_236
@@ -3239,14 +3239,16 @@ int GuiValueBoxFloat(Rectangle bounds, const char *text, char *textValue, float
32393239

32403240
// Slider control with pro parameters
32413241
// NOTE: Other GuiSlider*() controls use this one
3242-
int GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue, int sliderWidth)
3242+
int GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue)
32433243
{
32443244
int result = 0;
32453245
GuiState state = guiState;
32463246

32473247
float temp = (maxValue - minValue)/2.0f;
32483248
if (value == NULL) value = &temp;
32493249
float oldValue = *value;
3250+
3251+
int sliderWidth = GuiGetStyle(SLIDER, SLIDER_WIDTH);
32503252

32513253
Rectangle slider = { bounds.x, bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH) + GuiGetStyle(SLIDER, SLIDER_PADDING),
32523254
0, bounds.height - 2*GuiGetStyle(SLIDER, BORDER_WIDTH) - 2*GuiGetStyle(SLIDER, SLIDER_PADDING) };
@@ -3265,7 +3267,7 @@ int GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight,
32653267
{
32663268
state = STATE_PRESSED;
32673269
// Get equivalent value and slider position from mousePosition.x
3268-
*value = (maxValue - minValue)*((mousePoint.x - bounds.x - sliderWidth/2)/(bounds.width-sliderWidth)) + minValue;
3270+
*value = (maxValue - minValue)*((mousePoint.x - bounds.x - sliderWidth/2)/(bounds.width - sliderWidth)) + minValue;
32693271
}
32703272
}
32713273
else
@@ -3285,7 +3287,7 @@ int GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight,
32853287
if (!CheckCollisionPointRec(mousePoint, slider))
32863288
{
32873289
// Get equivalent value and slider position from mousePosition.x
3288-
*value = (maxValue - minValue)*((mousePoint.x - bounds.x - sliderWidth/2)/(bounds.width-sliderWidth)) + minValue;
3290+
*value = (maxValue - minValue)*((mousePoint.x - bounds.x - sliderWidth/2)/(bounds.width - sliderWidth)) + minValue;
32893291
}
32903292
}
32913293
else state = STATE_FOCUSED;
@@ -3353,16 +3355,16 @@ int GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight,
33533355
return result;
33543356
}
33553357

3356-
// Slider control extended, returns selected value and has text
3357-
int GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue)
3358-
{
3359-
return GuiSliderPro(bounds, textLeft, textRight, value, minValue, maxValue, GuiGetStyle(SLIDER, SLIDER_WIDTH));
3360-
}
3361-
33623358
// Slider Bar control extended, returns selected value
33633359
int GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue)
33643360
{
3365-
return GuiSliderPro(bounds, textLeft, textRight, value, minValue, maxValue, 0);
3361+
int result = 0;
3362+
int preSliderWidth = GuiGetStyle(SLIDER, SLIDER_WIDTH);
3363+
GuiSetStyle(SLIDER, SLIDER_WIDTH, 0);
3364+
result = GuiSlider(bounds, textLeft, textRight, value, minValue, maxValue);
3365+
GuiSetStyle(SLIDER, SLIDER_WIDTH, preSliderWidth);
3366+
3367+
return result;
33663368
}
33673369

33683370
// Progress Bar control extended, shows current progress value
@@ -4443,8 +4445,8 @@ void GuiLoadStyleDefault(void)
44434445
{
44444446
// Unload previous font texture
44454447
UnloadTexture(guiFont.texture);
4446-
RL_FREE(guiFont.recs);
4447-
RL_FREE(guiFont.glyphs);
4448+
RAYGUI_FREE(guiFont.recs);
4449+
RAYGUI_FREE(guiFont.glyphs);
44484450
guiFont.recs = NULL;
44494451
guiFont.glyphs = NULL;
44504452

@@ -4561,7 +4563,7 @@ char **GuiLoadIcons(const char *fileName, bool loadIconsName)
45614563
else fseek(rgiFile, iconCount*RAYGUI_ICON_MAX_NAME_LENGTH, SEEK_CUR);
45624564

45634565
// Read icons data directly over internal icons array
4564-
fread(guiIconsPtr, sizeof(unsigned int), iconCount*(iconSize*iconSize/32), rgiFile);
4566+
fread(guiIconsPtr, sizeof(unsigned int), (int)iconCount*((int)iconSize*(int)iconSize/32), rgiFile);
45654567
}
45664568

45674569
fclose(rgiFile);
@@ -4611,7 +4613,7 @@ char **GuiLoadIconsFromMemory(const unsigned char *fileData, int dataSize, bool
46114613
fileDataPtr += iconCount*RAYGUI_ICON_MAX_NAME_LENGTH;
46124614
}
46134615

4614-
int iconDataSize = iconCount*(iconSize*iconSize/32)*sizeof(unsigned int);
4616+
int iconDataSize = iconCount*((int)iconSize*(int)iconSize/32)*(int)sizeof(unsigned int);
46154617
guiIconsPtr = (unsigned int *)RAYGUI_MALLOC(iconDataSize);
46164618

46174619
memcpy(guiIconsPtr, fileDataPtr, iconDataSize);

headers/raylib.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ RLAPI void ToggleFullscreen(void); // Toggle wind
987987
RLAPI void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed, resizes window to match monitor resolution
988988
RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable
989989
RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable
990-
RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized
990+
RLAPI void RestoreWindow(void); // Restore window from being minimized/maximized
991991
RLAPI void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit)
992992
RLAPI void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit)
993993
RLAPI void SetWindowTitle(const char *title); // Set title for window

headers/rlgl.h

+3-9
Original file line numberDiff line numberDiff line change
@@ -1459,9 +1459,6 @@ void rlBegin(int mode)
14591459
// NOTE: In all three cases, vertex are accumulated over default internal vertex buffer
14601460
if (RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].mode != mode)
14611461
{
1462-
// Get current binded texture to preserve it between draw modes change (QUADS <--> TRIANGLES)
1463-
int currentTexture = RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].textureId;
1464-
14651462
if (RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].vertexCount > 0)
14661463
{
14671464
// Make sure current RLGL.currentBatch->draws[i].vertexCount is aligned a multiple of 4,
@@ -1484,16 +1481,13 @@ void rlBegin(int mode)
14841481

14851482
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].mode = mode;
14861483
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].vertexCount = 0;
1487-
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].textureId = currentTexture; // Preserve active texture
1484+
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].textureId = RLGL.State.defaultTextureId;
14881485
}
14891486
}
14901487

14911488
// Finish vertex providing
14921489
void rlEnd(void)
14931490
{
1494-
// Reset texture to default
1495-
rlSetTexture(RLGL.State.defaultTextureId);
1496-
14971491
// NOTE: Depth increment is dependant on rlOrtho(): z-near and z-far values,
14981492
// as well as depth buffer bit-depth (16bit or 24bit or 32bit)
14991493
// Correct increment formula would be: depthInc = (zfar - znear)/pow(2, bits)
@@ -3317,7 +3311,7 @@ unsigned int rlLoadTexture(const void *data, int width, int height, int format,
33173311
// Activate Trilinear filtering if mipmaps are available
33183312
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
33193313
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
3320-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, mipmapCount); // user defined mip count would break without this.
3314+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, mipmapCount); // Required for user-defined mip count
33213315
}
33223316
#endif
33233317

@@ -3690,7 +3684,7 @@ unsigned char *rlReadScreenPixels(int width, int height)
36903684

36913685
// Flip image vertically!
36923686
// NOTE: Alpha value has already been applied to RGB in framebuffer, we don't need it!
3693-
for (int y = height - 1; y >= height / 2; y--)
3687+
for (int y = height - 1; y >= height/2; y--)
36943688
{
36953689
for (int x = 0; x < (width*4); x += 4)
36963690
{

libs/i386-win32/libraygizmo.dll

0 Bytes
Binary file not shown.

libs/i386-win32/libraylib.dll

0 Bytes
Binary file not shown.

libs/i386-win32/libraymedia.dll

1.16 KB
Binary file not shown.

libs/x86_32-linux/libr3d.a

-677 KB
Binary file not shown.

libs/x86_32-linux/libraymedia.a

648 Bytes
Binary file not shown.

libs/x86_64-linux/libr3d.a

-677 KB
Binary file not shown.

libs/x86_64-linux/libraymedia.a

648 Bytes
Binary file not shown.

libs/x86_64-win64/libraygizmo.dll

0 Bytes
Binary file not shown.

libs/x86_64-win64/libraylib.dll

0 Bytes
Binary file not shown.

libs/x86_64-win64/libraymedia.dll

1.16 KB
Binary file not shown.

source/extras/r3d.pas

+7-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ interface
4242
type
4343
R3D_Flags = Integer;
4444
const
45-
R3D_FLAG_NONE = R3D_Flags(0); //< No special rendering flags.
46-
R3D_FLAG_FXAA = R3D_Flags(1 shl 0); //< Enables Fast Approximate Anti-Aliasing (FXAA).
47-
R3D_FLAG_BLIT_LINEAR = R3D_Flags(1 shl 1); //< Uses linear filtering when blitting the final image.
48-
R3D_FLAG_ASPECT_KEEP = R3D_Flags(1 shl 2); //< Maintains the aspect ratio when rendering.
49-
R3D_FLAG_STENCIL_TEST = R3D_Flags(1 shl 3); //< Performs a stencil test on each rendering pass affecting geometry, useful for outdoor scenes where the sky is dominant.
50-
R3D_FLAG_DEPTH_PREPASS = R3D_Flags(1 shl 4); //< Performs a depth pre-pass before forward rendering, improving desktop GPU performance but unnecessary on mobile.
45+
R3D_FLAG_NONE = R3D_Flags(0); // No special rendering flags
46+
R3D_FLAG_FXAA = R3D_Flags(1 shl 0); // Enables Fast Approximate Anti-Aliasing (FXAA)
47+
R3D_FLAG_BLIT_LINEAR = R3D_Flags(1 shl 1); // Uses linear filtering when blitting the final image
48+
R3D_FLAG_ASPECT_KEEP = R3D_Flags(1 shl 2); // Maintains the aspect ratio of the internal resolution when blitting the final image
49+
R3D_FLAG_STENCIL_TEST = R3D_Flags(1 shl 3); // Performs a stencil test on each rendering pass affecting geometry
50+
R3D_FLAG_DEPTH_PREPASS = R3D_Flags(1 shl 4); // Performs a depth pre-pass before forward rendering, improving desktop GPU performance but unnecessary on mobile
51+
R3D_FLAG_8_BIT_NORMALS = R3D_Flags(1 shl 5); // Use 8-bit precision for the normals buffer (deferred); default is 16-bit float
5152

5253
type
5354
R3D_RenderMode = Integer;

source/extras/raygui.pas

+5-7
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,11 @@ interface
270270
ICON_MLAYERS = 226;
271271
ICON_MAPS = 227;
272272
ICON_HOT = 228;
273-
ICON_229 = 229;
274-
ICON_230 = 230;
275-
ICON_231 = 231;
276-
ICON_232 = 232;
277-
ICON_233 = 233;
273+
ICON_LABEL = 229;
274+
ICON_NAME_ID = 230;
275+
ICON_SLICING = 231;
276+
ICON_MANUAL_CONTROL = 232;
277+
ICON_COLLISION = 233;
278278
ICON_234 = 234;
279279
ICON_235 = 235;
280280
ICON_236 = 236;
@@ -602,8 +602,6 @@ function GuiValueBoxFloat( bounds: TRectangle; const text, textValue: PChar; val
602602
function GuiTextBox(bounds: TRectangle; text: PChar; textSize: Integer; editMode: Boolean): Integer; cdecl; external {$IFNDEF RAY_STATIC}cDllName{$ENDIF} name 'GuiTextBox';
603603
{Slider control}
604604
function GuiSlider(bounds: TRectangle; const textLeft: PChar; const textRight: PChar; value: PSingle; minValue, maxValue: Single): Integer; cdecl; external {$IFNDEF RAY_STATIC}cDllName{$ENDIF} name 'GuiSlider';
605-
{Slider control with extended parameters}
606-
function GuiSliderPro(bounds: TRectangle; const textLeft: PChar; const textRight: PChar; value: PSingle; minValue, maxValue: Single; sliderWidth: Integer): Integer; cdecl; external {$IFNDEF RAY_STATIC}cDllName{$ENDIF} name 'GuiSliderPro';
607605
{Slider Bar control}
608606
function GuiSliderBar(bounds: TRectangle; const textLeft: PChar; const textRight: PChar; value: PSingle; minValue, maxValue: Single): Integer; cdecl; external {$IFNDEF RAY_STATIC}cDllName{$ENDIF} name 'GuiSliderBar';
609607
{Progress Bar control}

source/raylib.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ procedure ToggleBorderlessWindowed; cdecl; external {$IFNDEF RAY_STATIC}cDllName
955955
procedure MaximizeWindow; cdecl; external {$IFNDEF RAY_STATIC}cDllName{$ENDIF} name 'MaximizeWindow';
956956
{Set window state: minimized, if resizable}
957957
procedure MinimizeWindow; cdecl; external {$IFNDEF RAY_STATIC}cDllName{$ENDIF} name 'MinimizeWindow';
958-
{Set window state: not minimized/maximized}
958+
{Restore window from being minimized/maximized}
959959
procedure RestoreWindow; cdecl; external {$IFNDEF RAY_STATIC}cDllName{$ENDIF} name 'RestoreWindow';
960960
{Set icon for window}
961961
procedure SetWindowIcon(image: TImage); cdecl; external {$IFNDEF RAY_STATIC}cDllName{$ENDIF} name 'SetWindowIcon';

0 commit comments

Comments
 (0)