[DX9]DeviceCheck

Started by
2 comments, last by Asesh 12 years, 3 months ago
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?
Advertisement
In general, you can't.
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.
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

This topic is closed to new replies.

Advertisement