finish draw stats

This commit is contained in:
Glenn Maynard
2002-11-11 20:43:30 +00:00
parent b13fe6e6b6
commit b037524db0
3 changed files with 16 additions and 7 deletions
+10 -6
View File
@@ -41,11 +41,15 @@ RageVertex g_vertQueue[MAX_NUM_VERTICIES];
RageTimer g_LastCheckTimer;
int g_iNumVerts;
float g_fLastCheckTime;
int g_iFramesRenderedSinceLastCheck;
int g_iVertsRenderedSinceLastCheck;
int g_iDrawsSinceLastCheck;
int g_iFPS, g_iTPF, g_iDPF;
int g_iFPS, g_iVPF, g_iDPF;
int RageDisplay::GetFPS() const { return g_iFPS; }
int RageDisplay::GetVPF() const { return g_iVPF; }
int RageDisplay::GetDPF() const { return g_iDPF; }
static int g_iFramesRenderedSinceLastCheck,
g_iVertsRenderedSinceLastCheck,
g_iDrawsSinceLastCheck;
RageDisplay::RageDisplay( bool windowed, int width, int height, int bpp, RefreshRateMode rate, bool vsync )
{
@@ -159,11 +163,11 @@ void RageDisplay::Flip()
g_LastCheckTimer.GetDeltaTime();
g_iFPS = g_iFramesRenderedSinceLastCheck;
g_iFramesRenderedSinceLastCheck = 0;
g_iTPF = g_iVertsRenderedSinceLastCheck / g_iFPS;
g_iVPF = g_iVertsRenderedSinceLastCheck / g_iFPS;
g_iVertsRenderedSinceLastCheck = 0;
g_iDPF = g_iDrawsSinceLastCheck / g_iFPS;
g_iDrawsSinceLastCheck = 0;
//LOG->Trace( "FPS: %d, TPF: %d, DPF: %d", m_iFPS, m_iTPF, m_iDPF );
//LOG->Trace( "FPS: %d, VPF: %d, DPF: %d", m_iFPS, m_iVPF, m_iDPF );
}
}
+5
View File
@@ -71,6 +71,11 @@ public:
void GetHzAtResolution(int width, int height, int bpp, CArray<int,int> &add) const;
int GetMaxTextureSize() const;
/* Statistics */
int GetFPS() const;
int GetVPF() const;
int GetDPF() const;
protected:
void AddVerts( const RageVertex v[], int iNumVerts );
};
+1 -1
View File
@@ -134,7 +134,7 @@ void ScreenManager::Draw()
if( PREFSMAN && PREFSMAN->m_bShowStats )
{
m_textStats.SetText( "??? FPS" );
m_textStats.SetText( ssprintf("%i FPS\n%i VPF\n%i DPF", DISPLAY->GetFPS(), DISPLAY->GetVPF(), DISPLAY->GetDPF()) );
m_textStats.Draw();
}
for( int p=0; p<NUM_PLAYERS; p++ )