1
General / Clock and openGL
« on: April 25, 2012, 11:42:08 pm »
Hello, I'm pretty new here and new to game programming in general.
What I'm trying to do is make a game in openGL/SFML 1.6 and I realized that I need
a clock to have the same experience independent of how fast someone's computer is.
What I'm doing is something like this
void Sprite::updateX(float tempX)
{
x += tempX*Clock->GetElapsedTime();
}
I've noticed there's a stutter in my animations that happens predictably with time.
Does anyone know a good tutorial on setting up a clock for use in a game or does anyone know how to properly use the clock feature to get rid of this stutter?
What I'm trying to do is make a game in openGL/SFML 1.6 and I realized that I need
a clock to have the same experience independent of how fast someone's computer is.
What I'm doing is something like this
void Sprite::updateX(float tempX)
{
x += tempX*Clock->GetElapsedTime();
}
I've noticed there's a stutter in my animations that happens predictably with time.
Does anyone know a good tutorial on setting up a clock for use in a game or does anyone know how to properly use the clock feature to get rid of this stutter?