I'm trying to implement a system where software is collecting FPS information on games. This data would stored and analyzed for statistics. Basically FRAPS without video recording...
I don't know where to begin. I tried search for solution to read FPS data on any game but without luck. How can i inject my code to a running process so I know delta time between frames? I guess it has something to do with DirectX and OpenGL specifically but I have no experience in this kind of stuff. How is fraps implemented?
Use dependency injection.
Create an opengl32.dll offering a wglSwapBuffers implementation (your implementation). The library should contains all other function entry point expected by the dependent application (potentially all OpenGL 1.3 entry points).
The basic implementation of the injected wglSwapBuffers should call the original opengl32.dll implementation of wglSwapBuffers. Indeed do the same for all other function injected.
Normally wglSwapBuffers is used to present video frames on screen, indeed you can count each frame.
Place your opengl32.dll in the working directory of the application, run it, then attach the debbuger. Enjoy.