Remove unused pointer and give swSwapColorBuffers a default nop-behaviour

This commit is contained in:
Colin James Wood 2026-07-19 14:37:03 +01:00
commit addaa0c0c8

14
src/external/rlsw.h vendored
View file

@ -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 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 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 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 SWAPI void swSwapColorBuffers(void); // Swap software renderer color/back buffers by pointer only
#endif
SWAPI void swEnable(SWstate state); SWAPI void swEnable(SWstate state);
SWAPI void swDisable(SWstate state); SWAPI void swDisable(SWstate state);
@ -1067,9 +1065,7 @@ typedef struct {
sw_handle_t boundFramebufferId; // Framebuffer currently bound sw_handle_t boundFramebufferId; // Framebuffer currently bound
sw_texture_t *colorBuffer; // Color buffer currently bound sw_texture_t *colorBuffer; // Color buffer currently bound
#ifdef RLSW_BACKBUFFER // NOTE: don't need backBuffer because it's already in the sw_default_framebuffer_t struct.
sw_texture_t *colorBackBuffer;
#endif
sw_texture_t *depthBuffer; // Depth buffer currently bound sw_texture_t *depthBuffer; // Depth buffer currently bound
sw_pool_t framebufferPool; // Framebuffer object pool sw_pool_t framebufferPool; // Framebuffer object pool
@ -4180,17 +4176,21 @@ void *swGetColorBuffer(int *width, int *height)
return RLSW.framebuffer.color.pixels; return RLSW.framebuffer.color.pixels;
} }
#ifdef RLSW_BACKBUFFER
void swSwapColorBuffers(void) void swSwapColorBuffers(void)
{ {
#ifdef RLSW_BACKBUFFER
sw_texture_t tmp = RLSW.framebuffer.color; sw_texture_t tmp = RLSW.framebuffer.color;
RLSW.framebuffer.color = RLSW.framebuffer.backColor; RLSW.framebuffer.color = RLSW.framebuffer.backColor;
RLSW.framebuffer.backColor = tmp; RLSW.framebuffer.backColor = tmp;
RLSW.colorBuffer = &RLSW.framebuffer.color; RLSW.colorBuffer = &RLSW.framebuffer.color;
RLSW.colorBackBuffer = &RLSW.framebuffer.backColor; RLSW.colorBackBuffer = &RLSW.framebuffer.backColor;
} #else
TRACELOG(LOG_WARNING, "swSwapColorBuffers not enabled (#define RLSW_BACKBUFFER with a compiler option to enable).");
#endif #endif
}
void swEnable(SWstate state) void swEnable(SWstate state)
{ {