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.
This commit is contained in:
Ray
2025-10-28 20:57:31 +01:00
parent a844a943b5
commit bf5c00f7e0

9
src/external/rlsw.h vendored
View File

@@ -531,6 +531,7 @@ SWAPI void swClose(void);
SWAPI bool swResizeFramebuffer(int w, int h); 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 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 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 swEnable(SWstate state);
SWAPI void swDisable(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) void swEnable(SWstate state)
{ {
switch (state) switch (state)