mirror of
https://github.com/knightfox75/nds_nflib.git
synced 2025-06-18 16:55:32 -04:00
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:
parent
6c221ffea1
commit
a097eb3762
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user