Skip to main content
gamedev.net
🔒 Locked

FPS Reading

Started by okonomiyaki 5 replies 250+ views
Original Post
okonomiyaki
okonomiyaki
I know this may be a very stupid, primitive question.. but what''s the most optimal way to read your FPS during execution of your DirectX program? It is nice to have the reading with other debug info in the corner while the program''s running.. I can think of maybe one or two ways, but I''m wondering how everyone else does it.
Carrot
Carrot
Try this application - its small and works for every DX/OGL application.

http://www.fraps.com/
okonomiyaki
okonomiyaki
Ah, thanks a lot guys, I''ve got a reading up already. I hope it''s the most optimal.. I looked at both those sites, and ended up using something similar to Anonymous Poster''s code..
Great!
MindWipe
MindWipe
And here's mine:

void FPS()
{
static DWORD OldTime;
static int frames;
static int FPS;

frames++;

if( GetTickCount() - OldTime > 1000 )
{
FPS = frames;
frames = 0;
OldTime = GetTickCount();
}

//Here I write the FPS to the screen
}

call that every frame. I do it after all drawing so that it draws the FPS on top of everything

/MindWipe

[edited by - MindWipe on May 30, 2002 4:33:15 PM]
"To some its a six-pack, to me it's a support group."

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.