[SDL] Increment after time

Alan Wolfe Atrix2 at cox.net
Fri Sep 22 21:49:16 PDT 2006


I garauntee you it works when implemented properly.

 

Here's what I recommend. (:

 

Go to gameprogrammer.com and subscribe to the mailing list and post your
question there.

 

That list is more for game programming techniques where this one is just
about sdl, problems using it, etc.

 

Lots of people here are members of that list (myself included!) so go on
over and let's discuss this more (:

 

  _____  

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:43 PM
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] Increment after time

 

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/20060922/f65dc6d4/attachment-0008.htm>


More information about the SDL mailing list