Then we compile it into a DLL called d3d9.dll, and drop it in the game executable's directory. So now, in our custom class, our wrapper function for EndScene looks like this: HRESULT IDirect3DDevice9::EndScene() We do this by creating a class that looks like IDirect3DDevice9 to the game, but it's really just a wrapper that forwards all function calls to the real class.
So in theory, we can put custom code inside EndScene that draws what we want over the game. I may have left out some details, but I just hope to illustrate the idea.Īll Direct3D9 games need to call IDirect3DDevice9::EndScene after the screen is rendered and ready to be drawn. It's been years since I've done this, but I did it with a game once. I prefer what's called a Direct3D Wrapper. This is a pretty esoteric art, and there are several ways to do this. This is just a simple DrawPrimitive call to draw a filled transparent rectangle over the screen. You also asked about dimming the game graphics under your overlay. So yeah, no easy way to do this unless someone created a helpful library to do everything you need to do at the low level. I'm willing to bet that Steam does it the same way as Xfire. There's no other conceivable way since you need to hijack the graphics device that belongs to that game.
I know this because their method was causing my mod to crash, and I actually saw the strange assembly code they were injecting into the d3d9.dll. The way they do this is by editing the d3d/opengl DLL at the process memory level, like injecting assembly jumps. Xfire is a chat program that overlays its interface into games so you can receive messages while playing. I would like to avoid tricks such as injecting code or debugging the process, if possible. I want to display, say a digital clock in the bottom right corner of the screen, on top of the game graphics. I'm looking for more 'modern' and generic solutions - overlaying a command prompt or a 320x240 indexed color application isn't a concern.Įdit: Some clarification: The fullscreen application isn't mine.
Could you use one method for all OpenGL applications? For all Direct3D minus DirectDraw applications? For all fullscreen Windows applications? I'm also wondering how broad the scope of solutions would be. I'm wondering how one could go about writing such an application. (The GUI elements look custom-drawn, I don't know if that is a necessity but they look exactly the same inside a game as they do on the desktop.) It even goes as far to 'dim' the game graphics in the background. Have you played any Steam games? It has an executable, GameOverlayUI.exe that lets you access Steam windows from within a game. cl_crosshairstyle 1 and 4 are 100% static – no spread while moving or firing a weapon.I want to display some custom graphics on top of a 3rd party fullscreen Windows application. cl_crosshairstyle 5 was added because of the high demand of veteran players and might be only interesting for you, if you really know how the recoil works. However, you can disable this function with hud_showtargetid "0", if you don’t like it. Only cl_crosshairstyle 0 and 1 are able to turn red, when you are aiming at an enemy – this can be an advantage for unexperienced players as you get additional visual feedback. In the end it all comes down to personal preference. Now you might ask yourself “Which crosshair should I use?”. It only provides feedback about whether or not you are currently firing a weapon. cl_crosshairstyle 5 emulates the non-dynamic behavior of CS 1.6 and CS:Source, but like in both previous versions, this crosshair doesn’t accurately portray current weapon accuracy, spread or recoil. Only cl_crosshairstlye 0, 2 and 3 are showing acurate feedback on your weapon’s bullet spread/recoil. This command allows you to change the style of your crosshair.ĭefault: cl_crosshairstyle "0" // spreads while moving and shootingĭefault Static: cl_crosshairstyle "1" // completely staticĬlassic: cl_crosshairstyle "2" // spreads while moving and shootingĬlassic Dynamic: cl_crosshairstyle "3" // spreads while moving and shootingĬlassic Static: cl_crosshairstyle "4" // completely staticĬlassic 1.6/CS:S Style: cl_crosshairstyle "5" // only spreads while shooting