mirror of
https://github.com/encounter/SDL.git
synced 2025-06-15 11:03:36 +00:00
switch: fix clear framebuffers
This commit is contained in:
parent
b2f8a546da
commit
3b41de6ba9
@ -148,18 +148,23 @@ static void SWITCH_PumpEvents(_THIS)
|
|||||||
static void SWITCH_SetResolution(u32 width, u32 height)
|
static void SWITCH_SetResolution(u32 width, u32 height)
|
||||||
{
|
{
|
||||||
u32 x, y, w, h, i;
|
u32 x, y, w, h, i;
|
||||||
u32 *fb = (u32 *) gfxGetFramebuffer(&w, &h);
|
u32 *fb;
|
||||||
|
|
||||||
// clear "old" fb
|
// clear framebuffers before switching res
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
|
|
||||||
|
fb = (u32 *) gfxGetFramebuffer(&w, &h);
|
||||||
|
|
||||||
for (y = 0; y < h; y++) {
|
for (y = 0; y < h; y++) {
|
||||||
for (x = 0; x < w; x++) {
|
for (x = 0; x < w; x++) {
|
||||||
fb[gfxGetFramebufferDisplayOffset(x, y)] =
|
fb[gfxGetFramebufferDisplayOffset(x, y)] =
|
||||||
(u32) RGBA8_MAXALPHA(0, 0, 0);
|
(u32) RGBA8_MAXALPHA(0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxFlushBuffers();
|
gfxFlushBuffers();
|
||||||
gfxSwapBuffers();
|
gfxSwapBuffers();
|
||||||
|
gfxWaitForVsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxConfigureResolution(width, height);
|
gfxConfigureResolution(width, height);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user