gpt4 book ai didi

c++ - "D3DX11CreateShaderResourceViewFromFile"让它工作或寻找替代品

转载 作者:行者123 更新时间:2023-11-28 01:39:12 24 4
gpt4 key购买 nike

我是 DirectX 的新手,我正在尝试使用我在网上找到的一些示例代码来工作。显然它需要 D3DX11tex.h 和 D3DX11.lib,但它总是说它无法打开标题。我试过使用 CreateWICTextureFromFile,但我真的不知道自己在做什么,我们将不胜感激。如果有帮助,我会在 Windows 10 上使用 Visual Studio 2017。

最佳答案

所有 D3DX9、D3DX10 和 D3DX11 以及旧版 DirectX SDK 的其他一些方面都已弃用。您可以继续在带有 VS 2012 或更高版本/Windows 8.x SDK/Windows 10 SDK 的经典 Win32 桌面应用程序中使用它们,但您必须适本地添加 DirectX SDK include/libs 并小心使用它们。这在 MSDN 上有详细介绍.另见 this blog post .

Living without D3DX 有很多选项,并且建议新应用程序尽量减少或避免使用旧版 DirectX SDK。 The Zombie DirectX SDK 中详细介绍了需要旧版 DirectX SDK 的唯一情况。 -- 除了从各种过时的 DirectX 11 书籍和在线教程中学习的人。

DirectX Tool Kit 中的 CreateWICTextureFromFile 函数是一个很好的解决方案,它根本不需要旧版 Directx SDK,并且记录在案 here .它也包含在此 tutorial series 中.

Keep in mind that the D3DX11 texture loaders were also "everything and the kitchen sink" implementations. The DirectXTex library supports all kinds of legacy loaders, format conversion, resizing, etc. that was supported by D3DX11. For runtime use, however, DirectX Tool Kit is a much faster, leaner, more elegant solution assuming you can do any required legacy conversions at build-time. See this post.

关于c++ - "D3DX11CreateShaderResourceViewFromFile"让它工作或寻找替代品,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48067434/

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