Please help with directx

Could someone help me please? I am having a real problem finding these answers.


I'm shutting down a game does this look okay? It's directx 7 and 8.



if(lpdikey){

lpdikey->Unaquire();

lpdikey->Release();

}

if(lpdi)

lpdi->Release();



Now what happens if there is an error with the direct input or direct draw while I'm setting one of them up and it calls this shutdown, will the Releases (and Unacquire) still always be effective or can the error leave it in a non null state that doesn't release and unaquire properly?





...And if I am working with a bitmap and it fails does my safe delete always work :



SAFE_DELETE { if (p) {delete(p); (p) = NULL;}}



or can it fail in a non null state that doesn't delete properly?



Thank you for your time,



JoshuaE


By setting up I mean functions such as these:


if (lpdi->CreateDevice(GUID_SysKeyboard, &lpdikey, NULL)!=DI_OK)
return(0);
.
.
.


if (DirectDrawCreateEx(NULL, (void **)&lpdd, IID_IDirectDraw7, NULL)!=DD_OK)
return(0);
.
.
.


If no one knows maybe you could point me in the right direction.
Last edited on
Topic archived. No new replies allowed.