# C1.Util.DX.DXGI.Factory.GetAdapter

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DXGI_Factory_GetAdapter_" data-uid="C1.Util.DX.DXGI.Factory.GetAdapter*">GetAdapter Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DXGI_Factory_GetAdapter_" data-uid="C1.Util.DX.DXGI.Factory.GetAdapter*"></a>
<h4 id="C1_Util_DX_DXGI_Factory_GetAdapter_System_Int32_" data-uid="C1.Util.DX.DXGI.Factory.GetAdapter(System.Int32)">GetAdapter(int)</h4>
<div class="markdown level1 summary"><p>Gets both adapters (video cards) with or without outputs.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Adapter GetAdapter(int index)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetAdapter(index As Integer) As Adapter</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">index</span></td>
      <td><p>The index of the adapter to enumerate.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DXGI.Adapter.html">Adapter</a></td>
      <td><p>a reference to an <a class="xref" href="C1.Util.DX.DXGI.Adapter.html">Adapter</a> interface at the position specified by the Adapter parameter</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DXGI_Factory_GetAdapter_System_Int32__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>When you create a factory, the factory enumerates the set of adapters that are available in the system. Therefore, if you change the adapters in a system, you must destroy  and recreate the <a class="xref" href="C1.Util.DX.DXGI.Factory.html">Factory</a> object. The number of adapters in a system changes when you add or remove a display card, or dock or undock a laptop.When the EnumAdapters method succeeds and fills the ppAdapter parameter with the address of the reference to the adapter interface, EnumAdapters increments the adapter interface's reference count. When you finish using the  adapter interface, call the Release method to decrement the reference count before you destroy the reference.EnumAdapters first returns the local adapter with the output on which the desktop primary is displayed. This adapter corresponds with an index of zero. EnumAdapters then returns other adapters with outputs.</p>
</div>


<a id="C1_Util_DX_DXGI_Factory_GetAdapter_" data-uid="C1.Util.DX.DXGI.Factory.GetAdapter*"></a>
<h4 id="C1_Util_DX_DXGI_Factory_GetAdapter_System_Int32_C1_Util_DX_DXGI_Adapter__" data-uid="C1.Util.DX.DXGI.Factory.GetAdapter(System.Int32,C1.Util.DX.DXGI.Adapter@)">GetAdapter(int, out Adapter)</h4>
<div class="markdown level1 summary"><p>HRESULT IDXGIFactory::EnumAdapters([In] unsigned int Adapter,[Out] IDXGIAdapter** ppAdapter)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public HResult GetAdapter(int adapter, out Adapter adapterOut)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetAdapter(adapter As Integer, ByRef adapterOut As Adapter) As HResult</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">adapter</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DXGI.Adapter.html">Adapter</a></td>
      <td><span class="parametername">adapterOut</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.HResult.html">HResult</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
