Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMartins Mozeiko

Posted 31 December 2012 - 01:24 AM

You should check that EnumAdapters1 returns S_OK.
Also you should check that GetDesc1 return S_OK.
If they don't return S_OK, then their error return code should hint where the problem lies - Get Desc1 expects pointer to existing structure, not NULL. It write to the object passed, but if you pass NULL there's nowhere to write adapter properties.

So you should write:

DXGI_ADAPTER_DESC1 temp_desc;
if (FAILED(adapter_ptr->GetDesc1(&temp_desc)) { error }

@NewDisplayName: nullptr is now standard way in C++11 how to say NULL.

#2Martins Mozeiko

Posted 31 December 2012 - 01:24 AM

<p>You should check that EnumAdapters1 returns S_OK.</p>
<p>Also you should check that GetDesc1 return S_OK.</p>
<p>If they don't return S_OK, then their error return code should hint where the problem lies - Get Desc1 expects pointer to existing structure, not NULL. It write to the object passed, but if you pass NULL there's nowhere to write adapter properties.</p>
<p>&nbsp;</p>
<p>So you should write:</p>
<p>&nbsp;</p>
<pre class="_prettyXprint _lang-auto _linenums:1">
DXGI_ADAPTER_DESC1 temp_desc;
if (FAILED(adapter_ptr-&gt;GetDesc1(&amp;temp_desc)) { error }</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>@NewDisplayName: nullptr is now standard way in C++11 how to say NULL.</p>

#1Martins Mozeiko

Posted 31 December 2012 - 01:21 AM

You should check that EnumAdapters1 returns S_OK.

Also you should check that GetDesc1 return S_OK.

If they don't return S_OK, then their error return code should hint where the problem lies - Get Desc1 expects pointer to existing structure, not NULL.

So you should write:

DXGI_ADAPTER_DESC1 temp_desc;
if (FAILED(adapter_ptr->GetDesc1(&temp_desc)) { error }

 

@NewDisplayName: nullptr is now standard way in C++11 how to say NULL.


PARTNERS