简体   繁体   English

最低DirectX 9.0c版本以及如何检查

[英]Minimum DirectX 9.0c version and how to check for it

Our Windows C++ Ogre-based game is nearing completion. 我们基于Windows C ++ Ogre的游戏即将完成。 Before we publicly release it, we have to solve this matter : 在我们公开发布它之前,我们必须解决此问题:

Ogre crashes on many test-computers if they are not updated to the latest Dx9.0c version. 如果未将Ogre升级到最新的Dx9.0c版本,它们将在许多测试计算机上崩溃。 All these computers already had 9.0c installed, but that must have been an older OS-pre-installed sub-version, hence the crash..? 所有这些计算机都已经安装了9.0c,但是那一定是一个较早的操作系统预安装的子版本,因此崩溃了。

The 1st questions is : how can I ensure that a user has the correct 9.0c version so that the game doesn't crash on the user's face, but instead show a message like "Go get the latest 9.0c version from there ...."? 第一个问题是:如何确保用户具有正确的9.0c版本,以使游戏不会在用户脸上崩溃,而是显示一条消息,例如“从那里获取最新的9.0c版本... 。“?

The 2nd question is : is there a standard, automated method to update the user's computer to the latest 9.0c version during the game's installation? 第二个问题是:在安装游戏期间,是否有一种标准的自动化方法将用户的计算机更新到最新的9.0c版本? That would be the best solution. 那将是最好的解决方案。

Many many thanks in advance, 非常感谢,

Bill 法案

The 1st questions is : how can I ensure that a user has the correct 9.0c version so that the game doesn't crash on the user's face, but instead show a message like "Go get the latest 9.0c version from there...."? 第一个问题是:如何确保用户具有正确的9.0c版本,以使游戏不会在用户的面前崩溃,而是显示一条消息,例如“从那里获取最新的9.0c版本... 。“?

The best idea is to update/install DirectX silently from Game Installer. 最好的办法是从Game Installer静默更新/安装DirectX。 Along with other required system components like PhysX, vcredist, etc. Silently , without asking "do you want to install DirectX" (user may not know if he needs DirectX, and if it is already installed, nothing will happen). 与其他必需的系统组件(例如PhysX,vcredist等)一起, 静默运行 ,而无需询问“您是否要安装DirectX”(用户可能不知道他是否需要DirectX,并且是否已经安装了DirectX),因此不会发生任何事情。
See DirectX Installation for Game Developers . 请参阅面向游戏开发人员的DirectX安装 Also, I'd recommend to see "Instalation and Maintenance of Games" 另外,我建议您参阅“游戏的安装与维护”

This is because (I believe that) when you're making games, you should assume that computer user is total idiot. 这是因为(我认为)在制作游戏时,您应该假设计算机用户是白痴。 Ie if you give instructions, expect that user will screw up, damage the system and blame you for it. 即,如果您给出说明,则期望用户将搞砸,损坏系统并为此归咎于您。 Compared to that silent DirectX install is almost fool-proof. 相比于静默的DirectX安装,它几乎是万无一失的。 Also, it is much more convenient - user won't have to hunt for DirectX download, and will be able to play immediately after installation. 而且,它更加方便-用户不必搜寻DirectX下载,安装后即可立即播放。

The 2nd question is : is there a standard, automated method to update the user's computer to the latest 9.0c version during the game's installation? 第二个问题是:在安装游戏期间,是否有一种标准的自动化方法将用户的计算机更新到最新的9.0c版本? That would be the best solution. 那将是最好的解决方案。

AFAIK, DXSDK includes DirectX redistributable, and AFAIK you're supposed to include those redistributables with your product. AFAIK,DXSDK包括DirectX可再发行文件,而AFAIK您应该在产品中包括这些可再发行文件。

I had the same problem, but since Ogre supports both Direct3D and OpenGL out of the box, I just tried to LoadLibrary of the neededx directx lib (d3dx9_42.dll), and if it failed, skipped the loading of the directx rendersystem. 我遇到了同样的问题,但是由于Ogre开箱即用地支持Direct3D和OpenGL,所以我只是尝试对Needx DirectX库(d3dx9_42.dll)进行LoadLibrary,如果失败,则跳过了DirectX渲染系统的加载。 (I moved out the loading of rendersystem plugins from the plugins.cfg file to manually doing it in the initialization). (我从plugins.cfg文件中删除了对rendersystem插件的加载,改为在初始化时手动执行)。 In that case, my application proceeded to run on OpenGL instead. 在这种情况下,我的应用程序改为在OpenGL上运行。

Of course, this doesn't work if you have directx-specific code like hlsl shaders or something like that, in that case, just include the redist. 当然,如果您具有Directx专用代码(例如hlsl着色器)或类似的代码(在这种情况下,仅包含redist),则此方法将无效。 Just check with Microsoft and EULAs, it seems that they have something against running redist silently, because they want the user to accept an agreement first. 只需与Microsoft和EULA核对,似乎他们有一些反对默默运行redist的方法,因为他们希望用户首先接受协议。 So to be 100% correct you need to run the redist in a non-silent way, or include MS EULa with your own license in your installer. 因此,要100%正确,您需要以非静默方式运行redist,或在安装程序中包含MS EULa和您自己的许可证。

(Another thing that people seem to have done and got away with it, meaning that their application ran without any problems, is just including the needed directx dlls with their project (like d3dx9_42.dll or whatever). Just simply copying them to the bin directory, that way the render system would always find them. This doesn't seem to be a nice way to do it, but hey, if it works, why not?) (人们似乎已经完成并摆脱了它的另一件事,这意味着他们的应用程序运行没有任何问题,只是在项目中包含了所需的Directx dll(例如d3dx9_42.dll或其他东西)。只需将它们复制到bin中即可。目录,以这种方式渲染系统将总能找到它们。这似乎不是一个好方法,但是,嘿,如果可行,为什么不呢?)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM