So i'm trying to write a program on the DS (in c++ command line only) and i have come across a bit of a problem. I need the program to stop for a set amount of time so that it is not all processing fast, however I do not want it to stop or make the user have to press a button to continue. See I need to do what the Sleep() function in the windows.h header does but as this does not work for the compiler I need an alternative.
Please help.
making the DS pause for a set amount of time
-
- Posts: 1
- Joined: Mon Sep 12, 2011 11:57 am
-
- Site Admin
- Posts: 2004
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: making the DS pause for a set amount of time
The easiest way to do this is just call swiWaitForVBlank multiple times, i.e. for a 1 second pause use something like
for longer/shorter delays then just muliply the number of seconds you want by 60.
Code: Select all
int count = 60;
while(count--) swiWaitForVBlank;
Who is online
Users browsing this forum: No registered users and 2 guests