[SDL] Increment after time

Sahan Chandrasekara sahanthegamecreator at gmail.com
Fri Sep 22 21:43:08 PDT 2006


It dosen't work :(

Timers never work in my game - the regulating frame rate from Lazy Foo's
website didn't work either

On 9/23/06, Alan Wolfe <Atrix2 at cox.net> wrote:
>
>  There is a function called SDL_GetTicks() which returns a number of
> milliseconds that sdl has been running (I think that's what it measures but
> am not 100% sure).
>
>
>
> You can call that function to get the number of milliseconds of when your
> program starts up and then you can check in your game loop to see if
> SDL_GetTicks() is 5000 greater than your first measurement (5000 miliseconds
> = 5 seconds), if it is then you can increment your variable or whatever you
> want to do after 5 seconds.
>
>
>  ------------------------------
>
> *From:* sdl-bounces+atrix2=cox.net at libsdl.org [mailto:
> sdl-bounces+atrix2=cox.net at libsdl.org] *On Behalf Of *Sahan Chandrasekara
> *Sent:* Friday, September 22, 2006 9:32 PM
> *To:* A list for developers using the SDL library. (includes SDL-announce)
> *Subject:* [SDL] Increment after time
>
>
>
> My game has lots of bugs at the moment :(
>
> The main problem I have right now is that I want the variable area,
> initialized to 0 globally, to be incremented after five seconds.
>
> Any idea how I would do this?
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>
>
>


-- 
Sahan Chandrasekara

Get a free sony psp at http://psps.freepay.com/?r=30890215 (not a scam)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060923/6b2133ad/attachment-0008.htm>


More information about the SDL mailing list