Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

C# Making an fps capture program C#

TableFlipGod

Bronze Coder
So i have a program that captures the fps and displays is (wip)

But how would i actually get the fps and display it on screen (NO C++) and simple
 
It sounds really interesting! I looked this up and wasn’t sure if this would help but here’s what I found on Stack Overflow:


I apologize if this doesn’t help, just trying to help!
 
This is actually a very interresting topic, but sadly it isn't very easy and most Information you can find about this is in C++, as it gets really complicated with most other languages.

Programms as Fraps are normally hooking into the graphics dll, normally DirectX or OpenGL, they then count the frames over this hooks and place the overlays on top of games, also using the hooks.

If you are still interested in this topic, there is a good explanation on StackOverflow:


In regards to normal dekstop applications, the links from Malcom show really good how you can user overlays, but there you normally don't have a way to count frames, actually you have normally multiple windows open, with different framerates.

I hope this helps you to understand the way such programs work.
 
Little extra info for the StackOverflow link ZarJohn sent:
If you're interested in this topic (despite it's complexity) you should take a look at Microsoft Detours.
It's a library that makes intercepting foreign function calls a lot less painful.
They even have a pretty short (~80 LOC) example in there of hooking OpenGL's glFinish() function, which might be useful to get the hang of it.
 
If any post here answered your question & helped you complete this goal, please mark the reply as the Answer.
If you found the answer elsewhere, we would love to take a look & link to it here so users in the future can find the answer quickly! :)

It's a complicated topic, but I hope the replies from other members have helped you go in the right direction at the very least.
 
Little extra info for the StackOverflow link ZarJohn sent:
If you're interested in this topic (despite it's complexity) you should take a look at Microsoft Detours.
It's a library that makes intercepting foreign function calls a lot less painful.
They even have a pretty short (~80 LOC) example in there of hooking OpenGL's glFinish() function, which might be useful to get the hang of it.
Thanks Ill take a look into it
 
Al
Little extra info for the StackOverflow link ZarJohn sent:
If you're interested in this topic (despite it's complexity) you should take a look at Microsoft Detours.
It's a library that makes intercepting foreign function calls a lot less painful.
They even have a pretty short (~80 LOC) example in there of hooking OpenGL's glFinish() function, which might be useful to get the hang of it.
Also i forgot to mention that i am looking for something in c# not python or c++ :)
 
Also i forgot to mention that i am looking for something in c# not python or c++ :)

I wish I could help, but I cannot.
Thank you though for mentioning you are specifically looking for a C# solution.
If you can add that to your OP, that would be great :)

In the meantime, maybe you can read some of these pages... Not sure if they will help you, but they definitely are related!

From what I can see, it appears that Fraps is using some sort of injected DLL file and hook to capture the FPS for each program. It's a lot more complicated than you would think unfortunately.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom