FPS/Ping & More FOV Codes
#17


7 minutes ago, Stormax said:



pDrawPort->PutTextExCX( strServerInfo, m_nPosX +this->GetWidth()/2 + 50, m_nLocalTimeY + 17, 0xFFA600FF );


Don't exist on november source have you a solution?




in my case, I call a function inside

void CUIRadar::OnUpdate

to update the fps value.

I leave the function in case anyone is interested, they would have to add the CUIText to their xml and do the corresponding thing in the source

// NICOLASG MARK (SHOW FPS)
void CUIRadar::updateFPSCounter(){
if(m_pTxtFpsInfo == NULL)
return;

#define FRAMES_AVERAGING_MAX 20L
static CTimerValue _tvLasts[FRAMES_AVERAGING_MAX];
static CTimerValue _tvDelta[FRAMES_AVERAGING_MAX];
static INDEX _iCheckNow = 0;
static INDEX _iCheckMax = 0;

FLOAT fFPS = 0.0f;

_iCheckMax++;

if(_iCheckMax >= FRAMES_AVERAGING_MAX){
for(INDEX i = 0; i<FRAMES_AVERAGING_MAX; i++)
fFPS += _tvDelta[i].GetSeconds();
fFPS = FRAMES_AVERAGING_MAX*FRAMES_AVERAGING_MAX / fFPS;
_iCheckMax = FRAMES_AVERAGING_MAX;
}

CTimerValue tvNow = _pTimer->GetHighPrecisionTimer();
_tvDelta[_iCheckNow] = tvNow - _tvLasts[_iCheckNow];
_tvLasts[_iCheckNow] = tvNow;
_iCheckNow = (_iCheckNow + 1) % FRAMES_AVERAGING_MAX;

CTString strFPS = "";

if(fFPS >= 30) strFPS.PrintF("FPS: %3.0f", fFPS);
else if(fFPS >= 0.1f) strFPS.PrintF("FPS: %3.1f", fFPS);

m_pTxtFpsInfo->SetText(strFPS);
}
// NICOLASG MARK END

 



Messages In This Thread
[No subject] - by nicolasg - 03-24-2022, 01:04 AM
[No subject] - by Desarija - 03-24-2022, 01:56 PM
[No subject] - by nicolasg - 03-24-2022, 07:26 PM
[No subject] - by WhosUrDaddi - 03-24-2022, 08:29 PM
[No subject] - by nicolasg - 03-25-2022, 12:38 AM
[No subject] - by Desarija - 03-25-2022, 12:47 AM
[No subject] - by nicolasg - 03-25-2022, 01:06 AM
[No subject] - by Exodus - 03-25-2022, 11:01 AM
[No subject] - by nicolasg - 03-25-2022, 12:18 PM
[No subject] - by deudas - 01-28-2023, 10:22 PM
[No subject] - by nicolasg - 01-28-2023, 10:26 PM
[No subject] - by Desarija - 01-28-2023, 10:34 PM
[No subject] - by deudas - 01-28-2023, 10:50 PM
[No subject] - by WhosUrDaddi - 01-30-2023, 08:32 PM
[No subject] - by WhosUrDaddi - 01-30-2023, 09:42 PM
[No subject] - by Stormax - 01-31-2023, 11:00 AM
[No subject] - by nicolasg - 01-31-2023, 11:05 AM
[No subject] - by Stormax - 01-31-2023, 11:39 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)