mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
gfx: Add a buffer index to gfxGetFramebufferHandle().
This commit is contained in:
parent
4f331eb9f7
commit
e234129598
@ -73,8 +73,8 @@ void gfxWaitForVsync(void);
|
||||
/// Swaps the framebuffers (for double-buffering).
|
||||
void gfxSwapBuffers(void);
|
||||
|
||||
/// Get the current framebuffer nvmap handle, with optional output ptrs for the current offset in the buffer.
|
||||
u32 gfxGetFramebufferHandle(u32* offset);
|
||||
/// Get the specified framebuffer nvmap handle where index specifies the buffer number beginning with the back buffer, with optional output ptr for the offset in the buffer.
|
||||
u32 gfxGetFramebufferHandle(u32 index, u32* offset);
|
||||
|
||||
/// Get the current framebuffer address, with optional output ptrs for the display framebuffer width/height. The display width/height is adjusted by \ref gfxConfigureCrop and \ref gfxConfigureResolution.
|
||||
u8* gfxGetFramebuffer(u32* width, u32* height);
|
||||
|
@ -503,8 +503,11 @@ void gfxSwapBuffers(void) {
|
||||
if (R_FAILED(rc)) fatalSimple(MAKERESULT(Module_Libnx, LibnxError_BadGfxDequeueBuffer));
|
||||
}
|
||||
|
||||
u32 gfxGetFramebufferHandle(u32* offset) {
|
||||
if (offset) *offset = g_gfxCurrentBuffer*g_gfx_singleframebuf_size;
|
||||
u32 gfxGetFramebufferHandle(u32 index, u32* offset) {
|
||||
if (offset) {
|
||||
index = (g_gfxCurrentBuffer + index) & (g_nvgfx_totalframebufs-1);
|
||||
*offset = index*g_gfx_singleframebuf_size;
|
||||
}
|
||||
return g_gfxFramebufHandle;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user