Jump to content
  • Advertisement
Sign in to follow this  
IPeetry

Nvidea PerfHUD help

This topic is 2595 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys,
I'm trying to use PerfHUD but my program keeps failing, from what I can tell from debug its that the device ptr becomes invalid. I believe I have the device setup correct for PerfHUD use, i.e. using the code below as given by nvidea. Any help/tips would be appreciated, am I doing somthing fundementally wrong?


// Set default settings
UINT AdapterToUse = D3DADAPTER_DEFAULT;
D3DDEVTYPE DeviceType = D3DDEVTYPE_HAL;

#if SHIPPING_VERSION
// When building a shipping version, disable PerfHUD (opt-out)
#else
// Look for 'NVIDIA PerfHUD' adapter
// If it is present, override default settings
for (UINT Adapter=0; Adapter < d3d9->GetAdapterCount(); Adapter++)
{
D3DADAPTER_IDENTIFIER9 Identifier;
HRESULT Res;
Res = d3d9->GetAdapterIdentifier(Adapter, 0, &Identifier);
if (strstr(Identifier.Description, "PerfHUD") != 0)
{
::MessageBox(0, "PerfHUD Adapter found", 0, 0);

AdapterToUse=Adapter;
DeviceType=D3DDEVTYPE_REF;
break;
}
}
#endif

Share this post


Link to post
Share on other sites
Advertisement
I have extacly the same code as yours except this line:

if (strstr(Identifier.Description, "PerfHUD") != 0)

Shouldn't it be the following?
if(strstr(Identifier.Description,"NVIDIA PerfHUD") != 0)



Share this post


Link to post
Share on other sites

I have extacly the same code as yours except this line:

if (strstr(Identifier.Description, "PerfHUD") != 0)

Shouldn't it be the following?
if(strstr(Identifier.Description,"NVIDIA PerfHUD") != 0)




Soz, I should have said it finds the adapter ok its after that the program fails.

Share this post


Link to post
Share on other sites
Where does it crash exactly?
Do you check all return values when calling the API?
Do you check for hardware compatibility with the chosen adapter? (surface format,...)

You might need to post the relevant code so we can try to help you.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!