char sFPS[20];
int FPScounter = 0;
float FPSfLastTickCount = 0.0f;
float FPSfCurrentTickCount;
void FPScheck(char *str, char *format)
{
FPSfCurrentTickCount = (clock() * 0.001f);
FPScounter++;
if((FPSfCurrentTickCount - FPSfLastTickCount) > 1.0f) {
FPSfLastTickCount = FPSfCurrentTickCount;
sprintf(str,format,FPScounter);
FPScounter = 0;
}
}
AddText("D3D FPS :", White, sFPS);
void cMenu::AddText(char *txt, DWORD color, char *opt)
{
AddItem(txt,(char **)opt, 0, 0, MENUTEXT);
}
void AddText (char *txt, DWORD color , char *opt)