examples: Update background scroll before copying frames

Copying a new frame to VRAM takes much longer than updating the scroll,
so it makes sense to update the scroll first as that is guaranteed to
always be fast.
This commit is contained in:
Antonio Niño Díaz 2023-05-20 12:25:14 +01:00
parent 6c221ffea1
commit a097eb3762

View File

@ -167,12 +167,12 @@ int main(int argc, char **argv)
// Wait for the screen refresh
swiWaitForVBlank();
// Update textures of any 3D sprite with "keepframes == true"
NF_Update3dSpritesGfx();
// Update background scroll during vertical blanking to avoid tearing
NF_ScrollBg(0, 1, bg_x, 0);
NF_ScrollBg(0, 2, bg_x / 1.5, 0);
// Update textures of any 3D sprite with "keepframes == true"
NF_Update3dSpritesGfx();
}
return 0;