Home -> IGraphicsDeviceEnumerator

Declaration

class IGraphicsDeviceEnumerator;

Description

The IGraphicsDeviceEnumerator interface is used to enumerate all graphics devices in the system which are reported as being available for use by the renderer. In order to retrieve information on available graphics devices, the application must call the EnumerateDevices method. If the operation succeeds, the application can call the GetAllDevices method, which returns a list of IGraphicsDevice objects, through which additional information can be queried, and an IRenderer can be constructed. The GetPreferredDevice method can be used to obtain a recommendation on the preferred device to use for high performance rendering tasks.

The application can also call the filtering methods to filter out certain entries from the device list. While the GetAllDevices method will always return the complete list of available devices, the GetFilteredDevices method returns a reduced subset of the available devices that pass the active filters. The GetPreferredDevice method also takes filtering into account, and will return the preferred device from the filtered set of devices. Any combination of filtering methods can be called, with each filtering setting adding to the filters that have been previously applied. The ClearDeviceFilters method can be called to remove all filters.

ImportantImportant

A successful call to EnumerateDevices indicates that the enumeration process completed, but does not guarantee that any compatible graphics devices were found. On systems without the required graphics API, driver, hardware capability, or requested enumeration support, GetAllDevices and GetFilteredDevices may return empty lists, and GetPreferredDevice may return nullptr. Applications should always handle this case explicitly.

WarningWarning

Note that the IGraphicsDeviceEnumerator object retains ownership of all IGraphicsDevice objects it returns. These objects are not owned by the caller, and will be deleted when the IGraphicsDeviceEnumerator object is destroyed. For this reason, it is the responsibility of the caller to ensure that no IGraphicsDevice objects are used after the owning IGraphicsDeviceEnumerator is destroyed.

Enumerations

Name Description
Public Enum EnumerationFlags
Optional flags to control how the enumeration operation is performed

Members

Initialization methods

Name Description
Public member Delete
Deletes the object. After calling this method, the object is destroyed.

Device methods

Name Description
Public member EnumerateDevices
Scans the available devices on the system. When this method is called, any previously allocated IGraphicsDevice objects are destroyed.
Public member FoundDevice
Returns whether the most recent enumeration located at least one compatible graphics device.
Public member GetAllDevices
Returns a list of all compatible graphics devices detected on the system, which were identified as a result of a previous call to EnumerateDevices. This list may be empty.
Public member GetFilteredDevices
Returns the current filtered set of compatible graphics devices detected on the system. This list may be empty.
Public member GetPreferredDevice
Returns the device from the filtered device list which has been selected as the best option for high performance rendering tasks, or nullptr if the filtered device list is empty.

Filtering methods

Name Description
Public member FilterDevice
Removes the specific target device from the filtered device list
Public member FilterDevicesOfType
Removes all devices of the specified type from the filtered device list
Public member FilterDevicesNotOfType
Removes all devices which are not of the specified type from the filtered device list
Public member FilterDevicesWithoutFeature
Removes all devices which don't support the specified feature from the filtered device list
Public member FilterDevicesWithoutAllFeatures
Removes all devices which don't support all features in the specified feature set from the filtered device list
Public member ClearDeviceFilters
Removes all previously applied device filters

See also