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?
[DX9]DeviceCheck
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
Popular Topics
Advertisement