叠加在3D全屏应用程序上 [英] Overlaying on a 3D fullscreen application

查看:84
本文介绍了叠加在3D全屏应用程序上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在第三方全屏Windows应用程序顶部显示一些自定义图形.

I want to display some custom graphics on top of a 3rd party fullscreen Windows application.

您玩过Steam游戏吗?它具有GameOverlayUI.exe可执行文件,可让您从游戏中访问Steam窗口. (GUI元素看起来是自定义的,我不知道这是否是必需的;但是它们在游戏中的外观与在桌面上的外观完全相同.)甚至可以将游戏图形模糊化".背景.

Have you played any Steam games? It has an executable, GameOverlayUI.exe that lets you access Steam windows from within a game. (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.

我想知道如何编写这样的应用程序.

I'm wondering how one could go about writing such an application.

我还想知道解决方案的范围有多广.您可以对所有OpenGL应用程序使用一种方法吗?对于所有Direct3D减去DirectDraw应用程序?对于所有全屏Windows应用程序?

I'm also wondering how broad the scope of solutions would be. Could you use one method for all OpenGL applications? For all Direct3D minus DirectDraw applications? For all fullscreen Windows applications?

我正在寻找更多的现代"和通用解决方案-覆盖命令提示符或索引为320x240的彩色应用程序不是问题.

I'm looking for more 'modern' and generic solutions - overlaying a command prompt or a 320x240 indexed color application isn't a concern.

需要澄清:全屏应用程序不是我的.可以是任何东西.很有可能它将是3D游戏.我想在屏幕右下角的游戏图形上方显示一个数字时钟.如果可能的话,我想避免使用诸如注入代码或调试过程之类的技巧.

Some clarification: The fullscreen application isn't mine. It can be anything. Most probably, it will be a 3D game. I want to display, say a digital clock in the bottom right corner of the screen, on top of the game graphics. I would like to avoid tricks such as injecting code or debugging the process, if possible.

推荐答案

好,这是另一个示例. Xfire是一个聊天程序,将其界面覆盖到游戏中,因此您可以在玩游戏时接收消息.他们这样做的方法是在进程内存级别上编辑d3d/opengl DLL,例如注入程序集跳转.我知道这一点是因为他们的方法导致我的mod崩溃,而且我实际上看到了他们注入d3d9.dll的奇怪汇编代码.

Well, here's another example. Xfire is a chat program that overlays its interface into games so you can receive messages while playing. The way they do this is by editing the d3d/opengl DLL at the process memory level, like injecting assembly jumps. 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.

这就是Xfire的工作方式:

So here's how Xfire does this:

  1. 定位游戏过程
  2. 在其进程内存中搜索d3d.dll/opengl.dll
  3. 将包含自定义接口逻辑的DLL注入到进程中
  4. 通过在进程内存中的d3d/opengl函数中手动编写程序集跳转,将接口的功能连接到程序流中

没有其他可想象的方法,因为您需要劫持属于该游戏的图形设备.我敢打赌,Steam的执行方式与Xfire相同.是的,除非有人创建了一个有用的库来做您需要做的所有底层工作,否则,要做到这一点绝非易事.

There's no other conceivable way since you need to hijack the graphics device that belongs to that game. I'm willing to bet that Steam does it the same way as Xfire. 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.

您还询问了有关使叠加层下的游戏图形变暗的问题.这只是一个简单的DrawPrimitive调用,用于在屏幕上绘制一个填充的透明矩形.

You also asked about dimming the game graphics under your overlay. This is just a simple DrawPrimitive call to draw a filled transparent rectangle over the screen.

这篇关于叠加在3D全屏应用程序上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆