Vuoi reagire a questo messaggio? Crea un account in pochi click o accedi per continuare.


Tutto quello che riguarda i giochi online ma soprattutto War Rock!
 
IndiceRetailFamasFREEUltime immaginiRegistratiAccedi
Benvenuto Su WarHax!

 

  [SOURCE] FPS Counter & Time

Andare in basso 
AutoreMessaggio
Admin
Founder
Founder



Messaggi : 261
Data d'iscrizione : 15.07.10
Località : Torino

 [SOURCE] FPS Counter & Time Empty
MessaggioTitolo: [SOURCE] FPS Counter & Time    [SOURCE] FPS Counter & Time Icon_minitimeDom Lug 25, 2010 7:59 am

Crediti: AlbertoX
Ecco il souce per l'FPS :


Definizioni :

Code:

float fFps = NULL;
float fLastTickCount = NULL;
float fCurrentTickCount;
char cFrameRate[50] = {NULL};

Il nostro Char :


Code:

char *GetFrameRate()
{
fCurrentTickCount = clock() * 0.001f;
++fFps;
if((fCurrentTickCount - fLastTickCount) > 1.0f)
{
fLastTickCount = fCurrentTickCount;
sprintf( cFrameRate, " %d ", int( fFps ) );
fFps = 0;
}
return cFrameRate;
}

Source Time

Ecco il Char :


Code:

char *GetTime()
{
struct tm * current_tm;
time_t current_time;
time (¤t_time);
current_tm = localtime (¤t_time);
char *logbuf = new char[ 256 ];
sprintf(logbuf, "-: %02d:%02d:%02d :-", current_tm->tm_hour, current_tm->tm_min, current_tm->tm_sec );
return logbuf;
}
Torna in alto Andare in basso
https://warhax.forumattivo.com
 
[SOURCE] FPS Counter & Time
Torna in alto 
Pagina 1 di 1

Permessi in questa sezione del forum:Non puoi rispondere agli argomenti in questo forum.
 :: D3D Coding-
Vai verso: