Sorry to create another post but this is a totally seperate issue I am pondering over.
I regularly use the Windows GetTickCount() function for timing things within Windows apps.
Is there an equivalent function for NDS development or can someon assist me in writing one?
Alternatively is there a better method for ensureing events are triggered at the right times?
Thanks again,
Tom
Equivalent to Windows GetTickCount();
Re: Equivalent to Windows GetTickCount();
I think most people use vblank for timing stuff. if you want something more acurate, then using the hardware timers will probably be better I think.
as for GetTickCount(), I think its easier to keep a counter yourself and increase it every vblank.
as for GetTickCount(), I think its easier to keep a counter yourself and increase it every vblank.
Re: Equivalent to Windows GetTickCount();
Thanks for the response.vuurrobin wrote:I think most people use vblank for timing stuff. if you want something more acurate, then using the hardware timers will probably be better I think.
as for GetTickCount(), I think its easier to keep a counter yourself and increase it every vblank.
So how do I go about either method? Do I just increment a variable after passing the vblank function call within the main game loop? If so, how do I then turn this into a count for timing?
I am reading bits and pieces about hardware timers...the DS has 4!? How do I implement a timer using these?
Cheers,
Tom
Re: Equivalent to Windows GetTickCount();
incrementing a variable after the waitForVBlank function is probably the easiest, but if your code may take longer than 1 vblank cycle, then setting up a vblank interupt might be more acurate. as for converting it, 60 vblanks takes about 1 second.
I haven't worked with the hardware timers (yet), but looking at the libnds docs might help:
http://libnds.devkitpro.org/a00102.html
I haven't worked with the hardware timers (yet), but looking at the libnds docs might help:
http://libnds.devkitpro.org/a00102.html
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests