Documentation incomplete?

I just wanted to have a look in the API reference to find out the syntax
for Timers.
But to my surprise I had to find out that it wasn’t there?!?

Looks like the Doc is not very up to date!?

Maby one should fix this, as maybe other things are missing as well.

Yours, Christian–
Christian Biesinger
Get Paid To Surf:
http://www.AdOne.de/startup.php?werber=45130
Hi! I’m a signature virus! Copy me into your signature file to help me
spread!

I just wanted to have a look in the API reference to find out the syntax
for Timers.
But to my surprise I had to find out that it wasn’t there?!?

Looks like the Doc is not very up to date!?

It is up to date, but the timers, endian, and file code are not documented.
The file code API may change in the future. The others are simple enough
that the example code and tutorials and headers should be enough.

Of course, I accept donations of documentation. :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

The only timer I know of is SDL_GetTicks () … Just do something like:

Uint8 timer;
timer = SDL_GetTicks();

that will get the current ticks… then you can have a few more variables
to use timers, etc.On Mon, 27 Dec 1999, Christian Biesinger wrote:

I just wanted to have a look in the API reference to find out the syntax
for Timers.
But to my surprise I had to find out that it wasn’t there?!?

Looks like the Doc is not very up to date!?

Maby one should fix this, as maybe other things are missing as well.

Yours, Christian

Christian Biesinger
Get Paid To Surf:
http://www.AdOne.de/startup.php?werber=45130
Hi! I’m a signature virus! Copy me into your signature file to help me
spread!

Ryan Wahle schrieb:

The only timer I know of is SDL_GetTicks () … Just do something like:

Uint8 timer;
timer = SDL_GetTicks();

that will get the current ticks… then you can have a few more variables
to use timers, etc.

No, there is at least one more:

int SDL_SetTimer(Uint32 ms, SDL_TimerCallback callback)

Which defines a Callback function.

None of these two is even mentioned in the API Reference.–
Christian Biesinger
Get Paid To Surf:
http://www.AdOne.de/startup.php?werber=45130
Hi! I’m a signature virus! Copy me into your signature file to help me
spread!

Ryan Wahle schrieb:

The only timer I know of is SDL_GetTicks () … Just do something like:

Uint8 timer;
timer = SDL_GetTicks();

that will get the current ticks… then you can have a few more variables
to use timers, etc.

No, there is at least one more:

int SDL_SetTimer(Uint32 ms, SDL_TimerCallback callback)

Which defines a Callback function.

None of these two is even mentioned in the API Reference.

Yep, SDL_SetTimer isn’t thread-safe and has high overhead on some platforms.
It’s there, but it may change or go away.

SDL_GetTicks() will always be around, but in general, if it’s not documented,
it may change. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

The only timer I know of is SDL_GetTicks () … Just do something like:

Uint8 timer;
timer = SDL_GetTicks();

Actually, it’s Uint32, not Uint8. :slight_smile:

that will get the current ticks… then you can have a few more variables
to use timers, etc.

There’s also “void SDL_Delay(Uint32 ms)” which pauses the program (thread?)
for ‘ms’ milliseconds. (So use “SDL_Delay(1000);” to pause 1 second.)

Finally, and I haven’t played around with this, there’s “SDL_SetTimer()”.
(Note: To use this, you need to add “SDL_INIT_TIMER” when you call
"SDL_Init()")

It lets you have SDL call a function ever ‘interval’ milliseconds.
(“int SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback)”)

-bill!

SDL_GetTicks() will always be around, but in general, if it’s not documented,
it may change. :slight_smile:

Damn you. :slight_smile: I use it at least twice in each of my looping functions
(ie, title screen, main game, pause, options, etc. :slight_smile: )

D’oh.

-bill!

SDL_GetTicks() will always be around, but in general, if it’s not documented,
it may change. :slight_smile:

Damn you. :slight_smile: I use it at least twice in each of my looping functions
(ie, title screen, main game, pause, options, etc. :slight_smile: )

No, I mean SDL_GetTicks() and SDL_Delay() will not change, but the other
timer functions may at some point. No worries. :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

SDL_GetTicks() will always be around, but in general, if it’s not documented,
it may change. :slight_smile:

Damn you. :slight_smile: I use it at least twice in each of my looping functions
(ie, title screen, main game, pause, options, etc. :slight_smile: )

No, I mean SDL_GetTicks() and SDL_Delay() will not change, but the other
timer functions may at some point. No worries. :slight_smile:

Oh - Whew!

-bill!