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

Function gfxGetFramebuffer

libctru/source/gfx.c:192–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192u8* gfxGetFramebuffer(gfxScreen_t screen, gfx3dSide_t side, u16* width, u16* height)
193{
194 unsigned id = gfxCurBuf[screen]^gfxIsDoubleBuf[screen];
195 unsigned scr_width = GSP_SCREEN_WIDTH;
196 unsigned scr_height;
197 u8* fb;
198
199 if (screen == GFX_TOP)
200 {
201 fb = gfxTopFramebuffers[id];
202 scr_height = GSP_SCREEN_HEIGHT_TOP;
203 switch (gfxTopMode)
204 {
205 default:
206 case MODE_2D:
207 break;
208 case MODE_3D:
209 if (side != GFX_LEFT)
210 fb += gfxTopFramebufferMaxSize/2;
211 break;
212 case MODE_WIDE:
213 scr_height = GSP_SCREEN_HEIGHT_TOP_2X;
214 break;
215 }
216 }
217 else // GFX_BOTTOM
218 {
219 fb = gfxBottomFramebuffers[id];
220 scr_height = GSP_SCREEN_HEIGHT_BOTTOM;
221 }
222
223 if (width)
224 *width = scr_width;
225 if (height)
226 *height = scr_height;
227
228 return fb;
229}
230
231void gfxFlushBuffers(void)
232{

Callers 2

gfxFlushBuffersFunction · 0.85
consoleInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected