views:

75

answers:

3

I was wondering...

It's possible to do it?

A simple console command based program that shows how are your FPS, for your currently running game/program?

A: 

Short answer: No.

Long answer: Not without knowing the internals of the application, and without the application having the appropriate hooks to perform such a measurement.

Ignacio Vazquez-Abrams
My downvote. Sorry. It is possible.
nailxx
+1  A: 

Short answer: Yes.

Long answer: Beside that it is much simpler to gather statistics when you have hooks inside the measured program, it is possible also to hook on lower level: directly to DirectX or OpenGL. Start your discovery from some existing posts. They are in C++ but that's another deal: you can use SWIG to interop between Python and C/C++.

As a proof. There is famous Fraps applications that does what you say.

nailxx
A: 

As long as you have the available bindings/hooks to read what that application is doing through whatever library it uses, yes. Those counters are normally implemented as queries to a program drawing through OpenGL (or directX).

If it's an OGL app, pyOpenGL provides a decent amount of functionality, might be worth your time looking into it. I have no experience with directX, but I assume you might find similar bindings.

http://www.cs.man.ac.uk/~toby/frameratedisplayer.htm if you want a simple example to look at that does just that (assuming you're ok puzzling out very little C syntax)

ThE_JacO