From bf5c00f7e063ee0d236a48a9ba2be799d84c8b4c Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 28 Oct 2025 20:57:31 +0100 Subject: [PATCH] RE-ADDED: `swGetColorBuffer()` for convenience #5312 `PLATFORM_DRM` depends on it but if there is a better approach to get the buffer, it can just be removed again and replaced by alternative. --- src/external/rlsw.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/external/rlsw.h b/src/external/rlsw.h index 6f59bba95..f6c15ee1d 100644 --- a/src/external/rlsw.h +++ b/src/external/rlsw.h @@ -531,6 +531,7 @@ SWAPI void swClose(void); SWAPI bool swResizeFramebuffer(int w, int h); SWAPI void swCopyFramebuffer(int x, int y, int w, int h, SWformat format, SWtype type, void *pixels); SWAPI void swBlitFramebuffer(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 *w, int *h); SWAPI void swEnable(SWstate state); SWAPI void swDisable(SWstate state); @@ -3695,6 +3696,14 @@ void swBlitFramebuffer(int xDst, int yDst, int wDst, int hDst, int xSrc, int ySr } } +void *swGetColorBuffer(int *w, int *h) +{ + if (w) *w = RLSW.framebuffer.width; + if (h) *h = RLSW.framebuffer.height; + + return (void *)RLSW.framebuffer.pixels->color; +} + void swEnable(SWstate state) { switch (state)