IDXGIAdapter::EnumOutputs method
Enumerate adapter (video card) outputs.
Syntax
HRESULT EnumOutputs( UINT Output, [out] IDXGIOutput **ppOutput );
Parameters
- Output
-
Type: UINT
The index of the output.
- ppOutput [out]
-
Type: IDXGIOutput**
The address of a pointer to an IDXGIOutput interface at the position specified by the Output parameter.
Return value
Type: HRESULT
A code that indicates success or failure (see DXGI_ERROR). DXGI_ERROR_NOT_FOUND is returned if the index is greater than the number of outputs.
If the adapter came from a device created using D3D_DRIVER_TYPE_WARP, then the adapter has no outputs, so DXGI_ERROR_NOT_FOUND is returned.
Remarks
When the EnumOutputs method succeeds and fills the ppOutput parameter with the address of the pointer to the output interface, EnumOutputs increments the output interface's reference count. To avoid a memory leak, when you finish using the output interface, call the Release method to decrement the reference count.
EnumOutputs first returns the output on which the desktop primary is displayed. This output corresponds with an index of zero. EnumOutputs then returns other outputs.
Examples
Enumerating Outputs
Here is an example of how to use EnumOutputs to enumerate all the outputs on an adapter:
UINT i = 0;
IDXGIOutput * pOutput;
std::vector<IDXGIOutput*> vOutputs;
while(pAdapter->EnumOutputs(i, &pOutput) != DXGI_ERROR_NOT_FOUND)
{
vOutputs.push_back(pOutput);
++i;
}
Requirements
|
Header |
|
|---|---|
|
Library |
|
See also