嵌入按钮控制到现有的Direct3D应用程序应用程序、按钮、Direct3D

2023-09-04 13:02:45 作者:時間讓深愛變成深礙

我想覆盖自己的内容上面一个Direct3D V9游戏(由第三方制造)。

I would like to overlay own content above a Direct3D v9 game (made by a third party).

具体而言,我想覆盖一个可点击的按钮控制,如蒸汽做,比如,虽然我尝试一个更简单的接口。

Specifically, I would like to overlay a clickable button control, like Steam does, for instance, though I'm attempting a much simpler interface.

在理想情况下,我将能够覆盖一个WPF按钮或Windows窗体按钮或全部用户控件,但如果这是不可能的,那么建立从原语功能按钮,就足以为好。

Ideally, I would be able to overlay a WPF button or a Windows Form button or whole UserControl, but if that is not possible then creating a functioning button from primitives would suffice as well.

在我有覆盖文字工作示例基于贾斯汀Stenning 工作 即与 SharpDX.Direct3D9.Font DrawText的方法帮助 I have a working sample of overlaying text based on the work of Justin Stenning Namely with the help of SharpDX.Direct3D9.Font DrawText method

我在 https://github.com/sharpdx/SharpDX-Samples但没有能够找到一种方法,包括或提请原生控制与SharpDX

I looked through relevant samples in https://github.com/sharpdx/SharpDX-Samples but was not able to find a way to include or draw native controls with SharpDX

这可能吗? 如果不是,是否有从头开始?绘制一个可点击的按钮中的任何样本 请记住我是一个新手,在DirectX的世界:)

推荐答案

您最大的问题是不会被得到控制,以使在一个DX现场榜首;这将是让他们在事后应对输入。你或许可以搭起一个办法让复制到DX表面的视觉效果,但我不知道你将如何捕获输入,翻译它,并将其交付回WPF组件。如果它甚至有可能,它几乎肯定更多的麻烦比它的价值。

Your biggest problem isn't going to be getting the controls to render on top of a DX scene; it's going to be getting them to respond to input afterwards. You can probably rig up a way to get the visuals copied to a DX surface, but I have no idea how you would capture input, translate it, and deliver it back to the WPF components. If it's even possible, it's almost certainly more trouble than it's worth.

有一对夫妇的游戏为导向的XAML解决方案,在那里,你可能要退房。 WPF的游戏是部分基于C上的Direct3D ++实现WPF的,还有还有专有的意向活动GUI 。

There are a couple game-oriented Xaml solutions out there that you may want to check out. WPF for Games is a partial C++ implementation of WPF based on Direct3D, and there's also the proprietary Noesis GUI.