Jump to content
  • Advertisement
Sign in to follow this  
ArgusMaker

[DX9]DeviceCheck

This topic is 2526 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 there.
I have a variable with a pointer to my Direct3DDevice9
(IDirect3DDevice9* pd3dDevice)
and i know my code may modify its value.
How can i quickly test if pd3dDevice actually points to a valid device?

Share this post


Link to post
Share on other sites
Advertisement
As SiCrane said, you can't. You can however use a smart pointer instead, so you don't have to worry about whether the pointer is valid or not.

Share this post


Link to post
Share on other sites
zero it out in constructor and after a call to CreateDevice it should not be 0, if it succeeded; so if(pD3DDevice) pD3DDevice is valid

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!