diff --git a/nx/include/switch/gfx/gfx.h b/nx/include/switch/gfx/gfx.h index 513038cc..763c4405 100644 --- a/nx/include/switch/gfx/gfx.h +++ b/nx/include/switch/gfx/gfx.h @@ -13,6 +13,7 @@ void gfxExit(void); void gfxWaitForVsync(); void gfxSwapBuffers(); u8* gfxGetFramebuffer(u32* width, u32* height); +size_t gfxGetFramebufferSize(void); /// Use this to get the actual byte-size of the buffer for use with memset/etc, do not calculate the byte-size manually with the width and height from gfxGetFramebuffer. The height returned by gfxGetFramebuffer is the display height not the aligned height. void gfxSetDoubleBuffering(bool doubleBuffering); void gfxFlushBuffers(void); diff --git a/nx/source/gfx/gfx.c b/nx/source/gfx/gfx.c index 012f2c28..f9711c7c 100644 --- a/nx/source/gfx/gfx.c +++ b/nx/source/gfx/gfx.c @@ -326,6 +326,10 @@ u8* gfxGetFramebuffer(u32* width, u32* height) { return &g_gfxFramebuf[g_gfxCurrentBuffer*g_nvgfx_singleframebuf_size]; } +size_t gfxGetFramebufferSize(void) { + return g_nvgfx_singleframebuf_size; +} + void gfxSetDoubleBuffering(bool doubleBuffering) { g_gfxDoubleBuf = doubleBuffering; }