.NET如何检测如果DirectX 10的支持? [英] .NET How to detect if DirectX 10 is supported?

查看:159
本文介绍了.NET如何检测如果DirectX 10的支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想找出从.NET code的DirectX 10是否支持机器,preferably不使用托管DirectX或XNA组件。

I would like to find out from .NET code whether DirectX 10 is supported on the machine, preferably without using managed DirectX or XNA assemblies.

感谢你在前进!

推荐答案

这其实很简单:如果你是在Windows Vista / Server 2008或更高版本,你有的DirectX 10的API。如果你是在Windows Vista / Server 2008的Service Pack 1或更高版本,你有的DirectX 10.1的API

It's actually very simple: If you are on Windows Vista / Server 2008 or later, you have "DirectX 10" the API. If you are on Windows Vista / Server 2008 Service Pack 1 or later, you have "DirectX 10.1" the API.

这些都不回答的更有用的问题:系统是否支持DirectX 10兼容的视频设备和驱动程序

Neither of these answer the more useful question of: does the system have a DirectX 10 compatible video device and driver?

真的是唯一可靠的方法来检测,这是创建设备。如果你能(一)找到 D3D10.DLL 和(b)调用 D3D10CreateDevice 成功,那么你有无论是DirectX 10的API和一个10兼容的设备。

Really the only sure way to detect this is to create the device. If you can (a) find the D3D10.DLL and (b) a call to D3D10CreateDevice succeeds, then you have both the DirectX 10 API and a 10 compatible device.

同样,如果你能(一)找到 D3D10_1.DLL 和(b)调用 D3D10CreateDevice1 成功,那么你同时拥有了DirectX 10.1 API和一个10.0或10.1兼容的设备。

Similarly, if you can (a) find the D3D10_1.DLL and (b) a call to D3D10CreateDevice1 succeeds, then you have both the DirectX 10.1 API and a 10.0 or 10.1 compatible device.

的DirectX 11.0或更高版本始终是$在Windows 7 / Server 2008 R2或更高版本p $ psent。同样,如果你可以(一)找到 D3D11.DLL 和(b)调用 D3D11CreateDevice 成功的话,你了DirectX 11 API和一些的功能级别。这些参数的的创建设备将确定哪些功能水平是允许的。这个过程也将检测到您使用的是基于Windows Vista / Server 2008的Service Pack 2的系统与的情况下KB97644 更新应用。

DirectX 11.0 or later is always present on Windows 7 / Server 2008 R2 or later. Again, if you can (a) find the D3D11.DLL and (b) a call to D3D11CreateDevice succeeds, then you have both the DirectX 11 API and a 11 compatible device of some feature level. The parameters to the create device will determine what feature levels are allowed. This procedure will also work to detect the case that you are on a Windows Vista / Server 2008 Service Pack 2 system with the KB97644 update applied.

一旦你有一个 ID3D11Device 可以的QueryInterface为 ID3D11Device1 ,看看系统是否有的DirectX 11.1(Windows 8的/ Server 2012中或Windows 7 / Server 2008 R2中与 KB2670838 ID3D1Device2 ,看看系统是否有DirectX的11.2(8.1的Windows /服务器2012 R2)

Once you have a ID3D11Device you can QueryInterface for ID3D11Device1 to see if the system has DirectX 11.1 (Windows 8 / Server 2012 or Windows 7 / Server 2008 R2 with KB2670838, or ID3D1Device2 to see if the system has DirectX 11.2 (Windows 8.1 / Server 2012 R2)

对于游戏开发者见的Direct3D 11部署

安装什么版本的DirectX是的概念是过时的历史可以追溯到到Windows 9X / ME时代。运行DirectX最终用户运行时的Redist做一些事情,但它的永远的安装的DirectX的新版本。请参见不那么DirectSetup 。而DirectX运行时是纯粹的操作系统补丁级别的函数,一直以来〜2004。请参见是什么在版本号?的为好。

The concept of "What version of DirectX is installed" is antiquated and dates back to the era of Windows 9x/ME. Running the "DirectX End-User Runtime Redist" does some stuff, but it never installs a new version of DirectX. See Not So DirectSetup. The DirectX runtime is purely a function of OS patch level and has been since ~2004. See What's in a version number? as well.

这篇关于.NET如何检测如果DirectX 10的支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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