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

Function gfxInit

libctru/source/gfx.c:125–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void gfxInit(GSPGPU_FramebufferFormat topFormat, GSPGPU_FramebufferFormat bottomFormat, bool vrambuffers)
126{
127 if (vrambuffers)
128 {
129 screenAlloc = vramAlloc;
130 screenFree = vramFree;
131 gfxIsVram = true;
132 }
133 else
134 {
135 screenAlloc = linearAlloc;
136 screenFree = linearFree;
137 gfxIsVram = false;
138 }
139
140 // Initialize GSP
141 gspInit();
142
143 // Initialize configuration
144 gfxSet3D(false);
145 gfxSetScreenFormat(GFX_TOP, topFormat);
146 gfxSetScreenFormat(GFX_BOTTOM, bottomFormat);
147 gfxSetDoubleBuffering(GFX_TOP, true);
148 gfxSetDoubleBuffering(GFX_BOTTOM, true);
149
150 // Present the framebuffers
151 gfxCurBuf[0] = gfxCurBuf[1] = 0;
152 gfxPresentFramebuffer(GFX_TOP, 0, false);
153 gfxPresentFramebuffer(GFX_BOTTOM, 0, false);
154
155 // Wait for VBlank and turn the LCD on
156 gspWaitForVBlank();
157 GSPGPU_SetLcdForceBlack(0x0);
158}
159
160void gfxInitDefault(void)
161{

Callers 1

gfxInitDefaultFunction · 0.85

Calls 6

gspInitFunction · 0.85
gfxSet3DFunction · 0.85
gfxSetScreenFormatFunction · 0.85
gfxSetDoubleBufferingFunction · 0.85
gfxPresentFramebufferFunction · 0.85
GSPGPU_SetLcdForceBlackFunction · 0.85

Tested by

no test coverage detected