Skip to content

Commit bf5c00f

Browse files
committed
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.
1 parent a844a94 commit bf5c00f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/external/rlsw.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ SWAPI void swClose(void);
531531
SWAPI bool swResizeFramebuffer(int w, int h);
532532
SWAPI void swCopyFramebuffer(int x, int y, int w, int h, SWformat format, SWtype type, void *pixels);
533533
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);
534+
SWAPI void *swGetColorBuffer(int *w, int *h);
534535

535536
SWAPI void swEnable(SWstate state);
536537
SWAPI void swDisable(SWstate state);
@@ -3695,6 +3696,14 @@ void swBlitFramebuffer(int xDst, int yDst, int wDst, int hDst, int xSrc, int ySr
36953696
}
36963697
}
36973698

3699+
void *swGetColorBuffer(int *w, int *h)
3700+
{
3701+
if (w) *w = RLSW.framebuffer.width;
3702+
if (h) *h = RLSW.framebuffer.height;
3703+
3704+
return (void *)RLSW.framebuffer.pixels->color;
3705+
}
3706+
36983707
void swEnable(SWstate state)
36993708
{
37003709
switch (state)

0 commit comments

Comments
 (0)