From addaa0c0c871f43a5721768c248c6bdf0bc7fc6b Mon Sep 17 00:00:00 2001 From: Colin James Wood Date: Sun, 19 Jul 2026 14:37:03 +0100 Subject: [PATCH] Remove unused pointer and give swSwapColorBuffers a default nop-behaviour --- src/external/rlsw.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/external/rlsw.h b/src/external/rlsw.h index 9f7a1e598..67011c966 100644 --- a/src/external/rlsw.h +++ b/src/external/rlsw.h @@ -677,9 +677,7 @@ SWAPI bool swResize(int w, int h); SWAPI void swReadPixels(int x, int y, int w, int h, SWformat format, SWtype type, void *pixels); SWAPI void swBlitPixels(int xDst, int yDst, int wDst, int hDst, int xSrc, int ySrc, int wSrc, int hSrc, SWformat format, SWtype type, void *pixels); SWAPI void *swGetColorBuffer(int *width, int *height); // Restored for ESP-IDF compatibility -#ifdef RLSW_BACKBUFFER SWAPI void swSwapColorBuffers(void); // Swap software renderer color/back buffers by pointer only -#endif SWAPI void swEnable(SWstate state); SWAPI void swDisable(SWstate state); @@ -1067,9 +1065,7 @@ typedef struct { sw_handle_t boundFramebufferId; // Framebuffer currently bound sw_texture_t *colorBuffer; // Color buffer currently bound -#ifdef RLSW_BACKBUFFER - sw_texture_t *colorBackBuffer; -#endif + // NOTE: don't need backBuffer because it's already in the sw_default_framebuffer_t struct. sw_texture_t *depthBuffer; // Depth buffer currently bound sw_pool_t framebufferPool; // Framebuffer object pool @@ -4180,17 +4176,21 @@ void *swGetColorBuffer(int *width, int *height) return RLSW.framebuffer.color.pixels; } -#ifdef RLSW_BACKBUFFER + void swSwapColorBuffers(void) { +#ifdef RLSW_BACKBUFFER sw_texture_t tmp = RLSW.framebuffer.color; RLSW.framebuffer.color = RLSW.framebuffer.backColor; RLSW.framebuffer.backColor = tmp; RLSW.colorBuffer = &RLSW.framebuffer.color; RLSW.colorBackBuffer = &RLSW.framebuffer.backColor; -} +#else + TRACELOG(LOG_WARNING, "swSwapColorBuffers not enabled (#define RLSW_BACKBUFFER with a compiler option to enable)."); #endif +} + void swEnable(SWstate state) {