Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm having trouble finding documentation on SDL_gfx, and I can't figure this out. I've managed to use SDL_gfx to automatically cap the framerate, and I it's working a lot better than my manual attempt (combining SDL_Delay and SDL_Getticks).

Now I've been trying to learn more about it, and I stumbled onto something.
Here's the whole struct:

typedef struct {
             Uint32 framecount;
             float rateticks;
             Uint32 lastticks;
             Uint32 rate;
     } FPSmanager;

Most variables in this struct are pretty straightforward, but I have no idea of what lastticks stands for. Does anyone know?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

To put it simply, lastticks is used to to store the result of calling SDL_GetTicks(), or in other words, the number of miliseconds that have passed since the SDL library was initialized.

This is supported by looking at the SDL_framerate.cpp implementation file, and noticing that every assignment to lastticks is as follows:

manager->lastticks = SDL_GetTicks();       // Lines 23 and 81
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.