Enumerating DevicesTo be able to enumerate the Devices, a valid Direct3D object must be available. This is achieved by using QueryInterface on the DirectDraw object as shown below:
The call to enumerate Direct3D Devices is EnumDevices(). The parameters passed are: the pointer to any variable you wish to pass, and the pointer to the callback function For Example:
EnumDevices will be called once for each Device found. Notice that I passed the address of the current DisplayDriver's D3DDeviceList variable. The code for EnumDevices follows In EnumDevices, a variable is declared to refer to the D3DDeviceList value passed. A new D3DDevice variable is then allocated. This structure is filled with the relevant information that was passed to this function. As opposed to the Display Driver information, the Name is more useful for our purposes. The GUID is saved, as well as a BOOL flag to indicate whether the Device is Hardware or Software. Next, the Device is added to the end of the D3DDeviceList passed.
|
|||||||||||