Gerade mal schreibfaul ;c)
| Microsoft hat folgendes geschrieben: |
There is no direct way to obtain the DirectX version number. However, each version has a characteristic set of objects and interfaces. Because any version of DirectX supports all previous versions, this set of interfaces and objects will be supported by the version in which they are introduced and all subsequent versions. Thus, the preferred way to determine whether your desired version is available is to test for its characteristic objects or interfaces. As long as those are present, your application will work normally even though you might be using a more recent version of DirectX.
For example, suppose you need DirectX 6.1 support. The Microsoft DirectMusic® object (CLSID_DirectMusic) was introduced in DirectX 6.1. You can test for the presence of the DirectMusic object by attempting to create it with CoCreateInstance. If you are successful, you have version 6.1 or later, and you will be able to use all the DirectX 6.1 capabilities.
Rather than provide a detailed list here of each version's characteristic interfaces and objects, you should refer to the DirectX software development kits (SDKs) sample section. One of the samples is a function, GetDXVersion, that includes tests for all DirectX versions. GetDXVersion returns an integer that corresponds to the DirectX version that is present on the system. As long as this integer is greater than or equal to your desired version number, your application will run normally. You can find the sample code under your SDK root folder at \Samples\Multimedia\DXMisc\GetDXVer.
|
Zu deutsch: erzeuge einfach ein Direct3D7-Objekt und gut ist. Allerdings am besten mit CoCreateInstance in einem Programm, das nicht statisch an eine d3d.dll gelinkt ist, weil sonst das Programm unter Umständen nicht startet und du gar keine Fehlermeldung mehr ausgeben kannst ;c)
Wenn NULL besonders groß ist, ist es fast schon wie ein bisschen eins.