MCPcopy Create free account
hub / github.com/devkitPro/libctru / gfxPresentFramebuffer

Function gfxPresentFramebuffer

libctru/source/gfx.c:86–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86static void gfxPresentFramebuffer(gfxScreen_t screen, u8 id, bool hasStereo)
87{
88 u32 stride = GSP_SCREEN_WIDTH*gspGetBytesPerPixel(gfxFramebufferFormats[screen]);
89 u32 mode = gfxFramebufferFormats[screen];
90
91 const u8 *fb_a, *fb_b;
92 if (screen == GFX_TOP)
93 {
94 fb_a = gfxTopFramebuffers[id];
95 switch (gfxTopMode)
96 {
97 default:
98 case MODE_2D:
99 mode |= BIT(6);
100 fb_b = fb_a;
101 break;
102 case MODE_3D:
103 mode |= BIT(5);
104 fb_b = hasStereo ? (fb_a + gfxTopFramebufferMaxSize/2) : fb_a;
105 break;
106 case MODE_WIDE:
107 fb_b = fb_a;
108 break;
109 }
110 }
111 else
112 {
113 fb_a = gfxBottomFramebuffers[id];
114 fb_b = fb_a;
115 }
116
117 if (!gfxIsVram)
118 mode |= 1<<8;
119 else
120 mode |= 3<<8;
121
122 gspPresentBuffer(screen, id, fb_a, fb_b, stride, mode);
123}
124
125void gfxInit(GSPGPU_FramebufferFormat topFormat, GSPGPU_FramebufferFormat bottomFormat, bool vrambuffers)
126{

Callers 2

gfxInitFunction · 0.85
gfxScreenSwapBuffersFunction · 0.85

Calls 2

gspGetBytesPerPixelFunction · 0.85
gspPresentBufferFunction · 0.85

Tested by

no test coverage detected