diff --git a/nx/include/switch/display/gfx.h b/nx/include/switch/display/gfx.h index 060d48a5..ad0aeeb8 100644 --- a/nx/include/switch/display/gfx.h +++ b/nx/include/switch/display/gfx.h @@ -85,6 +85,9 @@ void gfxGetFramebufferResolution(u32* width, u32* height); /// Use this to get the actual byte-size of the framebuffer for use with memset/etc. size_t gfxGetFramebufferSize(void); +/// Use this to get the actual byte-pitch of the framebuffer for use with memset/etc. +u32 gfxGetFramebufferPitch(void); + /// Sets the \ref GfxMode. void gfxSetMode(GfxMode mode); diff --git a/nx/source/display/gfx.c b/nx/source/display/gfx.c index 633d9c7a..ade25ce3 100644 --- a/nx/source/display/gfx.c +++ b/nx/source/display/gfx.c @@ -530,6 +530,10 @@ size_t gfxGetFramebufferSize(void) { return g_gfx_singleframebuf_size; } +u32 gfxGetFramebufferPitch(void) { + return g_gfx_framebuf_aligned_width*4; +} + void gfxSetMode(GfxMode mode) { g_gfxMode = mode; }