Hi i am still very new to compiler based programing and am in the process of making a small demo but i am having issues getting a solid 60fps.
I read a post about using DPC set but am unable to get it to do what i want... basically what i need is a quick guide on how to get a set frame rate WITH code, not theories based around experience with C# or something else ridiculous. There seems to be to many of those threads covering the first 40 or so pages of google.
The code i am using at the moment is as follows:
The problem with this is never actuate on the Wiz as the time difference ranges from 18-20 depending on whats going on. And no its not being lagged as all i'm doing is scrolling a background and without the limiter go's very fast.
I read a post about using DPC set but am unable to get it to do what i want... basically what i need is a quick guide on how to get a set frame rate WITH code, not theories based around experience with C# or something else ridiculous. There seems to be to many of those threads covering the first 40 or so pages of google.
The code i am using at the moment is as follows:
Code:
int t_prev = SDL_GetTicks();
int t = SDL_GetTicks();
while (!done){
t = SDL_GetTicks();
//Imput and realtime logic here
if(t - t_prev >= 1000/FPS){ //FPS is defined as 60
//Draw surfaces to screen and increment animation int's
t_prev = t;
}
}