gpt4 book ai didi

c# - UWP 和 DirectX

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:42:59 26 4
gpt4 key购买 nike

我有一个任务:

'Second component must be written in C++ and must be a UWP assembly/component that will be used by the First part of the task. It must be a DirectX component that draws to SwapChain with transparent background. The content must be a 2D animation that must be bound to current mouse position. The content must be controllable via set of public methods.

DirectX component must be placed on top of your C# GUI so it will act as overlay.Make it event-transparent overlay, it must not capture any GUI events and otherwise interfere with C# app.Use C# host to send mouse events and content change to DX layer.'

但我不知道如何结合 UWP 和 DirectX。我已经拥有正常运行的 UWP C# 应用程序部件,下一步是什么?

如果有任何回复和想法,我将不胜感激。

最佳答案

您需要在 XAML 文件中包含一个 SwapChainPanelSwapChainBackgroundPanel 控件。该表面将用于绘制您的 DirectX 内容。 Visual C++ 模板 中有一个名为 DirectX 11 和 XAML App 的默认 uwp 示例。它可以帮助您理解管道,但此解决方案上只有 C++ 代码。

关于c# - UWP 和 DirectX,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36840262/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com