Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
97 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

by Nathan Davies from Alamar's Domain

  Contents

 Introduction
 Display Drivers
 Display Modes
 D3D Devices
 Cleanup and
 Conclusion


 Printable version

 


Enumerating Drivers

The call to enumerate Drivers is DirectDrawEnumerateEx(). The paramters passed are: the pointer to the callback function, the pointer to any variable you wish to pass, and lastly, the Flags. For Example:

// Driver Enumeration Function DirectDrawEnumerateEx((LPDDENUMCALLBACKEX)EnumDisplayDrivers, NULL, DDENUM_ATTACHEDSECONDARYDEVICES | DDENUM_DETACHEDSECONDARYDEVICES | DDENUM_NONDISPLAYDEVICES );

EnumDisplayDrivers will be called once for each Driver found. The code for EnumDisplayDrivers follows

Popup : EnumDisplayDrivers

In EnumDisplayDrivers, a new DisplayDriver variable is allocated. This structure is filled with the relevant information that was passed to this function. I chose to save the GUID and the Description. The name of a Driver is currently not very descriptive and in my opinion, not nearly as useful as the Description. The D3DDevice and DisplayMode lists are initialized to NULL along with the Next value. Next, the Driver is added to the end of the global DisplayDriverList.


Next : Display Modes