8 Commits

Author SHA1 Message Date
Ray
ecd15c050a Update rlgl.h 2026-11-17 20:50:53 +01:00
bf52446d03 -Remove doubled depth renderbuffer freeing in cleanup (#6422) 2026-11-17 20:50:01 +01:00
91780fc539 [rcore][drm] Restore the stdin keyboard in ClosePlatform() (#6424)
InitKeyboard() switches the terminal of stdin to non-canonical mode
without echo and signals, and restores it only at exit (atexit). When
InitWindow() is called again after CloseWindow(), InitKeyboard() saves
the modified settings as the defaults, so the terminal is left without
echo and Ctrl-C when the program exits.

Restore the keyboard in ClosePlatform(); the atexit() handler stays for
programs that exit without CloseWindow().
2026-11-17 20:47:48 +01:00
01d3bf67b9 [rcore][drm] Release EGL before the GBM surface and device in ClosePlatform() (#6423)
ClosePlatform() destroyed the GBM surface and device and closed the DRM fd
before destroying the EGL surface, context and display created on them, and
the context was never unbound. eglDestroySurface()/eglTerminate() then work
on freed GBM objects, and the still current context is released only by the
next eglMakeCurrent().

This is not noticed when the process exits after CloseWindow(), but calling
InitWindow() again crashes (SIGSEGV or SIGBUS in the second InitPlatform(),
seen with Mesa Panfrost).

Unbind the context and tear down EGL first, as rcore_android.c does.
2026-11-17 20:47:16 +01:00
6e4b52f9b2 ReiLua_update-6.2. (#6425) 2026-11-17 20:46:12 +01:00
Ray
c2874104e8 Load wave from wav without applying any conversion 2026-11-17 20:40:42 +01:00
Ray
e9ca9f705d Merge branch 'master' of https://github.com/raysan5/raylib 2026-11-17 20:39:53 +01:00
Ray
41f59af2bb Update text_font_sdf.c 2026-11-17 20:39:36 +01:00
6 changed files with 36 additions and 31 deletions

View File

@ -69,7 +69,7 @@ This is a set of recommendations and guidelines for binding authors, meant to he
| [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib | | [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib |
| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.5 | [Lua](http://www.lua.org) | ISC | | [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.5 | [Lua](http://www.lua.org) | ISC |
| [raylib-lua-bindings](https://github.com/legendaryredfox/raylib-lua-bindings) | **6.2** | [Lua](http://www.lua.org) | MIT | | [raylib-lua-bindings](https://github.com/legendaryredfox/raylib-lua-bindings) | **6.2** | [Lua](http://www.lua.org) | MIT |
| [ReiLua](https://github.com/nullstare/ReiLua) | **6.0** | [Lua](http://www.lua.org) | MIT | | [ReiLua](https://github.com/nullstare/ReiLua) | **6.2** | [Lua](http://www.lua.org) | MIT |
| [raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) | 5.5 | [Lua](http://www.lua.org) | Zlib | | [raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) | 5.5 | [Lua](http://www.lua.org) | Zlib |
| [raylib-luajit](https://github.com/homma/raylib-luajit) | 5.5 | [Lua](http://www.lua.org) | MIT | | [raylib-luajit](https://github.com/homma/raylib-luajit) | 5.5 | [Lua](http://www.lua.org) | MIT |
| [raylib-luajit-generated](https://github.com/james2doyle/raylib-luajit-generated) | 5.5 | [Lua](http://www.lua.org) | MIT | | [raylib-luajit-generated](https://github.com/james2doyle/raylib-luajit-generated) | 5.5 | [Lua](http://www.lua.org) | MIT |

View File

@ -334,7 +334,6 @@ int main(void)
rlUnloadTexture(gBuffer.positionTextureId); rlUnloadTexture(gBuffer.positionTextureId);
rlUnloadTexture(gBuffer.normalTextureId); rlUnloadTexture(gBuffer.normalTextureId);
rlUnloadTexture(gBuffer.albedoSpecTextureId); rlUnloadTexture(gBuffer.albedoSpecTextureId);
rlUnloadTexture(gBuffer.depthRenderbufferId);
CloseWindow(); // Close window and OpenGL context CloseWindow(); // Close window and OpenGL context
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------

View File

@ -61,8 +61,7 @@ int main(void)
fontSDF.baseSize = 16; fontSDF.baseSize = 16;
fontSDF.glyphCount = 95; fontSDF.glyphCount = 95;
// Parameters > font size: 16, no glyphs array provided (0), glyphs count: 0 (defaults to 95) // Parameters > font size: 16, no glyphs array provided (0), glyphs count: 0 (defaults to 95)
fontSDF.glyphs = LoadFontData(fileData, fileSize, 16, 0, 0, FONT_SDF, & fontSDF.glyphs = LoadFontData(fileData, fileSize, 16, 0, 0, FONT_SDF, &fontSDF.glyphCount);
fontSDF.glyphCount);
// Parameters > glyphs count: 95, font size: 16, glyphs padding in image: 0 px, pack method: 1 (Skyline algorythm) // Parameters > glyphs count: 95, font size: 16, glyphs padding in image: 0 px, pack method: 1 (Skyline algorythm)
atlas = GenImageFontAtlas(fontSDF.glyphs, &fontSDF.recs, 95, 16, 0, 1); atlas = GenImageFontAtlas(fontSDF.glyphs, &fontSDF.recs, 95, 16, 0, 1);
fontSDF.texture = LoadTextureFromImage(atlas); fontSDF.texture = LoadTextureFromImage(atlas);

View File

@ -1666,6 +1666,30 @@ int InitPlatform(void)
// Close platform // Close platform
void ClosePlatform(void) void ClosePlatform(void)
{ {
#if !defined(GRAPHICS_API_OPENGL_SOFTWARE)
// Close surface, context and display
// NOTE: EGL must be released before the GBM surface and device it was created on
if (platform.device != EGL_NO_DISPLAY)
{
eglMakeCurrent(platform.device, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (platform.surface != EGL_NO_SURFACE)
{
eglDestroySurface(platform.device, platform.surface);
platform.surface = EGL_NO_SURFACE;
}
if (platform.context != EGL_NO_CONTEXT)
{
eglDestroyContext(platform.device, platform.context);
platform.context = EGL_NO_CONTEXT;
}
eglTerminate(platform.device);
platform.device = EGL_NO_DISPLAY;
}
#endif
if (platform.prevFB) if (platform.prevFB)
{ {
drmModeRmFB(platform.fd, platform.prevFB); drmModeRmFB(platform.fd, platform.prevFB);
@ -1712,27 +1736,6 @@ void ClosePlatform(void)
platform.fd = -1; platform.fd = -1;
} }
#if !defined(GRAPHICS_API_OPENGL_SOFTWARE)
// Close surface, context and display
if (platform.device != EGL_NO_DISPLAY)
{
if (platform.surface != EGL_NO_SURFACE)
{
eglDestroySurface(platform.device, platform.surface);
platform.surface = EGL_NO_SURFACE;
}
if (platform.context != EGL_NO_CONTEXT)
{
eglDestroyContext(platform.device, platform.context);
platform.context = EGL_NO_CONTEXT;
}
eglTerminate(platform.device);
platform.device = EGL_NO_DISPLAY;
}
#endif
CORE.Window.shouldClose = true; // Added to force threads to exit when the close window is called CORE.Window.shouldClose = true; // Added to force threads to exit when the close window is called
// Close the evdev devices // Close the evdev devices
@ -1753,6 +1756,12 @@ void ClosePlatform(void)
close(platform.keyboardFd); close(platform.keyboardFd);
platform.keyboardFd = -1; platform.keyboardFd = -1;
} }
#if SUPPORT_SSH_KEYBOARD_RPI
// Restore the terminal now, not only at exit: InitKeyboard() of a later InitWindow()
// would otherwise save the modified settings as the ones to restore
RestoreKeyboard();
#endif
} }
#if SUPPORT_SSH_KEYBOARD_RPI #if SUPPORT_SSH_KEYBOARD_RPI

View File

@ -820,12 +820,10 @@ Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int
{ {
wave.frameCount = (unsigned int)wav.totalPCMFrameCount; wave.frameCount = (unsigned int)wav.totalPCMFrameCount;
wave.sampleRate = wav.sampleRate; wave.sampleRate = wav.sampleRate;
wave.sampleSize = 16; wave.sampleSize = wav.bitsPerSample;
wave.channels = wav.channels; wave.channels = wav.channels;
wave.data = (short *)RL_CALLOC((size_t)wave.frameCount*wave.channels, sizeof(short)); wave.data = RL_CALLOC((size_t)wave.frameCount*wave.channels*wave.sampleSize/8, 1);
drwav_read_pcm_frames(&wav, wave.frameCount, (drwav_int16 *)wave.data);
// NOTE: Forcing conversion to 16bit sample size on reading
drwav_read_pcm_frames_s16(&wav, wave.frameCount, (drwav_int16 *)wave.data);
} }
else TRACELOG(LOG_WARNING, "WAVE: Failed to load WAV data"); else TRACELOG(LOG_WARNING, "WAVE: Failed to load WAV data");

View File

@ -3919,7 +3919,7 @@ bool rlFramebufferComplete(unsigned int id)
} }
// Unload framebuffer from GPU memory // Unload framebuffer from GPU memory
// NOTE: All attached textures/cubemaps/renderbuffers are also deleted // WARNING: All attached depth-textures/renderbuffers are also deleted
void rlUnloadFramebuffer(unsigned int id) void rlUnloadFramebuffer(unsigned int id)
{ {
#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_SOFTWARE)) #if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_SOFTWARE))