# C1.Util.DX.Direct3D11.Device1.CreateDeviceContextState

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_Direct3D11_Device1_CreateDeviceContextState_" data-uid="C1.Util.DX.Direct3D11.Device1.CreateDeviceContextState*">CreateDeviceContextState Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_Direct3D11_Device1_CreateDeviceContextState_" data-uid="C1.Util.DX.Direct3D11.Device1.CreateDeviceContextState*"></a>
<h4 id="C1_Util_DX_Direct3D11_Device1_CreateDeviceContextState__1_C1_Util_DX_Direct3D11_CreateDeviceContextStateFlags_C1_Util_DX_Direct3D11_FeatureLevel___C1_Util_DX_Direct3D11_FeatureLevel__" data-uid="C1.Util.DX.Direct3D11.Device1.CreateDeviceContextState``1(C1.Util.DX.Direct3D11.CreateDeviceContextStateFlags,C1.Util.DX.Direct3D11.FeatureLevel[],C1.Util.DX.Direct3D11.FeatureLevel@)">CreateDeviceContextState&lt;T&gt;(CreateDeviceContextStateFlags, FeatureLevel[], out FeatureLevel)</h4>
<div class="markdown level1 summary"><p>Creates a context state object that holds all Microsoft Direct3D state and some Direct3D behavior.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public DeviceContextState CreateDeviceContextState&lt;T&gt;(CreateDeviceContextStateFlags flags, FeatureLevel[] featureLevelsRef, out FeatureLevel chosenFeatureLevelRef) where T : ComObject</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateDeviceContextState(Of T As ComObject)(flags As CreateDeviceContextStateFlags, featureLevelsRef As FeatureLevel(), ByRef chosenFeatureLevelRef As FeatureLevel) As DeviceContextState</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="C1.Util.DX.Direct3D11.CreateDeviceContextStateFlags.html">CreateDeviceContextStateFlags</a></td>
      <td><span class="parametername">flags</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.FeatureLevel.html">FeatureLevel</a>[]</td>
      <td><span class="parametername">featureLevelsRef</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.FeatureLevel.html">FeatureLevel</a></td>
      <td><span class="parametername">chosenFeatureLevelRef</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.Direct3D11.DeviceContextState.html">DeviceContextState</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct3D11_Device1_CreateDeviceContextState_" data-uid="C1.Util.DX.Direct3D11.Device1.CreateDeviceContextState*"></a>
<h4 id="C1_Util_DX_Direct3D11_Device1_CreateDeviceContextState_C1_Util_DX_Direct3D11_CreateDeviceContextStateFlags_C1_Util_DX_Direct3D11_FeatureLevel___System_Int32_System_Int32_System_Guid_C1_Util_DX_Direct3D11_FeatureLevel__" data-uid="C1.Util.DX.Direct3D11.Device1.CreateDeviceContextState(C1.Util.DX.Direct3D11.CreateDeviceContextStateFlags,C1.Util.DX.Direct3D11.FeatureLevel[],System.Int32,System.Int32,System.Guid,C1.Util.DX.Direct3D11.FeatureLevel@)">CreateDeviceContextState(CreateDeviceContextStateFlags, FeatureLevel[], int, int, Guid, out FeatureLevel)</h4>
<div class="markdown level1 summary"><p>HRESULT ID3D11Device1::CreateDeviceContextState([In] D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG Flags,[In, Buffer] const D3D_FEATURE_LEVEL* pFeatureLevels,[In] unsigned int FeatureLevels,[In] unsigned int SDKVersion,[In] const GUID&amp; EmulatedInterface,[Out, Optional] D3D_FEATURE_LEVEL* pChosenFeatureLevel,[Out, Fast] ID3DDeviceContextState** ppContextState)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public DeviceContextState CreateDeviceContextState(CreateDeviceContextStateFlags flags, FeatureLevel[] featureLevelsRef, int featureLevels, int sDKVersion, Guid emulatedInterface, out FeatureLevel chosenFeatureLevelRef)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateDeviceContextState(flags As CreateDeviceContextStateFlags, featureLevelsRef As FeatureLevel(), featureLevels As Integer, sDKVersion As Integer, emulatedInterface As Guid, ByRef chosenFeatureLevelRef As FeatureLevel) As DeviceContextState</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="C1.Util.DX.Direct3D11.CreateDeviceContextStateFlags.html">CreateDeviceContextStateFlags</a></td>
      <td><span class="parametername">flags</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.FeatureLevel.html">FeatureLevel</a>[]</td>
      <td><span class="parametername">featureLevelsRef</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">featureLevels</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">sDKVersion</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></td>
      <td><span class="parametername">emulatedInterface</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct3D11.FeatureLevel.html">FeatureLevel</a></td>
      <td><span class="parametername">chosenFeatureLevelRef</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.Direct3D11.DeviceContextState.html">DeviceContextState</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
