Drawing over top of a 3D game

Started by
3 comments, last by bobbias 15 years, 5 months ago
Alright, I'm thinking of making a simple ping notification program that is supposed to run on top of a game, and show me my ping to the game server as I'm playing. However, I have not been able to find any info on how to actually draw over top of a game. I've seen programs like FRAPS draw on top of a game (I've seen a few others do similar things as well), so I've been wondering how exactly to do this. I'm assuming that it is possible to hook the draw function and insert my own code, but I'm hoping that's not the only way, since I know jack all about hooking function calls.
Advertisement

I think you're pretty much stuck with hooking the draw or D3D Present function, but luckily Muhammad here already did most of the hard work so you don't have to [wink]
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!
Thanks for the link, I'll check it out. As a quick question, would I be able to get this working in C#?

I haven't really touched C++ in ages, and don't have any of the other visual studio express suite installed except C#, lol.

Hopefully I can cook something up though, I'm getting sick and tired of not being able to set my games to show me my framerate, or my lag.

I'm sorta surprised that function hooking is discussed here though, since most programming places generally refuse to discuss that sort of thing for fear of helping people become hackers (since as far as I know, once you know how to hook one function, you can hook just about any one).

It all depends on how you use it obviously, but as mentioned in that thread MS supports this since their own PIX tool reportedly does the exact same thing.

The core part of the hooking is probably impossible to do in C#, but once you get it to draw some text to the screen, you could set up some inter-process thingy to feed it text from a C# app. I'm afraid I'll have to leave you with that vague suggestion, since C++ isn't my cup of tea either, so hopefully someone else can weigh in on this.
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!
Well, hopefully I can figure something out, as I mentioned, my C++ is pretty rusty. The last languages I've worked in are Java and C#, and I know that C# is quite a bit different than C++ in many ways, despite being very heavily inspired by it :/

This topic is closed to new replies.

Advertisement