• Create Account

### #ActualInterminable

Posted 14 July 2012 - 03:24 AM

I still think it is to do with your timer. GetSystemTime() seems to be only accurate to the millisecond.

If you have a basic scene you might be rendering faster than 1000 fps, so your scene will be choppy as the timer wont be acurate enough.

On my 3 year old video card my application (that also uses sprites) is rendering at 8000 FPS. This is why I had the same problems that your are experiencing. I had to re-think my timer.

Give my timer a try

#pragma once
class Timer
{
public:
Timer()
{
}
~Timer()
{
}
long double TimeSinceLastFrame()
{
QueryPerformanceFrequency(&liPerfFreq);
QueryPerformanceCounter(&liCurrent);
return ddFrameTime;
}
private:
LARGE_INTEGER liCurrent;
LARGE_INTEGER liPrevious;
LARGE_INTEGER liPerfFreq;
LARGE_INTEGER liStart;
long double ddFrameTime;
};

TimeSinceLastFrame() will return exactly that (but using the performance counters)

I would love to know how you go

I'll give it a try...but I'm also updating how far they should move using the time it takes to render the last frame. They appear to move smoothly already, just with minute changes in size as they go. Anyway, I'll EDIT this post with how I get on (or reply in a new post if there have been further responses).

EDIT: TimeSinceLastFrame()'s first return value is insanely high (eg 9029811) and screws up anything that relies on it for moving etc at the very beginning of the program. It eventually settles down to values of hundreds.

EDIT2: It appears to do this regardless of when the first call to it was, so I call it a few times needlessly at the beginning of my program to make it settle down a little before I start actually needing to use it.

Unfortunately the issue I am experiencing with the minute changes in size remains.

### #2Interminable

Posted 14 July 2012 - 03:22 AM

I still think it is to do with your timer. GetSystemTime() seems to be only accurate to the millisecond.

If you have a basic scene you might be rendering faster than 1000 fps, so your scene will be choppy as the timer wont be acurate enough.

On my 3 year old video card my application (that also uses sprites) is rendering at 8000 FPS. This is why I had the same problems that your are experiencing. I had to re-think my timer.

Give my timer a try

#pragma once
class Timer
{
public:
Timer()
{
}
~Timer()
{
}
long double TimeSinceLastFrame()
{
QueryPerformanceFrequency(&liPerfFreq);
QueryPerformanceCounter(&liCurrent);
return ddFrameTime;
}
private:
LARGE_INTEGER liCurrent;
LARGE_INTEGER liPrevious;
LARGE_INTEGER liPerfFreq;
LARGE_INTEGER liStart;
long double ddFrameTime;
};

TimeSinceLastFrame() will return exactly that (but using the performance counters)

I would love to know how you go

I'll give it a try...but I'm also updating how far they should move using the time it takes to render the last frame. They appear to move smoothly already, just with minute changes in size as they go. Anyway, I'll EDIT this post with how I get on (or reply in a new post if there have been further responses).

EDIT: TimeSinceLastFrame()'s first return value is insanely high (eg 9029811) and screws up anything that relies on it for moving etc at the very beginning of the program. It eventually settles down to values of hundreds.

### #1Interminable

Posted 14 July 2012 - 03:12 AM

I still think it is to do with your timer. GetSystemTime() seems to be only accurate to the millisecond.

If you have a basic scene you might be rendering faster than 1000 fps, so your scene will be choppy as the timer wont be acurate enough.

On my 3 year old video card my application (that also uses sprites) is rendering at 8000 FPS. This is why I had the same problems that your are experiencing. I had to re-think my timer.

Give my timer a try

#pragma once
class Timer
{
public:
Timer()
{
}
~Timer()
{
}
long double TimeSinceLastFrame()
{
QueryPerformanceFrequency(&liPerfFreq);
QueryPerformanceCounter(&liCurrent);
return ddFrameTime;
}
private:
LARGE_INTEGER liCurrent;
LARGE_INTEGER liPrevious;
LARGE_INTEGER liPerfFreq;
LARGE_INTEGER liStart;
long double ddFrameTime;
};

TimeSinceLastFrame() will return exactly that (but using the performance counters)

I would love to know how you go

I'll give it a try...but I'm also updating how far they should move using the time it takes to render the last frame. They appear to move smoothly already, just with minute changes in size as they go. Anyway, I'll EDIT this post with how I get on (or reply in a new post if there have been further responses).

PARTNERS