? VS​YNC ● SmileBASIC Source

Sign In

*Usernames are case-sensitive
Forgot my password

Migrating to a new website for SmileBASIC 4


VSYNC [ frames ] VSYNC n will pause the program until n frames (screen updates, which happen 60 times per second) have passed since the last time VSYNC or WAIT was called. If no value is given, it defaults to 1. The main use of VSYNC is to limit the speed of your code. The 3DS's screen only updates (approximately) 60 times per second, so drawing graphics more often is pointless. This program will flicker, and the filled area will barely be visible: WHILE 1 GCLS GFILL 50,50,200,200 WEND To fix this, use VSYNC: WHILE 1 GCLS GFILL 50,50,200,200 VSYNC 'vsync after you finish drawing WEND This will let the screen update after you're finished drawing. Otherwise, you'll end up clearing the screen before the 3DS has a chance to display what was there. If you want your code to run at 30 FPS, you can use VSYNC 2. However, you'll have to use page swapping to avoid flicker.
3 votes
1 Comment(s) MochaProbably MochaProbably Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Drawing I like to draw! Hobbies Page swapping : BUFFER = !BUFFER GPAGE BUFFER, !BUFFER