DirectX是一种API或应用程序编程接口(Application Programming Interface)。它充当视频游戏的软件代码和用于播放它们的硬件之间的中间人。如果没有DirectX,玩视频游戏就不会像现在这样轻松,但DirectX是什么,为什么它如此重要?
DirectX是一种API,但那是什么?
我们已经说过API是让游戏与硬件进行通信的软件,但这是一种过于简单化的说法。毕竟,与操作系统对话的硬件驱动程序也可以用同样的方式来描述。
API 所做的是标准化游戏开发人员可以要求计算机硬件提供的命令和功能目录。它是游戏和硬件之间的软件层,用于翻译游戏和硬件设备所使用的两种“语言”。
更准确地说,API代表游戏与硬件驱动程序对话,并且由于游戏和硬件驱动程序都被编写为与DirectX 兼容(DirectX),而不是直接相互兼容,这意味着对话是无缝的。
如果您想深入了解API(APIs),HDG 解释:什么是 API?(HDG Explains: What Is An API?)是一个很好的起点。
DirectX 之前的糟糕时光
所以我们已经确定DirectX是一个介于游戏和它需要运行的硬件之间的API,但为什么视频游戏不能直接与显卡、声卡等对话呢?
这正是过去发生的事情。在MS-DOS时代和(MS-DOS)Windows早期,视频游戏直接与硬件驱动程序通信。
这种方法的问题在于,游戏开发人员必须为每个单独的产品或产品系列编写代码。如果您今天玩经典的 MS-DOS 游戏,您会看到 Creative SoundBlaster或AdLib等品牌的声卡条目。
这些是最受欢迎的声卡品牌,因此游戏开发商可以通过支持他们来覆盖大多数客户,但不是全部。最终,鲜为人知的硬件制造商将开发出与大牌驱动程序兼容的产品。这(Which)就是为什么我们在过去获得了如此多的“ Sound Blaster Compatible ”卡。
结果是,即使您获得了最广泛支持的硬件,也不能保证给定的游戏可以在您的计算机上运行。DirectX解决了这个问题。
DirectX 让(DirectX Makes Things Easier)开发人员(Developers)和硬件制造商的工作变得更轻松(Hardware Makers)
每个版本的DirectX(我们最高到DirectX 12)都规定了兼容硬件必须具备的硬件和软件功能集。换句话说,如果您希望您的显卡通过最新版本的DirectX认证,则它必须具有最低限度的内置功能集。
然后,开发人员编写他们的游戏不是为了与特定的显卡兼容,而是为了与DirectX本身兼容。换句话说,硬件制造商和游戏开发商都将他们的产品标准化为DirectX,因此,任何旨在与特定版本的DirectX配合使用的游戏和硬件组件都保证能够很好地相互配合。
DirectX 是 Xbox 中的“X”
大家都知道游戏机领域的两大巨头是PlayStation和Xbox,但你可能不知道的是,后者最初的名字是“DirectX Box”。
微软(Microsoft)决定缩短名称可能是最好的选择,但这也是对控制台的非常准确的描述。第一个 Xbox 与 PC 硬件拼凑在一起,运行Windows(Windows)和DirectX的精简版。时至今日,最新的Xbox Series X 和 S 游戏机(Xbox Series X and S consoles)仍然如此。
这样做的一大好处是在Xbox和Windows PC之间移植游戏非常简单。因为它们实际上是同一个平台。然而, PlayStation 和Nintendo Switch使用自己的API ,这让我们想到了关于(APIs)DirectX的下一个重要事实。
DirectX不是镇上(Town)唯一的游戏(Game)
尽管DirectX已成为最重要和最广泛的API(APIs)之一,但它远非唯一。许多不同的组织都认识到需要标准化。尽管DirectX是一个API,它涵盖了从图形到游戏控制器的所有内容,但也有一些API(APIs)只关注一个方面,例如图形。
当第一块 3D 显卡在 90 年代中期开始流行时,对图形API(APIs)的需求变得迫切。3dFX Voodoo卡使用专有的Glide API。OpenGL(开放图形库(Open Graphics Library))是一种开放标准,至今仍很流行,并以其现代形式作为Vulkan存在。此外,Apple为自己的设备提供了Metal API,在其他设备类别(如手机和平板电脑)中还有更多。
虽然DirectX没有完全的市场主导地位,但其他API(APIs)会受到Microsoft决定在每个DirectX版本中强制执行的内容的影响。话虽如此,他们不会对其他人发号施令。每个版本的DirectX都是在与所有利益相关者协商后创建的,因此这种关系似乎比人们想象的更加相互。
DirectX不是您需要担心的事情
最大的问题是,作为用户,您在多大程度上需要担心DirectX。过去,在较早的Windows系统上使用较早版本的(Windows)DirectX,您必须手动安装DirectX 。大多数时候,给定的游戏会捆绑它所需的最低版本的DirectX 。如果该安装程序在系统上检测到该DirectX(DirectX)代的较新版本,它将简单地不安装任何内容。
每个DirectX版本(例如 9c、11 和 12)都是自己的东西,但Windows 10预装了它们的副本。您的旧游戏可以在闪亮的全新Windows 10计算机上正常运行。
更重要的是您选择的硬件。您可以随时更新软件或下载正确的软件以使复古游戏正常运行,但您拥有的硬件无法在没有升级或新计算机的情况下进行更改。
DirectX 的硬件合规性
与视频游戏或使用类似技术的任何其他应用程序相关的每一块硬件通常都与最新版本的DirectX 兼容(DirectX)。
但是,如果发布了新版本的DirectX ,如果现有硬件缺少新版本(DirectX)DirectX需要工作的硬件功能,则它可能不兼容。不过,这不是立即切换硬件的理由!
总有一个过渡期,游戏支持多个版本的DirectX。例如,目前游戏通常同时支持DirectX 11和DirectX 12。但是,如果您在市场上购买新硬件(尤其是GPU(GPUs)),那么最好购买与最新主要版本DirectX兼容的硬件。因为您希望您的新购买至少在几年内保持相关性。
当您使用它时,您不妨检查一下您的新硬件是否与其他主要竞争API(APIs)的最新版本兼容,例如Vulcan。
What Is DirectX and Why Is It Important?
DirectX is an API or Applіcation Programming Interface. It acts as the middleman between the software code of video games and the hardware used to play them. Without DirеctX, playing video games would not be as painless as it is today, but what iѕ DirectX and why is іt so critical?
DirectX Is an API, but What Is That?
We’ve said that an API is software that lets games communicate with hardware, but that’s a big oversimplification. After all, hardware drivers that speak to the operating system can also be described in the same way.
What an API does is standardize the catalogue of commands and features that game developers can ask computer hardware to provide. It’s a layer of software between the game and hardware that translates the two “languages” that the game and hardware device speak.
To be more accurate, the API speaks to the hardware drivers on behalf of the game and since both the game and hardware drivers have been written to be compliant with DirectX, rather than each other directly, it means that conversation is seamless.
If you want to dig deeper into APIs, HDG Explains: What Is An API? is a great place to start.
The Bad Old Days Before DirectX
So we’ve established that DirectX is an API that stands between a game and the hardware that it needs to run, but why can’t the video game just talk directly to the graphics card, sound card and so on?
That’s exactly what used to happen. In the days of MS-DOS and the early days of Windows, video games communicated directly with hardware drivers.
The problem with this approach is that the game developer had to write code for every individual product or product family. If you play a classic MS-DOS game today, you’ll see sound card entries for brands such as Creative SoundBlaster or AdLib.
These were the most popular sound card brands, so game developers could cover most customers by supporting them, but not all. Eventually, lesser-known hardware makers would create products that were compatible with the same drivers as the big names. Which is why we got so many “Sound Blaster Compatible” cards back in the day.
The result was that, even if you got the most widely supported hardware, there was no guarantee that a given game would work with your computer. DirectX solved this problem.
DirectX Makes Things Easier for Developers and Hardware Makers
Each version of DirectX (and we’re up to DirectX 12) lays down the set of hardware and software features that compatible hardware must have. In other words, if you want your graphics card to be certified for the latest version of DirectX, it has to have a minimum set of capabilities built into it.
Developers then write their games not to be compatible with a specific graphics card, but to be compatible with DirectX itself. In other words, both hardware makers and game developers standardize their products to DirectX and, as such, any game and hardware component designed to work with a specific version of DirectX are guaranteed to play nicely with each other.
DirectX Is The “X” in Xbox
Everyone knows that the two biggest names in the video game console space are PlayStation and Xbox, but what you might not know is that the original name of the latter was at first “DirectX Box”.
It’s probably for the best that Microsoft decided to shorten the name, but it’s also a very accurate description of the console. The first Xbox was cobbled together with PC hardware, running a cut-down version of Windows and DirectX. That’s still true today with the latest Xbox Series X and S consoles.
One big benefit of this is that porting games between Xbox and Windows PC is very simple. Since they are in effect the same platform. PlayStation and Nintendo Switch use their own APIs however, which brings us to the next important fact about DirectX.
DirectX is Not the Only Game in Town
While DirectX has become one of the most important and widespread APIs, it’s far from the only one. Many different organizations recognized that there was a need for standardization. While DirectX is an API that encompasses everything from graphics to game controllers, there are also APIs that only focus on one aspect, such as graphics.
When the first 3D graphics card started to become popular in the mid 90s, the need for graphics APIs became acute. The 3dFX Voodoo cards used the proprietary Glide API. OpenGL (Open Graphics Library) is an open standard that remains popular today and exists in its modern form as Vulkan. Also, Apple has its Metal API for its own devices and there are many more in other device categories such as mobile phones and tablets.
While DirectX doesn’t have complete market dominance, other APIs are influenced by what Microsoft decided to mandate in each version of DirectX. That being said, they don’t dictate to everyone else. Each version of DirectX is created in consultation with all the stakeholders, so the relationship does seem to be more mutual than one might assume.
DirectX isn’t Something You Need to Worry About
The big question is to what extent you, the user, need to worry about DirectX. In the past, with earlier versions of DirectX on older Windows systems, you would have to install DirectX manually. Most of the time, a given game would bundle the minimum version of DirectX it needed. If that installer detected a newer version of that DirectX generation on the system it would simply install nothing.
Each DirectX version (e.g. 9c,11 &12) is its own thing, but Windows 10 comes with copies of them preinstalled. Your older games will run just fine on your shiny new Windows 10 computer.
What’s far more important is your selection of hardware. You can always update the software or download the right software to make retro games work, but the hardware you have can’t be changed without an upgrade or a new computer.
Hardware Compliance With DirectX
Every piece of hardware that’s relevant to videogames or any other application that uses similar technology, is generally compliant with the latest version of DirectX at the time of its release.
However, should a new version of DirectX be released, there’s a chance your existing hardware might not be compliant if it’s missing a hardware feature that a new version of DirectX needs to work. This isn’t a reason to immediately switch your hardware though!
There’s always a transitional period where games support multiple versions of DirectX. For example, it’s currently typical for games to support both DirectX 11 and DirectX 12. However, if you’re in the market for a new piece of hardware (especially GPUs) then it’s a good idea to buy something that’s compatible with the newest major version of DirectX. Since you’d like your new purchase to remain relevant for at least a few years.
While you’re at it, you may as well check if your new hardware is compliant with the latest versions of other major competing APIs, such as Vulcan, as well.