Browse Source

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.
pull/5313/head
Ray 1 month ago
parent
commit
bf5c00f7e0
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      src/external/rlsw.h

+ 9
- 0
src/external/rlsw.h 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)

Loading…
Cancel
Save