Original Post
Here is the code I am using for it.
void FrameCount()
{
INT64 NewCount = 0;
static INT64 LastCount = 0;
INT64 Difference = 0;
QueryPerformanceCounter( (LARGE_INTEGER*)&NewCount );
g_FrameCount++;
Difference = NewCount - LastCount;
if( Difference >= g_Frequency )
{
g_FrameRate = g_FrameCount;
g_FrameCount = 0;
LastCount = NewCount;
}
}
Here is what i use to display the frames.
char string[4]; ZeroMemory( &string, sizeof( string ) ); itoa( g_FrameRate, string, 10 ); lpFont->DrawText(NULL, string, -1, &font_rect, DT_LEFT|DT_NOCLIP, 0xFFFFFFFF);It displays a 1 no matter what. What am I doing wrong here?