5 Commits

Author SHA1 Message Date
Ray
6ef0044381 REVIEWED: Window messages WM_SIZING, WM_SIZE, WM_WINDOWPOSCHANGED #5720 2026-04-04 17:37:25 +02:00
Ray
1122add3ee Minor format tweak 2026-04-04 17:36:18 +02:00
Ray
92f82b4add Update raylib.h 2026-04-04 16:50:15 +02:00
Ray
cdff3d7bea Update CHANGELOG 2026-04-04 16:50:10 +02:00
138ef838d9 [rlsw] Some platform fixes (#5720)
* fix drm with rlsw

* fix window resizing with sdl

* fix window resizing with win32
2026-04-04 16:47:33 +02:00
6 changed files with 49 additions and 28 deletions

View File

@ -4,7 +4,7 @@ changelog
Current Release: raylib 5.5 (18 November 2024) Current Release: raylib 5.5 (18 November 2024)
------------------------------------------------------------------------- -------------------------------------------------------------------------
Release: raylib 6.0 (?? March 2026) Release: raylib 6.0 (23 April 2026)
------------------------------------------------------------------------- -------------------------------------------------------------------------
KEY CHANGES: KEY CHANGES:
- New Software Renderer backend [rlsw] - New Software Renderer backend [rlsw]
@ -285,6 +285,7 @@ Detailed changes:
[rtext] REVIEWED: `TextToFloat()`, remove removed inaccurate comment (#4596) by @hexmaster111 [rtext] REVIEWED: `TextToFloat()`, remove removed inaccurate comment (#4596) by @hexmaster111
[rtext] REDESIGNED: `LoadFontData()`, added input parameter by @raysan5 -WARNING- [rtext] REDESIGNED: `LoadFontData()`, added input parameter by @raysan5 -WARNING-
[rmodels] ADDED: Support CPU animation in OpenGL 1.1 (#4925) by @JeffM2501 [rmodels] ADDED: Support CPU animation in OpenGL 1.1 (#4925) by @JeffM2501
[rmodels] REMOVED: `DrawModelPoints()` and `DrawModelPointsEx()`, moved to an example (#5697) by @maiconpintoabreu -WARNING-
[rmodels] RENAMED: Skinning shader variables (new default naming) by @raysan5 [rmodels] RENAMED: Skinning shader variables (new default naming) by @raysan5
[rmodels] REVIEWED: glTF animation framerate calculation (#4472, #5445) by @TheLazyIndianTechie [rmodels] REVIEWED: glTF animation framerate calculation (#4472, #5445) by @TheLazyIndianTechie
[rmodels] REVIEWED: Assign meshes without bone weights to the bone they are attached to so they animate by @Jeffm2501 [rmodels] REVIEWED: Assign meshes without bone weights to the bone they are attached to so they animate by @Jeffm2501
@ -311,6 +312,7 @@ Detailed changes:
[rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, properly load 1 frame animations (#5561) by @arlez80 [rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, properly load 1 frame animations (#5561) by @arlez80
[rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, anim correctly inherits world transform (#5206) by @ArmanOmmid [rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, anim correctly inherits world transform (#5206) by @ArmanOmmid
[rmodels] REVIEWED: `UploadMesh()`, improve default normal and tangent values (#4763) by @Bigfoot71 [rmodels] REVIEWED: `UploadMesh()`, improve default normal and tangent values (#4763) by @Bigfoot71
[rmodels] REVIEWED: `UplaodMesh()`, fix for devices without VAO support (#5692) by @psxdev
[rmodels] REVIEWED: `GenMeshTangents()`, improvements (#4937) by @Bigfoot71 [rmodels] REVIEWED: `GenMeshTangents()`, improvements (#4937) by @Bigfoot71
[rmodels] REVIEWED: `UpdateModelAnimation()` optimization (#5244) by @Arrangemonk [rmodels] REVIEWED: `UpdateModelAnimation()` optimization (#5244) by @Arrangemonk
[rmodels] REVIEWED: `UpdateModelAnimationBones()`, break on first mesh found and formating by @raysan5 [rmodels] REVIEWED: `UpdateModelAnimationBones()`, break on first mesh found and formating by @raysan5
@ -322,6 +324,7 @@ Detailed changes:
[rmodels] REVIEWED: `DrawMeshInstanced()`, breaking if instanceTransform was unused (#5469) by @al13n321 [rmodels] REVIEWED: `DrawMeshInstanced()`, breaking if instanceTransform was unused (#5469) by @al13n321
[rmodels] REVIEWED: `DrawSphereEx()`, normals support (#4926) by @karl-zylinski [rmodels] REVIEWED: `DrawSphereEx()`, normals support (#4926) by @karl-zylinski
[rmodels] REVIEWED: `ExportMesh()`, improve OBJ vertex data precision and lower memory usage (#4496) by @mikeemm [rmodels] REVIEWED: `ExportMesh()`, improve OBJ vertex data precision and lower memory usage (#4496) by @mikeemm
[rmodels] REVIEWED: `CheckCollisionSpheres()`, simplified using `Vector3DistanceSqr()` (#5695) by @Bigfoot71
[raudio] REVIEWED: Fix a glitch at the end of a sound (#5578) by @mackron [raudio] REVIEWED: Fix a glitch at the end of a sound (#5578) by @mackron
[raudio] REVIEWED: Improvements to device configuration (#5577) by @mackron [raudio] REVIEWED: Improvements to device configuration (#5577) by @mackron
[raudio] REVIEWED: Initialize sound alias properties as if it was a new sound (#5123) by @JeffM2501 [raudio] REVIEWED: Initialize sound alias properties as if it was a new sound (#5123) by @JeffM2501

10
src/external/rlsw.h vendored
View File

@ -2357,7 +2357,8 @@ static inline bool sw_texture_alloc(sw_texture_t *texture, const void *data, int
sw_pixel_read_color8_f readColor8 = NULL; sw_pixel_read_color8_f readColor8 = NULL;
sw_pixel_read_color_f readColor = NULL; sw_pixel_read_color_f readColor = NULL;
if (!isDepth) { if (!isDepth)
{
readColor8 = sw_pixel_get_read_color8_func(format); readColor8 = sw_pixel_get_read_color8_func(format);
readColor = sw_pixel_get_read_color_func(format); readColor = sw_pixel_get_read_color_func(format);
} }
@ -2803,7 +2804,8 @@ static const sw_blend_f SW_BLEND_TABLE[SW_BLEND_FACTOR_COUNT][SW_BLEND_FACTOR_CO
// Maps a GL blend factor enum to its compact table index // Maps a GL blend factor enum to its compact table index
static inline int sw_blend_factor_index(SWfactor f) static inline int sw_blend_factor_index(SWfactor f)
{ {
switch (f) { switch (f)
{
case SW_ZERO: return 0; case SW_ZERO: return 0;
case SW_ONE: return 1; case SW_ONE: return 1;
case SW_SRC_COLOR: return 2; case SW_SRC_COLOR: return 2;
@ -2821,7 +2823,8 @@ static inline int sw_blend_factor_index(SWfactor f)
static bool sw_blend_factor_needs_alpha(SWfactor f) static bool sw_blend_factor_needs_alpha(SWfactor f)
{ {
switch (f) { switch (f)
{
case SW_SRC_ALPHA: case SW_SRC_ALPHA:
case SW_ONE_MINUS_SRC_ALPHA: case SW_ONE_MINUS_SRC_ALPHA:
case SW_DST_ALPHA: case SW_DST_ALPHA:
@ -2829,6 +2832,7 @@ static bool sw_blend_factor_needs_alpha(SWfactor f)
case SW_SRC_ALPHA_SATURATE: return true; case SW_SRC_ALPHA_SATURATE: return true;
default: break; default: break;
} }
return false; return false;
} }

View File

@ -1528,6 +1528,10 @@ void PollInputEvents(void)
if ((width + borderLeft + borderRight != usableBounds.w) && (height + borderTop + borderBottom != usableBounds.h)) FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED); if ((width + borderLeft + borderRight != usableBounds.w) && (height + borderTop + borderBottom != usableBounds.h)) FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED);
} }
#endif #endif
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
swResize(width, height);
#endif
} break; } break;
case SDL_WINDOWEVENT_ENTER: CORE.Input.Mouse.cursorOnScreen = true; break; case SDL_WINDOWEVENT_ENTER: CORE.Input.Mouse.cursorOnScreen = true; break;

View File

@ -1063,14 +1063,14 @@ Vector2 GetMonitorPosition(int monitor)
// Get selected monitor width (currently used by monitor) // Get selected monitor width (currently used by monitor)
int GetMonitorWidth(int monitor) int GetMonitorWidth(int monitor)
{ {
TRACELOG(LOG_WARNING, "GetMonitorWidth not implemented"); //TRACELOG(LOG_WARNING, "GetMonitorWidth not implemented");
return 0; return 0;
} }
// Get selected monitor height (currently used by monitor) // Get selected monitor height (currently used by monitor)
int GetMonitorHeight(int monitor) int GetMonitorHeight(int monitor)
{ {
TRACELOG(LOG_WARNING, "GetMonitorHeight not implemented"); //TRACELOG(LOG_WARNING, "GetMonitorHeight not implemented");
return 0; return 0;
} }
@ -1105,7 +1105,7 @@ const char *GetMonitorName(int monitor)
// Get window position XY on monitor // Get window position XY on monitor
Vector2 GetWindowPosition(void) Vector2 GetWindowPosition(void)
{ {
TRACELOG(LOG_WARNING, "GetWindowPosition not implemented"); //TRACELOG(LOG_WARNING, "GetWindowPosition not implemented");
return (Vector2){ 0, 0 }; return (Vector2){ 0, 0 };
} }
@ -1760,13 +1760,31 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpara
memset(CORE.Input.Keyboard.previousKeyState, 0, sizeof(CORE.Input.Keyboard.previousKeyState)); memset(CORE.Input.Keyboard.previousKeyState, 0, sizeof(CORE.Input.Keyboard.previousKeyState));
memset(CORE.Input.Keyboard.currentKeyState, 0, sizeof(CORE.Input.Keyboard.currentKeyState)); memset(CORE.Input.Keyboard.currentKeyState, 0, sizeof(CORE.Input.Keyboard.currentKeyState));
} break; } break;
case WM_SIZING: case WM_SIZING: // Sent to a window that the user is resizing
{ {
if (!(CORE.Window.flags & FLAG_WINDOW_RESIZABLE)) if (CORE.Window.flags & FLAG_WINDOW_RESIZABLE)
TRACELOG(LOG_WARNING, "WIN32: WINDOW: Trying to resize a non-resizable window"); {
//HandleWindowResize(hwnd, &platform.appScreenWidth, &platform.appScreenHeight);
}
result = TRUE; result = TRUE;
} break; } break;
case WM_SIZE:
{
// WARNING: Don't trust the docs, they say this message can not be obtained if not calling DefWindowProc()
// in response to WM_WINDOWPOSCHANGED but looks like when a window is created,
// this message can be obtained without getting WM_WINDOWPOSCHANGED
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
// WARNING: Waiting two frames before resizing because software-renderer backend is initilized with swInit() later
// than InitPlatform(), that triggers WM_SIZE, so avoid crashing
if (CORE.Time.frameCounter > 2) HandleWindowResize(hwnd, &platform.appScreenWidth, &platform.appScreenHeight);
#else
// NOTE: This message is only triggered on window creation
HandleWindowResize(hwnd, &platform.appScreenWidth, &platform.appScreenHeight);
#endif
result = 0; // If an application processes WM_SIZE message, it should return zero
} break;
case WM_GETMINMAXINFO: case WM_GETMINMAXINFO:
{ {
DWORD style = MakeWindowStyle(platform.desiredFlags); DWORD style = MakeWindowStyle(platform.desiredFlags);
@ -1865,19 +1883,13 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpara
default: break; default: break;
} }
} break; } break;
case WM_SIZE: //case WM_MOVE: break;
{
// WARNING: Don't trust the docs, they say this message can not be obtained if not calling DefWindowProc()
// in response to WM_WINDOWPOSCHANGED but looks like when a window is created,
// this message can be obtained without getting WM_WINDOWPOSCHANGED
// WARNING: This call fails for Software-Renderer backend
//HandleWindowResize(hwnd, &platform.appScreenWidth, &platform.appScreenHeight);
} break;
//case WM_MOVE
case WM_WINDOWPOSCHANGED: case WM_WINDOWPOSCHANGED:
{ {
WINDOWPOS *pos = (WINDOWPOS*)lparam; WINDOWPOS *pos = (WINDOWPOS*)lparam;
if (!(pos->flags & SWP_NOSIZE)) HandleWindowResize(hwnd, &platform.appScreenWidth, &platform.appScreenHeight); if (!(pos->flags & SWP_NOSIZE)) HandleWindowResize(hwnd, &platform.appScreenWidth, &platform.appScreenHeight);
DefWindowProc(hwnd, msg, wparam, lparam);
} break; } break;
case WM_GETDPISCALEDSIZE: case WM_GETDPISCALEDSIZE:
{ {
@ -2091,6 +2103,10 @@ static void HandleWindowResize(HWND hwnd, int *width, int *height)
CORE.Window.screenScale = MatrixScale( (float)CORE.Window.render.width/CORE.Window.screen.width, CORE.Window.screenScale = MatrixScale( (float)CORE.Window.render.width/CORE.Window.screen.width,
(float)CORE.Window.render.height/CORE.Window.screen.height, 1.0f); (float)CORE.Window.render.height/CORE.Window.screen.height, 1.0f);
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
swResize(clientSize.cx, clientSize.cy);
#endif
} }
// Update window style // Update window style

View File

@ -837,14 +837,8 @@ void SwapScreenBuffer(void)
uint32_t height = mode->vdisplay; uint32_t height = mode->vdisplay;
// Dumb buffers use a fixed format based on bpp // Dumb buffers use a fixed format based on bpp
#if SW_COLOR_BUFFER_BITS == 24
const uint32_t bpp = 32; // 32 bits per pixel (XRGB8888 format) const uint32_t bpp = 32; // 32 bits per pixel (XRGB8888 format)
const uint32_t depth = 24; // Color depth, here only 24 bits, alpha is not used const uint32_t depth = 24; // Color depth, here only 24 bits, alpha is not used
#else
// REVIEW: Not sure how it will be interpreted (RGB or RGBA?)
const uint32_t bpp = SW_COLOR_BUFFER_BITS;
const uint32_t depth = SW_COLOR_BUFFER_BITS;
#endif
// Create a dumb buffer for software rendering // Create a dumb buffer for software rendering
struct drm_mode_create_dumb creq = { 0 }; struct drm_mode_create_dumb creq = { 0 };
@ -899,7 +893,7 @@ void SwapScreenBuffer(void)
// Copy the software rendered buffer to the dumb buffer with scaling if needed // Copy the software rendered buffer to the dumb buffer with scaling if needed
// NOTE: RLSW will make a simple copy if the dimensions match // NOTE: RLSW will make a simple copy if the dimensions match
swBlitFramebuffer(0, 0, width, height, 0, 0, width, height, SW_RGBA, SW_UNSIGNED_BYTE, dumbBuffer); swBlitPixels(0, 0, width, height, 0, 0, width, height, SW_RGBA, SW_UNSIGNED_BYTE, dumbBuffer);
// Unmap the buffer // Unmap the buffer
munmap(dumbBuffer, creq.size); munmap(dumbBuffer, creq.size);

View File

@ -1539,11 +1539,11 @@ RLAPI const char *TextSubtext(const char *text, int position, int length);
RLAPI const char *TextRemoveSpaces(const char *text); // Remove text spaces, concat words RLAPI const char *TextRemoveSpaces(const char *text); // Remove text spaces, concat words
RLAPI char *GetTextBetween(const char *text, const char *begin, const char *end); // Get text between two strings RLAPI char *GetTextBetween(const char *text, const char *begin, const char *end); // Get text between two strings
RLAPI char *TextReplace(const char *text, const char *search, const char *replacement); // Replace text string with new string RLAPI char *TextReplace(const char *text, const char *search, const char *replacement); // Replace text string with new string
RLAPI char *TextReplaceAlloc(const char *text, const char *search, const char *replacement); // Replace text string with new string, memory must be MemFree() RLAPI char *TextReplaceAlloc(const char *text, const char *search, const char *replacement); // Replace text string with new string, memory must be MemFree()
RLAPI char *TextReplaceBetween(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings RLAPI char *TextReplaceBetween(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings
RLAPI char *TextReplaceBetweenAlloc(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings, memory must be MemFree() RLAPI char *TextReplaceBetweenAlloc(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings, memory must be MemFree()
RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a defined byte position RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a defined byte position
RLAPI char *TextInsertAlloc(const char *text, const char *insert, int position); // Insert text in a defined byte position, memory must be MemFree() RLAPI char *TextInsertAlloc(const char *text, const char *insert, int position); // Insert text in a defined byte position, memory must be MemFree()
RLAPI char *TextJoin(char **textList, int count, const char *delimiter); // Join text strings with delimiter RLAPI char *TextJoin(char **textList, int count, const char *delimiter); // Join text strings with delimiter
RLAPI char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings RLAPI char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings
RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor